From 3dbb0294269666954a5e7ffa24342c4ad20bbb03 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 6 Jun 2016 22:15:20 +0200 Subject: l 2: bump nixpkgs f632f8e -> 5ae35cd --- lass/2configs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lass/2configs') diff --git a/lass/2configs/default.nix b/lass/2configs/default.nix index 1c06acf38..5cb2614a8 100644 --- a/lass/2configs/default.nix +++ b/lass/2configs/default.nix @@ -57,7 +57,7 @@ with config.krebs.lib; stockholm = "/home/lass/stockholm"; nixpkgs = { url = https://github.com/lassulus/nixpkgs; - rev = "f632f8edaf80ffa8bf0b8c9b9064cae3ccbe3894"; + rev = "5ae35cd00571033901c424001c3878f5974f4992"; dev = "/home/lass/src/nixpkgs"; }; } // optionalAttrs config.krebs.build.host.secure { -- cgit v1.2.3 From 821fec2bcdf811dcca30e0fae40fa7812800ff6c Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 6 Jun 2016 22:17:41 +0200 Subject: l 2 xserver Xresources: steal tv's colors --- lass/2configs/xserver/Xresources.nix | 47 +++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 4 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/xserver/Xresources.nix b/lass/2configs/xserver/Xresources.nix index e3b0f45dc..5d3661706 100644 --- a/lass/2configs/xserver/Xresources.nix +++ b/lass/2configs/xserver/Xresources.nix @@ -19,9 +19,48 @@ pkgs.writeText "Xresources" '' URxvt.intensityStyles: false - URxvt*background: #000000 - URxvt*foreground: #ffffff + URxvt*background: #050505 + ! URxvt*background: #041204 + + !URxvt.depth: 32 + !URxvt*background: rgba:0500/0500/0500/cccc + + ! URxvt*background: #080810 + URxvt*foreground: #d0d7d0 + ! URxvt*background: black + ! URxvt*foreground: white + ! URxvt*background: rgb:00/00/40 + ! URxvt*foreground: rgb:a0/a0/d0 + ! XTerm*cursorColor: rgb:00/00/60 + URxvt*cursorColor: #f042b0 + URxvt*cursorColor2: #f0b000 + URxvt*cursorBlink: off + ! URxvt*cursorUnderline: true + ! URxvt*highlightColor: #232323 + ! URxvt*highlightTextColor: #b0ffb0 + + URxvt*.pointerBlank: true + URxvt*.pointerBlankDelay: 987654321 + URxvt*.pointerColor: #f042b0 + URxvt*.pointerColor2: #050505 + + ! URxvt*color0: #000000 + ! URxvt*color1: #c00000 + ! URxvt*color2: #80c070 + URxvt*color3: #c07000 + ! URxvt*color4: #0000c0 + URxvt*color4: #4040c0 + ! URxvt*color5: #c000c0 + ! URxvt*color6: #008080 + URxvt*color7: #c0c0c0 + + URxvt*color8: #707070 + URxvt*color9: #ff6060 + URxvt*color10: #70ff70 + URxvt*color11: #ffff70 + URxvt*color12: #7070ff + URxvt*color13: #ff50ff + URxvt*color14: #70ffff + URxvt*color15: #ffffff - !change unreadable blue - URxvt*color4: #268bd2 '' -- cgit v1.2.3 From 208e8f6c0b1c2c84f0f1dcbdf3fc489b926df190 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 7 Jun 2016 10:43:51 +0200 Subject: l 2 websites domsen: www. for most domains --- lass/2configs/websites/domsen.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index 45d09c3b9..8322403ad 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -23,20 +23,20 @@ let in { imports = [ ./sqlBackup.nix - (ssl [ "reich-gebaeudereinigung.de" ]) - (servePage [ "reich-gebaeudereinigung.de" ]) + (ssl [ "reich-gebaeudereinigung.de" "www.reich-gebaeudereinigung.de" ]) + (servePage [ "reich-gebaeudereinigung.de" "www.reich-gebaeudereinigung.de" ]) - (ssl [ "karlaskop.de" ]) - (servePage [ "karlaskop.de" ]) + (ssl [ "karlaskop.de" "www.karlaskop.de" ]) + (servePage [ "karlaskop.de" "www.karlaskop.de" ]) - (ssl [ "makeup.apanowicz.de" ]) - (servePage [ "makeup.apanowicz.de" ]) + (ssl [ "makeup.apanowicz.de" "www.makeup.apanowicz.de" ]) + (servePage [ "makeup.apanowicz.de" "www.makeup.apanowicz.de" ]) - (ssl [ "pixelpocket.de" ]) - (servePage [ "pixelpocket.de" ]) + (ssl [ "pixelpocket.de" "www.pixelpocket.de" ]) + (servePage [ "pixelpocket.de" "www.pixelpocket.de" ]) - (ssl [ "o.ubikmedia.de" ]) - (serveOwncloud [ "o.ubikmedia.de" ]) + (ssl [ "o.ubikmedia.de" "www.o.ubikmedia.de" ]) + (serveOwncloud [ "o.ubikmedia.de" "www.o.ubikmedia.de" ]) (ssl [ "ubikmedia.de" "aldona.ubikmedia.de" "apanowicz.de" "nirwanabluete.de" "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" ]) (serveWordpress [ "ubikmedia.de" "*.ubikmedia.de" "apanowicz.de" "nirwanabluete.de" "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" ]) -- cgit v1.2.3 From 9d8980a51eeba08acaa57c2164bfce66b15fe1b6 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 7 Jun 2016 20:03:47 +0200 Subject: l 2 websites domsen: enable more www. domains --- lass/2configs/websites/domsen.nix | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index 8322403ad..d62b58c17 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -38,8 +38,36 @@ in { (ssl [ "o.ubikmedia.de" "www.o.ubikmedia.de" ]) (serveOwncloud [ "o.ubikmedia.de" "www.o.ubikmedia.de" ]) - (ssl [ "ubikmedia.de" "aldona.ubikmedia.de" "apanowicz.de" "nirwanabluete.de" "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" ]) - (serveWordpress [ "ubikmedia.de" "*.ubikmedia.de" "apanowicz.de" "nirwanabluete.de" "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" ]) + (ssl [ + "ubikmedia.de" + "aldona.ubikmedia.de" + "apanowicz.de" + "nirwanabluete.de" + "aldonasiech.com" + "360gradvideo.tv" + "ubikmedia.eu" + "www.ubikmedia.de" + "www.aldona.ubikmedia.de" + "www.apanowicz.de" + "www.nirwanabluete.de" + "www.aldonasiech.com" + "www.360gradvideo.tv" + "www.ubikmedia.eu" + ]) + (serveWordpress [ + "ubikmedia.de" + "apanowicz.de" + "nirwanabluete.de" + "aldonasiech.com" + "360gradvideo.tv" + "ubikmedia.eu" + "www.apanowicz.de" + "www.nirwanabluete.de" + "www.aldonasiech.com" + "www.360gradvideo.tv" + "www.ubikmedia.eu" + "*.ubikmedia.de" + ]) ]; lass.mysqlBackup.config.all.databases = [ -- cgit v1.2.3 From 8c1257facc7b599dd62a730cf35370d68ff8799b Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 7 Jun 2016 20:04:36 +0200 Subject: l 2: bump nixpkgs 5ae35cd -> 2e971b0 --- lass/2configs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lass/2configs') diff --git a/lass/2configs/default.nix b/lass/2configs/default.nix index 5cb2614a8..aa37b8e6b 100644 --- a/lass/2configs/default.nix +++ b/lass/2configs/default.nix @@ -57,7 +57,7 @@ with config.krebs.lib; stockholm = "/home/lass/stockholm"; nixpkgs = { url = https://github.com/lassulus/nixpkgs; - rev = "5ae35cd00571033901c424001c3878f5974f4992"; + rev = "2e971b07db3fb77e0590fff09d0b9cb086159caa"; dev = "/home/lass/src/nixpkgs"; }; } // optionalAttrs config.krebs.build.host.secure { -- cgit v1.2.3 From 01a66f42e1efe82478cb680bdaa3de4f9388143e Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 8 Jun 2016 18:22:35 +0200 Subject: l 2 exim-smarthost: add netzclub@lassul.us --- lass/2configs/exim-smarthost.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass/2configs') diff --git a/lass/2configs/exim-smarthost.nix b/lass/2configs/exim-smarthost.nix index 8199f2bd7..e9527fec5 100644 --- a/lass/2configs/exim-smarthost.nix +++ b/lass/2configs/exim-smarthost.nix @@ -28,6 +28,7 @@ with config.krebs.lib; { from = "wordpress@ubikmedia.de"; to = lass.mail; } { from = "finanzamt@lassul.us"; to = lass.mail; } { from = "dominik@apanowicz.de"; to = "dma@ubikmedia.eu"; } + { from = "netzclub@lassul.us"; to = lass.mail; } ]; system-aliases = [ { from = "mailer-daemon"; to = "postmaster"; } -- cgit v1.2.3 From 82f811474c036daff9b29a4ee1e89784dc781cc9 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 8 Jun 2016 18:23:02 +0200 Subject: l 2: activate prism as binary-cache --- lass/2configs/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lass/2configs') diff --git a/lass/2configs/default.nix b/lass/2configs/default.nix index aa37b8e6b..ce42a1ffa 100644 --- a/lass/2configs/default.nix +++ b/lass/2configs/default.nix @@ -40,6 +40,12 @@ with config.krebs.lib; }; }; } + { + nix = { + binaryCaches = ["http://cache.prism.r"]; + binaryCachePublicKeys = ["cache.prism-1:+S+6Lo/n27XEtvdlQKuJIcb1yO5NUqUCE2lolmTgNJU="]; + }; + } ]; networking.hostName = config.krebs.build.host.name; -- cgit v1.2.3 From 14fd045f5bab7252d3fa9d4c909b471312b5399d Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 11 Jun 2016 00:26:21 +0200 Subject: l 2 buildbot-standalone: add build-all target --- lass/2configs/buildbot-standalone.nix | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/buildbot-standalone.nix b/lass/2configs/buildbot-standalone.nix index 604d0728d..d1be464f3 100644 --- a/lass/2configs/buildbot-standalone.nix +++ b/lass/2configs/buildbot-standalone.nix @@ -29,16 +29,26 @@ name="fast-all-branches", builderNames=["fast-tests"])) ''; + build-all-scheduler = '' + # build all lass hosts + sched.append(schedulers.SingleBranchScheduler( + ## only master + change_filter=util.ChangeFilter(branch_re="master"), + # treeStableTimer=10, + name="prism-master", + builderNames=["build-all"])) + ''; }; builder_pre = '' # prepare grab_repo step for stockholm grab_repo = steps.Git(repourl=stockholm_repo, mode='incremental') - env = {"LOGNAME": "lass", "NIX_REMOTE": "daemon"} + # TODO: get nixpkgs/stockholm paths from krebs + env = {"LOGNAME": "lass", "NIX_REMOTE": "daemon", "dummy_secrets": "true", "NIX_PATH": "nixpkgs=/var/src/nixpkgs:stockholm=/var/src/stockholm"} # prepare nix-shell # the dependencies which are used by the test script - deps = [ "gnumake", "jq","nix","rsync" ] + deps = [ "gnumake", "jq", "nix", "rsync" ] # TODO: --pure , prepare ENV in nix-shell command: # SSL_CERT_FILE,LOGNAME,NIX_REMOTE nixshell = ["nix-shell", @@ -51,6 +61,24 @@ factory.addStep(steps.ShellCommand(**kwargs)) ''; builder = { + build-all = '' + f = util.BuildFactory() + f.addStep(grab_repo) + #TODO: get hosts via krebs + for i in [ "mors", "uriel", "shodan", "helios", "cloudkrebs", "echelon", "dishfire", "prism" ]: + addShell(f,name="build-{}".format(i),env=env, + command=nixshell + \ + ["nix-build \ + --show-trace --no-out-link \ + -I nixos-config=./lass/1systems/{}.nix \ + -I secrets=/var/src/stockholm/lass/2configs/tests/dummy-secrets \ + -A config.system.build.toplevel".format(i)]) + + bu.append(util.BuilderConfig(name="build-all", + slavenames=slavenames, + factory=f)) + + ''; fast-tests = '' f = util.BuildFactory() f.addStep(grab_repo) @@ -93,7 +121,7 @@ password = "lasspass"; packages = with pkgs;[ git nix gnumake jq rsync ]; extraEnviron = { - NIX_PATH="nixpkgs=/var/src/nixpkgs:nixos-config=./shared/1systems/wolf.nix"; + NIX_PATH="nixpkgs=/var/src/nixpkgs"; }; }; krebs.iptables = { -- cgit v1.2.3 From 05e339626edb6b6a62cda74ee27389fc51b8be41 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 11 Jun 2016 00:27:12 +0200 Subject: l 2: enable dummy_secrets via env --- lass/2configs/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lass/2configs') diff --git a/lass/2configs/default.nix b/lass/2configs/default.nix index ce42a1ffa..6dcec5c18 100644 --- a/lass/2configs/default.nix +++ b/lass/2configs/default.nix @@ -58,7 +58,10 @@ with config.krebs.lib; user = config.krebs.users.lass; source = mapAttrs (_: mkDefault) ({ nixos-config = "symlink:stockholm/lass/1systems/${config.krebs.build.host.name}.nix"; - secrets = "/home/lass/secrets/${config.krebs.build.host.name}"; + secrets = + if getEnv "dummy_secrets" == "true" + then toString + else "/home/lass/secrets/${config.krebs.build.host.name}"; #secrets-common = "/home/lass/secrets/common"; stockholm = "/home/lass/stockholm"; nixpkgs = { -- cgit v1.2.3 From 91fe76414ad9fa217bc48c9e4ecd642dcbb38211 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 11 Jun 2016 00:28:09 +0200 Subject: l 2: add/move some basic pkgs --- lass/2configs/baseX.nix | 2 ++ lass/2configs/default.nix | 3 +++ lass/2configs/radio.nix | 1 - lass/2configs/weechat.nix | 1 - 4 files changed, 5 insertions(+), 2 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/baseX.nix b/lass/2configs/baseX.nix index 16f7502ac..7e969b3ed 100644 --- a/lass/2configs/baseX.nix +++ b/lass/2configs/baseX.nix @@ -32,6 +32,7 @@ in { environment.systemPackages = with pkgs; [ + acpi dmenu gitAndTools.qgit lm_sensors @@ -44,6 +45,7 @@ in { sxiv xclip xorg.xbacklight + xorg.xhost xsel zathura diff --git a/lass/2configs/default.nix b/lass/2configs/default.nix index 6dcec5c18..f4a0de35f 100644 --- a/lass/2configs/default.nix +++ b/lass/2configs/default.nix @@ -123,8 +123,11 @@ with config.krebs.lib; #neat utils krebspaste + pciutils psmisc + tmux untilport + usbutils #unpack stuff p7zip diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix index 17be327b9..cb21cd446 100644 --- a/lass/2configs/radio.nix +++ b/lass/2configs/radio.nix @@ -52,7 +52,6 @@ in { print_current ncmpcpp mpc_cli - tmux ]; security.sudo.extraConfig = '' diff --git a/lass/2configs/weechat.nix b/lass/2configs/weechat.nix index 5e14871ac..0bfd9fe6b 100644 --- a/lass/2configs/weechat.nix +++ b/lass/2configs/weechat.nix @@ -5,7 +5,6 @@ let in { krebs.per-user.chat.packages = with pkgs; [ mosh - tmux weechat ]; -- cgit v1.2.3 From cf0914ddcbc5f06fd82fb67acb885167c1145d21 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 11 Jun 2016 00:28:55 +0200 Subject: l 2 radio: don't use systemds path --- lass/2configs/radio.nix | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix index cb21cd446..19fe1408d 100644 --- a/lass/2configs/radio.nix +++ b/lass/2configs/radio.nix @@ -11,7 +11,7 @@ let source-password = import ; add_random = pkgs.writeDashBin "add_random" '' - mpc add "$(mpc ls | shuf -n1)" + ${pkgs.mpc_cli}/bin/mpc add "$(${pkgs.mpc_cli}/bin/mpc ls | shuf -n1)" ''; skip_track = pkgs.writeDashBin "skip_track" '' @@ -122,8 +122,8 @@ in { LIMIT=$1 #in secconds timeLeft () { - playlistDuration=$(mpc --format '%time%' playlist | awk -F ':' 'BEGIN{t=0} {t+=$1*60+$2} END{print t}') - currentTime=$(mpc status | awk '/^\[playing\]/ { sub(/\/.+/,"",$3); split($3,a,/:/); print a[1]*60+a[2] }') + playlistDuration=$(${pkgs.mpc_cli}/bin/mpc --format '%time%' playlist | ${pkgs.gawk}/bin/awk -F ':' 'BEGIN{t=0} {t+=$1*60+$2} END{print t}') + currentTime=$(${pkgs.mpc_cli}/bin/mpc status | ${pkgs.gawk}/bin/awk '/^\[playing\]/ { sub(/\/.+/,"",$3); split($3,a,/:/); print a[1]*60+a[2] }') expr ''${playlistDuration:-0} - ''${currentTime:-0} } @@ -135,11 +135,6 @@ in { description = "radio playlist autoadder"; after = [ "network.target" ]; - path = with pkgs; [ - gawk - mpc_cli - ]; - restartIfChanged = true; serviceConfig = { -- cgit v1.2.3 From c19c13957a08effbd6f88ac7e7d691ea4a8aaaf5 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 11 Jun 2016 00:31:44 +0200 Subject: l 2 radio: don't restart autoAdder --- lass/2configs/radio.nix | 1 - 1 file changed, 1 deletion(-) (limited to 'lass/2configs') diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix index 19fe1408d..a5c14afcf 100644 --- a/lass/2configs/radio.nix +++ b/lass/2configs/radio.nix @@ -138,7 +138,6 @@ in { restartIfChanged = true; serviceConfig = { - Restart = "always"; ExecStart = "${autoAdd} 100"; }; }; -- cgit v1.2.3 From 01dc6b6caba709e1bbbd3bac55bfb671a5666810 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 11 Jun 2016 02:51:10 +0200 Subject: l 2 tests: add dummy-secrets --- lass/2configs/tests/dummy-secrets/cbase.txt | 0 lass/2configs/tests/dummy-secrets/hashedPasswords.nix | 1 + lass/2configs/tests/dummy-secrets/icecast-admin-pw | 1 + lass/2configs/tests/dummy-secrets/icecast-source-pw | 1 + lass/2configs/tests/dummy-secrets/lassul.us.dkim.priv | 3 +++ lass/2configs/tests/dummy-secrets/mysql_rootPassword | 1 + lass/2configs/tests/dummy-secrets/nix-serve.key | 1 + lass/2configs/tests/dummy-secrets/repos.nix | 1 + lass/2configs/tests/dummy-secrets/retiolum.rsa_key.priv | 4 ++++ lass/2configs/tests/dummy-secrets/ssh.id_ed25519 | 3 +++ lass/2configs/tests/dummy-secrets/ssh.id_rsa | 3 +++ lass/2configs/tests/dummy-secrets/transmission-pw | 1 + 12 files changed, 20 insertions(+) create mode 100644 lass/2configs/tests/dummy-secrets/cbase.txt create mode 100644 lass/2configs/tests/dummy-secrets/hashedPasswords.nix create mode 100644 lass/2configs/tests/dummy-secrets/icecast-admin-pw create mode 100644 lass/2configs/tests/dummy-secrets/icecast-source-pw create mode 100644 lass/2configs/tests/dummy-secrets/lassul.us.dkim.priv create mode 100644 lass/2configs/tests/dummy-secrets/mysql_rootPassword create mode 100644 lass/2configs/tests/dummy-secrets/nix-serve.key create mode 100644 lass/2configs/tests/dummy-secrets/repos.nix create mode 100644 lass/2configs/tests/dummy-secrets/retiolum.rsa_key.priv create mode 100644 lass/2configs/tests/dummy-secrets/ssh.id_ed25519 create mode 100644 lass/2configs/tests/dummy-secrets/ssh.id_rsa create mode 100644 lass/2configs/tests/dummy-secrets/transmission-pw (limited to 'lass/2configs') diff --git a/lass/2configs/tests/dummy-secrets/cbase.txt b/lass/2configs/tests/dummy-secrets/cbase.txt new file mode 100644 index 000000000..e69de29bb diff --git a/lass/2configs/tests/dummy-secrets/hashedPasswords.nix b/lass/2configs/tests/dummy-secrets/hashedPasswords.nix new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/lass/2configs/tests/dummy-secrets/hashedPasswords.nix @@ -0,0 +1 @@ +{} diff --git a/lass/2configs/tests/dummy-secrets/icecast-admin-pw b/lass/2configs/tests/dummy-secrets/icecast-admin-pw new file mode 100644 index 000000000..16b542cee --- /dev/null +++ b/lass/2configs/tests/dummy-secrets/icecast-admin-pw @@ -0,0 +1 @@ +"blabla" diff --git a/lass/2configs/tests/dummy-secrets/icecast-source-pw b/lass/2configs/tests/dummy-secrets/icecast-source-pw new file mode 100644 index 000000000..16b542cee --- /dev/null +++ b/lass/2configs/tests/dummy-secrets/icecast-source-pw @@ -0,0 +1 @@ +"blabla" diff --git a/lass/2configs/tests/dummy-secrets/lassul.us.dkim.priv b/lass/2configs/tests/dummy-secrets/lassul.us.dkim.priv new file mode 100644 index 000000000..215a7fa0c --- /dev/null +++ b/lass/2configs/tests/dummy-secrets/lassul.us.dkim.priv @@ -0,0 +1,3 @@ +-----BEGIN RSA PRIVATE KEY----- +this is a private key +-----END RSA PRIVATE KEY----- diff --git a/lass/2configs/tests/dummy-secrets/mysql_rootPassword b/lass/2configs/tests/dummy-secrets/mysql_rootPassword new file mode 100644 index 000000000..922a74472 --- /dev/null +++ b/lass/2configs/tests/dummy-secrets/mysql_rootPassword @@ -0,0 +1 @@ +blabla123 diff --git a/lass/2configs/tests/dummy-secrets/nix-serve.key b/lass/2configs/tests/dummy-secrets/nix-serve.key new file mode 100644 index 000000000..91448ad2f --- /dev/null +++ b/lass/2configs/tests/dummy-secrets/nix-serve.key @@ -0,0 +1 @@ +key-name:blabla123 diff --git a/lass/2configs/tests/dummy-secrets/repos.nix b/lass/2configs/tests/dummy-secrets/repos.nix new file mode 100644 index 000000000..eed712458 --- /dev/null +++ b/lass/2configs/tests/dummy-secrets/repos.nix @@ -0,0 +1 @@ +_: {} diff --git a/lass/2configs/tests/dummy-secrets/retiolum.rsa_key.priv b/lass/2configs/tests/dummy-secrets/retiolum.rsa_key.priv new file mode 100644 index 000000000..99a4033f6 --- /dev/null +++ b/lass/2configs/tests/dummy-secrets/retiolum.rsa_key.priv @@ -0,0 +1,4 @@ + +-----BEGIN RSA PRIVATE KEY----- +this is a private key +-----END RSA PRIVATE KEY----- diff --git a/lass/2configs/tests/dummy-secrets/ssh.id_ed25519 b/lass/2configs/tests/dummy-secrets/ssh.id_ed25519 new file mode 100644 index 000000000..5c12da0b3 --- /dev/null +++ b/lass/2configs/tests/dummy-secrets/ssh.id_ed25519 @@ -0,0 +1,3 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +private key bla +-----END OPENSSH PRIVATE KEY----- diff --git a/lass/2configs/tests/dummy-secrets/ssh.id_rsa b/lass/2configs/tests/dummy-secrets/ssh.id_rsa new file mode 100644 index 000000000..885cf61f0 --- /dev/null +++ b/lass/2configs/tests/dummy-secrets/ssh.id_rsa @@ -0,0 +1,3 @@ +-----BEGIN RSA PRIVATE KEY----- +private key bla +-----END RSA PRIVATE KEY----- diff --git a/lass/2configs/tests/dummy-secrets/transmission-pw b/lass/2configs/tests/dummy-secrets/transmission-pw new file mode 100644 index 000000000..b71df1a2d --- /dev/null +++ b/lass/2configs/tests/dummy-secrets/transmission-pw @@ -0,0 +1 @@ +"krebskrebs123" -- cgit v1.2.3 From a78f3e3ebe7a991caf6c3718929c360891871c37 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 11 Jun 2016 10:55:40 +0200 Subject: l 2 buildbot-standalone: use git dummy-secrets --- lass/2configs/buildbot-standalone.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/buildbot-standalone.nix b/lass/2configs/buildbot-standalone.nix index d1be464f3..151ce562b 100644 --- a/lass/2configs/buildbot-standalone.nix +++ b/lass/2configs/buildbot-standalone.nix @@ -44,7 +44,7 @@ grab_repo = steps.Git(repourl=stockholm_repo, mode='incremental') # TODO: get nixpkgs/stockholm paths from krebs - env = {"LOGNAME": "lass", "NIX_REMOTE": "daemon", "dummy_secrets": "true", "NIX_PATH": "nixpkgs=/var/src/nixpkgs:stockholm=/var/src/stockholm"} + env = {"LOGNAME": "lass", "NIX_REMOTE": "daemon", "dummy_secrets": "true"} # prepare nix-shell # the dependencies which are used by the test script @@ -71,7 +71,8 @@ ["nix-build \ --show-trace --no-out-link \ -I nixos-config=./lass/1systems/{}.nix \ - -I secrets=/var/src/stockholm/lass/2configs/tests/dummy-secrets \ + -I secrets=./lass/2configs/tests/dummy-secrets \ + -I stockholm=. \ -A config.system.build.toplevel".format(i)]) bu.append(util.BuilderConfig(name="build-all", -- cgit v1.2.3 From 2a51473d3553459ee8794d78a1eed17e9a86f7eb Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 11 Jun 2016 13:57:44 +0200 Subject: l 2 fetchWallpaper: get wallpapar from prism --- lass/2configs/fetchWallpaper.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lass/2configs') diff --git a/lass/2configs/fetchWallpaper.nix b/lass/2configs/fetchWallpaper.nix index f3b65e816..d28ae9353 100644 --- a/lass/2configs/fetchWallpaper.nix +++ b/lass/2configs/fetchWallpaper.nix @@ -5,7 +5,7 @@ let in { krebs.fetchWallpaper = { enable = true; - url = "cloudkrebs/wallpaper.png"; + url = "prism/wallpaper.png"; }; } -- cgit v1.2.3 From 75d3e5210d7f50fa6e0bdcae9a5a495f937049f1 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 11 Jun 2016 14:53:18 +0200 Subject: l 2: move nixpkgs to seperate file --- lass/2configs/default.nix | 6 +----- lass/2configs/nixpkgs.nix | 8 ++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 lass/2configs/nixpkgs.nix (limited to 'lass/2configs') diff --git a/lass/2configs/default.nix b/lass/2configs/default.nix index f4a0de35f..da3123512 100644 --- a/lass/2configs/default.nix +++ b/lass/2configs/default.nix @@ -7,6 +7,7 @@ with config.krebs.lib; ../2configs/zsh.nix ../2configs/mc.nix ../2configs/retiolum.nix + ../2configs/nixpkgs.nix ./backups.nix { users.extraUsers = @@ -64,11 +65,6 @@ with config.krebs.lib; else "/home/lass/secrets/${config.krebs.build.host.name}"; #secrets-common = "/home/lass/secrets/common"; stockholm = "/home/lass/stockholm"; - nixpkgs = { - url = https://github.com/lassulus/nixpkgs; - rev = "2e971b07db3fb77e0590fff09d0b9cb086159caa"; - dev = "/home/lass/src/nixpkgs"; - }; } // optionalAttrs config.krebs.build.host.secure { #secrets-master = "/home/lass/secrets/master"; }); diff --git a/lass/2configs/nixpkgs.nix b/lass/2configs/nixpkgs.nix new file mode 100644 index 000000000..c893011a3 --- /dev/null +++ b/lass/2configs/nixpkgs.nix @@ -0,0 +1,8 @@ +{ ... }: + +{ + krebs.build.source.nixpkgs = { + url = https://github.com/lassulus/nixpkgs; + rev = "f215f9e91e07473e61c9302aaa312c7350e98f0e"; + }; +} -- cgit v1.2.3 From f99ff4bb19ad28cd927a40715cc362c439cb6c16 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 11 Jun 2016 14:56:11 +0200 Subject: l 2 websites domsen: add facts.cloud --- lass/2configs/websites/domsen.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lass/2configs') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index d62b58c17..6ad55031e 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -46,6 +46,7 @@ in { "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" + "facts.cloud" "www.ubikmedia.de" "www.aldona.ubikmedia.de" "www.apanowicz.de" @@ -53,6 +54,7 @@ in { "www.aldonasiech.com" "www.360gradvideo.tv" "www.ubikmedia.eu" + "www.facts.cloud" ]) (serveWordpress [ "ubikmedia.de" @@ -61,12 +63,14 @@ in { "aldonasiech.com" "360gradvideo.tv" "ubikmedia.eu" + "facts.cloud" + "*.ubikmedia.de" "www.apanowicz.de" "www.nirwanabluete.de" "www.aldonasiech.com" "www.360gradvideo.tv" "www.ubikmedia.eu" - "*.ubikmedia.de" + "www.facts.cloud" ]) ]; -- cgit v1.2.3 From 5d528f4b677167ca212040c8869c956ee8641a7e Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 11 Jun 2016 15:47:35 +0200 Subject: l 2 websites domsen: add missing " --- lass/2configs/websites/domsen.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lass/2configs') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index 6ad55031e..775634541 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -95,7 +95,7 @@ in { services.phpfpm.phpIni = pkgs.runCommand "php.ini" { options = '' extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so - sendmail_path = ${sendmail} -t -i" + sendmail_path = "${sendmail} -t -i" ''; } '' cat ${pkgs.php}/etc/php-recommended.ini > $out -- cgit v1.2.3 From 524849d54ec5a209eed0cafe143fad2d53d436c4 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 11 Jun 2016 15:47:56 +0200 Subject: l 2 radio: start radio.service every minute --- lass/2configs/radio.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lass/2configs') diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix index a5c14afcf..12a4ddf26 100644 --- a/lass/2configs/radio.nix +++ b/lass/2configs/radio.nix @@ -113,7 +113,7 @@ in { wantedBy = [ "timers.target" ]; timerConfig = { - OnCalendar = "*:*"; + OnCalendar = "*:0/1"; }; }; -- cgit v1.2.3 From 5dfc8d41d91fd6a48fb55e34e2b12d2012d37a38 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 11 Jun 2016 21:01:04 +0200 Subject: l 2 downloading: authorize shodan --- lass/2configs/downloading.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass/2configs') diff --git a/lass/2configs/downloading.nix b/lass/2configs/downloading.nix index 3639a743a..cf9b631c8 100644 --- a/lass/2configs/downloading.nix +++ b/lass/2configs/downloading.nix @@ -21,6 +21,7 @@ in { openssh.authorizedKeys.keys = [ config.krebs.users.lass.pubkey config.krebs.users.lass-uriel.pubkey + config.krebs.users.lass-shodan.pubkey ]; }; -- cgit v1.2.3 From f832a63ce045823c1aeafec48fbe32b78ed7cd6d Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 12 Jun 2016 21:58:58 +0200 Subject: l 2 newsbot-js: fix some feeds --- lass/2configs/newsbot-js.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/newsbot-js.nix b/lass/2configs/newsbot-js.nix index 636b44395..f2b70d831 100644 --- a/lass/2configs/newsbot-js.nix +++ b/lass/2configs/newsbot-js.nix @@ -41,7 +41,6 @@ let cryptogon|http://www.cryptogon.com/?feed=rss2|#news csm|http://rss.csmonitor.com/feeds/csm|#news csm_world|http://rss.csmonitor.com/feeds/world|#news - cyberguerrilla|https://www.cyberguerrilla.org/a/2012/?feed=rss2|#news danisch|http://www.danisch.de/blog/feed/|#news dod|http://www.defense.gov/news/afps2.xml|#news dwn|http://deutsche-wirtschafts-nachrichten.de/feed/customfeed/|#news @@ -102,7 +101,7 @@ let npr_headlines|http://www.npr.org/rss/rss.php?id=1001|#news npr_pol|http://www.npr.org/rss/rss.php?id=1012|#news npr_world|http://www.npr.org/rss/rss.php?id=1004|#news - nsa|http://www.nsa.gov/rss.shtml|#news #bullerei + nsa|https://www.nsa.gov/rss.xml|#news #bullerei nytimes|http://rss.nytimes.com/services/xml/rss/nyt/World.xml|#news painload|https://github.com/krebscode/painload/commits/master.atom|#news phys|http://phys.org/rss-feed/|#news -- cgit v1.2.3 From 69c36df9acb0ca85c7412bf2ebb815fe827c0ba9 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 13 Jun 2016 13:48:43 +0200 Subject: l 1 mors: add umts config --- lass/2configs/umts.nix | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 lass/2configs/umts.nix (limited to 'lass/2configs') diff --git a/lass/2configs/umts.nix b/lass/2configs/umts.nix new file mode 100644 index 000000000..ddba1b526 --- /dev/null +++ b/lass/2configs/umts.nix @@ -0,0 +1,61 @@ +{ config, lib, pkgs, ... }: + +with config.krebs.lib; + +let + nixpkgs-1509 = import (pkgs.fetchFromGitHub { + owner = "NixOS"; repo = "nixpkgs-channels"; + rev = "91371c2bb6e20fc0df7a812332d99c38b21a2bda"; + sha256 = "1as1i0j9d2n3iap9b471y4x01561r2s3vmjc5281qinirlr4al73"; + }) {}; + + wvdial = nixpkgs-1509.wvdial; # https://github.com/NixOS/nixpkgs/issues/16113 + + modem-device = "/dev/serial/by-id/usb-Lenovo_F5521gw_38214921FBBBC7B0-if09"; + + # TODO: currently it is only netzclub + umts-bin = pkgs.writeScriptBin "umts" '' + #!/bin/sh + set -euf + systemctl stop wpa_supplicant + systemctl start umts + trap "systemctl stop umts;trap - INT TERM EXIT;exit" INT TERM EXIT + echo nameserver 8.8.8.8 | tee -a /etc/resolv.conf + journalctl -xfu umts + systemctl start wpa_supplicant + ''; + + wvdial-defaults = '' + Modem = ${modem-device} + Init1 = AT+CFUN=1 + Init2 = AT+CGDCONT=1,"IP","pinternet.interkom.de","",0,0 + Stupid mode = 1 + phone= *99# + Username = netzclub + Password = netzclub + ''; + + + out = { + environment.shellAliases = { + umts = "sudo ${umts-bin}/bin/umts"; + }; + + security.sudo.extraConfig = '' + lass ALL= (root) NOPASSWD: ${umts-bin}/bin/umts + ''; + + environment.wvdial.dialerDefaults = wvdial-defaults; + + systemd.services.umts = { + description = "UMTS wvdial Service"; + serviceConfig = { + Type = "simple"; + Restart = "always"; + RestartSec = "10s"; + ExecStart = "${wvdial}/bin/wvdial -n"; + }; + }; + }; +in out + -- cgit v1.2.3 From de43b0e6f50e4d044cc0609a3d7d7c7d869552fe Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 13 Jun 2016 13:49:24 +0200 Subject: l 2 websites fritz: activate sendmail --- lass/2configs/websites/fritz.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lass/2configs') diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index 63efbecb6..c2b8ff116 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -12,6 +12,16 @@ let serveWordpress ; + msmtprc = pkgs.writeText "msmtprc" '' + account localhost + host localhost + account default: localhost + ''; + + sendmail = pkgs.writeDash "msmtp" '' + exec ${pkgs.msmtp}/bin/msmtp --read-envelope-from -C ${msmtprc} "$@" + ''; + in { imports = [ ./sqlBackup.nix @@ -51,4 +61,14 @@ in { users.users.root.openssh.authorizedKeys.keys = [ config.krebs.users.fritz.pubkey ]; + + services.phpfpm.phpIni = pkgs.runCommand "php.ini" { + options = '' + extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so + sendmail_path = "${sendmail} -t -i" + ''; + } '' + cat ${pkgs.php}/etc/php-recommended.ini > $out + echo "$options" >> $out + ''; } -- cgit v1.2.3 From 2f77b404abc6ad36e75d437ce46ca2f6931fe389 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 13 Jun 2016 14:07:59 +0200 Subject: l 2 umts: start wpa_supplicant again in trap --- lass/2configs/umts.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/umts.nix b/lass/2configs/umts.nix index ddba1b526..ac5991afa 100644 --- a/lass/2configs/umts.nix +++ b/lass/2configs/umts.nix @@ -19,10 +19,9 @@ let set -euf systemctl stop wpa_supplicant systemctl start umts - trap "systemctl stop umts;trap - INT TERM EXIT;exit" INT TERM EXIT + trap "systemctl stop umts && systemctl start wpa_supplicant;trap - INT TERM EXIT;exit" INT TERM EXIT echo nameserver 8.8.8.8 | tee -a /etc/resolv.conf journalctl -xfu umts - systemctl start wpa_supplicant ''; wvdial-defaults = '' -- cgit v1.2.3 From eaaa96a65e76b313594d0b1155a4ca78ec91aae9 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 13 Jun 2016 22:58:00 +0200 Subject: l 2 fetchWallpaper: check for umts --- lass/2configs/fetchWallpaper.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass/2configs') diff --git a/lass/2configs/fetchWallpaper.nix b/lass/2configs/fetchWallpaper.nix index d28ae9353..a724e2e45 100644 --- a/lass/2configs/fetchWallpaper.nix +++ b/lass/2configs/fetchWallpaper.nix @@ -5,6 +5,7 @@ let in { krebs.fetchWallpaper = { enable = true; + unitConfig.ConditionPathExists = "!/var/run/ppp0.pid"; url = "prism/wallpaper.png"; }; } -- cgit v1.2.3 From abd7b0bd28ccf7635d5f14c7e38bb130dddf8d99 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 13 Jun 2016 22:58:41 +0200 Subject: l 2 umts: upgrade wvdial-defaults --- lass/2configs/umts.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lass/2configs') diff --git a/lass/2configs/umts.nix b/lass/2configs/umts.nix index ac5991afa..c1fce9ea2 100644 --- a/lass/2configs/umts.nix +++ b/lass/2configs/umts.nix @@ -28,10 +28,12 @@ let Modem = ${modem-device} Init1 = AT+CFUN=1 Init2 = AT+CGDCONT=1,"IP","pinternet.interkom.de","",0,0 - Stupid mode = 1 + Baud = 460800 phone= *99# Username = netzclub Password = netzclub + Stupid Mode = 1 + Idle Seconds = 0 ''; -- cgit v1.2.3 From bb19655339b9a77493f89b9496ade6bce9354327 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 13 Jun 2016 23:01:56 +0200 Subject: l: add and use rs pkg --- lass/2configs/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass/2configs') diff --git a/lass/2configs/default.nix b/lass/2configs/default.nix index da3123512..deb3c46c2 100644 --- a/lass/2configs/default.nix +++ b/lass/2configs/default.nix @@ -121,6 +121,7 @@ with config.krebs.lib; krebspaste pciutils psmisc + rs tmux untilport usbutils -- cgit v1.2.3 From b5b07d5a0862f9ef1d5a7f848733624b3eb7a0b7 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 13 Jun 2016 23:02:27 +0200 Subject: l 2 websites domsen: generalize msmtp target --- lass/2configs/websites/domsen.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/websites/domsen.nix b/lass/2configs/websites/domsen.nix index 775634541..c69d20633 100644 --- a/lass/2configs/websites/domsen.nix +++ b/lass/2configs/websites/domsen.nix @@ -11,9 +11,9 @@ let serveWordpress; msmtprc = pkgs.writeText "msmtprc" '' - account prism + account localhost host localhost - account default: prism + account default: localhost ''; sendmail = pkgs.writeDash "msmtp" '' -- cgit v1.2.3 From 0f3df5c0f417be6011c833203f9f4fbd346aa64b Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 14 Jun 2016 13:26:17 +0200 Subject: l 2 buildbot-standalone: add treeStableTimer --- lass/2configs/buildbot-standalone.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/buildbot-standalone.nix b/lass/2configs/buildbot-standalone.nix index 151ce562b..b70cf9da8 100644 --- a/lass/2configs/buildbot-standalone.nix +++ b/lass/2configs/buildbot-standalone.nix @@ -25,7 +25,7 @@ sched.append(schedulers.SingleBranchScheduler( ## all branches change_filter=util.ChangeFilter(branch_re=".*"), - # treeStableTimer=10, + treeStableTimer=10, name="fast-all-branches", builderNames=["fast-tests"])) ''; @@ -34,7 +34,7 @@ sched.append(schedulers.SingleBranchScheduler( ## only master change_filter=util.ChangeFilter(branch_re="master"), - # treeStableTimer=10, + treeStableTimer=10, name="prism-master", builderNames=["build-all"])) ''; -- cgit v1.2.3 From 9cc197f10e9b2e0824875ef8a7cdebe0bab8102c Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 16 Jun 2016 22:11:19 +0200 Subject: l 2 exim-smarthost: add nebenan@lassul.us --- lass/2configs/exim-smarthost.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass/2configs') diff --git a/lass/2configs/exim-smarthost.nix b/lass/2configs/exim-smarthost.nix index e9527fec5..1ba99c8cb 100644 --- a/lass/2configs/exim-smarthost.nix +++ b/lass/2configs/exim-smarthost.nix @@ -29,6 +29,7 @@ with config.krebs.lib; { from = "finanzamt@lassul.us"; to = lass.mail; } { from = "dominik@apanowicz.de"; to = "dma@ubikmedia.eu"; } { from = "netzclub@lassul.us"; to = lass.mail; } + { from = "nebenan@lassul.us"; to = lass.mail; } ]; system-aliases = [ { from = "mailer-daemon"; to = "postmaster"; } -- cgit v1.2.3 From d5ccef77d4d61f9451945ee1501513670eea8b66 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 16 Jun 2016 22:16:02 +0200 Subject: l 2 radio: check remainingTime <150s --- lass/2configs/radio.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lass/2configs') diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix index 12a4ddf26..d7cd20a36 100644 --- a/lass/2configs/radio.nix +++ b/lass/2configs/radio.nix @@ -138,7 +138,7 @@ in { restartIfChanged = true; serviceConfig = { - ExecStart = "${autoAdd} 100"; + ExecStart = "${autoAdd} 150"; }; }; -- cgit v1.2.3 From 1d47f59e8f446f0c9e774114138e9881e6f85742 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 18 Jun 2016 13:28:15 +0200 Subject: l 2: use pulse.nix --- lass/2configs/baseX.nix | 6 +--- lass/2configs/pulse.nix | 88 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 lass/2configs/pulse.nix (limited to 'lass/2configs') diff --git a/lass/2configs/baseX.nix b/lass/2configs/baseX.nix index 7e969b3ed..7431617c2 100644 --- a/lass/2configs/baseX.nix +++ b/lass/2configs/baseX.nix @@ -8,6 +8,7 @@ in { #./urxvt.nix ./xserver ./mpv.nix + ./pulse.nix ]; users.extraUsers.mainUser.extraGroups = [ "audio" ]; @@ -16,11 +17,6 @@ in { virtualisation.libvirtd.enable = true; - hardware.pulseaudio = { - enable = true; - systemWide = true; - }; - programs.ssh.startAgent = false; security.setuidPrograms = [ "slock" ]; diff --git a/lass/2configs/pulse.nix b/lass/2configs/pulse.nix new file mode 100644 index 000000000..e86ea3b94 --- /dev/null +++ b/lass/2configs/pulse.nix @@ -0,0 +1,88 @@ +{ config, lib, pkgs, ... }: + +with config.krebs.lib; +let + pkg = pkgs.pulseaudioLight; + runDir = "/run/pulse"; + + alsaConf = pkgs.writeText "asound.conf" '' + ctl_type.pulse { + libs.native = ${pkgs.alsaPlugins}/lib/alsa-lib/libasound_module_ctl_pulse.so; + } + pcm_type.pulse { + libs.native = ${pkgs.alsaPlugins}/lib/alsa-lib/libasound_module_pcm_pulse.so; + } + ctl.!default { + type pulse + } + pcm.!default { + type pulse + } + ''; + + clientConf = pkgs.writeText "client.conf" '' + autospawn=no + default-server = unix:${runDir}/socket + ''; + + configFile = pkgs.writeText "default.pa" '' + .include ${pkg}/etc/pulse/default.pa + load-module ${toString [ + "module-native-protocol-unix" + "auth-anonymous=1" + "socket=${runDir}/socket" + ]} + ''; +in + +{ + environment = { + etc = { + "asound.conf".source = alsaConf; + # XXX mkForce is not strong enough (and neither is mkOverride) to create + # /etc/pulse/client.conf, see pulseaudio-hack below for a solution. + #"pulse/client.conf" = mkForce { source = clientConf; }; + #"pulse/client.conf".source = mkForce clientConf; + "pulse/default.pa".source = configFile; + }; + systemPackages = [ + pkg + ] ++ optionals config.services.xserver.enable [ + pkgs.pavucontrol + ]; + }; + + # Allow PulseAudio to get realtime priority using rtkit. + security.rtkit.enable = true; + + system.activationScripts.pulseaudio-hack = '' + ln -fns ${clientConf} /etc/pulse/client.conf + ''; + + systemd.services.pulse = { + wantedBy = [ "sound.target" ]; + before = [ "sound.target" ]; + environment = { + PULSE_RUNTIME_PATH = "${runDir}/home"; + }; + serviceConfig = { + ExecStart = "${pkg}/bin/pulseaudio"; + ExecStartPre = pkgs.writeDash "pulse-start" '' + install -o pulse -g audio -m 0750 -d ${runDir} + install -o pulse -g audio -m 0700 -d ${runDir}/home + ''; + PermissionsStartOnly = "true"; + User = "pulse"; + }; + }; + + users = { + groups.pulse.gid = config.users.users.pulse.uid; + users.pulse = { + uid = genid "pulse"; + group = "pulse"; + extraGroups = [ "audio" ]; + home = "${runDir}/home"; + }; + }; +} -- cgit v1.2.3 From 30a80d67df7a41baab1fc3557d220c0cbbd5cf0c Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 18 Jun 2016 13:26:22 +0200 Subject: l 2 buildbot-standalone: use make test --- lass/2configs/buildbot-standalone.nix | 60 ++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 12 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/buildbot-standalone.nix b/lass/2configs/buildbot-standalone.nix index b70cf9da8..e36008335 100644 --- a/lass/2configs/buildbot-standalone.nix +++ b/lass/2configs/buildbot-standalone.nix @@ -1,6 +1,14 @@ { lib, config, pkgs, ... }: -{ - krebs.buildbot.master = let + +with config.krebs.lib; + +let + sshWrapper = pkgs.writeDash "ssh-wrapper" '' + ${pkgs.openssh}/bin/ssh -i ${shell.escape config.lass.build-ssh-privkey.path} "$@" + ''; + +in { + config.krebs.buildbot.master = let stockholm-mirror-url = http://cgit.prism/stockholm ; in { slaves = { @@ -44,11 +52,15 @@ grab_repo = steps.Git(repourl=stockholm_repo, mode='incremental') # TODO: get nixpkgs/stockholm paths from krebs - env = {"LOGNAME": "lass", "NIX_REMOTE": "daemon", "dummy_secrets": "true"} + env = { + "LOGNAME": "lass", + "NIX_REMOTE": "daemon", + "dummy_secrets": "true", + } # prepare nix-shell # the dependencies which are used by the test script - deps = [ "gnumake", "jq", "nix", "rsync" ] + deps = [ "gnumake", "jq", "nix", "rsync", "proot" ] # TODO: --pure , prepare ENV in nix-shell command: # SSL_CERT_FILE,LOGNAME,NIX_REMOTE nixshell = ["nix-shell", @@ -68,12 +80,11 @@ for i in [ "mors", "uriel", "shodan", "helios", "cloudkrebs", "echelon", "dishfire", "prism" ]: addShell(f,name="build-{}".format(i),env=env, command=nixshell + \ - ["nix-build \ - --show-trace --no-out-link \ - -I nixos-config=./lass/1systems/{}.nix \ - -I secrets=./lass/2configs/tests/dummy-secrets \ - -I stockholm=. \ - -A config.system.build.toplevel".format(i)]) + ["make \ + test \ + ssh=${sshWrapper} \ + target=build@localhost:${config.users.users.build.home}/testbuild \ + system={}".format(i)]) bu.append(util.BuilderConfig(name="build-all", slavenames=slavenames, @@ -115,7 +126,7 @@ }; }; - krebs.buildbot.slave = { + config.krebs.buildbot.slave = { enable = true; masterhost = "localhost"; username = "testslave"; @@ -125,7 +136,7 @@ NIX_PATH="nixpkgs=/var/src/nixpkgs"; }; }; - krebs.iptables = { + config.krebs.iptables = { tables = { filter.INPUT.rules = [ { predicate = "-p tcp --dport 8010"; target = "ACCEPT"; } @@ -133,4 +144,29 @@ ]; }; }; + + #ssh workaround for make test + options.lass.build-ssh-privkey = mkOption { + type = types.secret-file; + default = { + path = "${config.users.users.buildbotSlave.home}/ssh.privkey"; + owner = { inherit (config.users.users.buildbotSlave ) name uid;}; + source-path = toString + "/build.ssh.key"; + }; + }; + config.krebs.secret.files = { + build-ssh-privkey = config.lass.build-ssh-privkey; + }; + config.users.users = { + build = { + name = "build"; + uid = genid "build"; + home = "/home/build"; + useDefaultShell = true; + createHome = true; + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDiV0Xn60aVLHC/jGJknlrcxSvKd/MVeh2tjBpxSBT3II9XQGZhID2Gdh84eAtoWyxGVFQx96zCHSuc7tfE2YP2LhXnwaxHTeDc8nlMsdww53lRkxihZIEV7QHc/3LRcFMkFyxdszeUfhWz8PbJGL2GYT+s6CqoPwwa68zF33U1wrMOAPsf/NdpSN4alsqmjFc2STBjnOd9dXNQn1VEJQqGLG3kR3WkCuwMcTLS5eu0KLwG4i89Twjy+TGp2QsF5K6pNE+ZepwaycRgfYzGcPTn5d6YQXBgcKgHMoSJsK8wqpr0+eFPCDiEA3HDnf76E4mX4t6/9QkMXCLmvs0IO/WP lass@mors" + ]; + }; + }; } -- cgit v1.2.3 From 75ba114468a8f025d5916f5b7fce34635d9bbc1a Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 18 Jun 2016 13:50:52 +0200 Subject: l 2: override stockholm if dummy_secrets --- lass/2configs/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/default.nix b/lass/2configs/default.nix index deb3c46c2..9e0e37e48 100644 --- a/lass/2configs/default.nix +++ b/lass/2configs/default.nix @@ -59,12 +59,13 @@ with config.krebs.lib; user = config.krebs.users.lass; source = mapAttrs (_: mkDefault) ({ nixos-config = "symlink:stockholm/lass/1systems/${config.krebs.build.host.name}.nix"; - secrets = - if getEnv "dummy_secrets" == "true" + secrets = if getEnv "dummy_secrets" == "true" then toString else "/home/lass/secrets/${config.krebs.build.host.name}"; #secrets-common = "/home/lass/secrets/common"; - stockholm = "/home/lass/stockholm"; + stockholm = if getEnv "dummy_secrets" == "true" + then "/var/lib/buildbot/slave/build-all/build" + else "/home/lass/stockholm"; } // optionalAttrs config.krebs.build.host.secure { #secrets-master = "/home/lass/secrets/master"; }); -- cgit v1.2.3 From ab3a095a29bd69affcc7e2868a805a5680e3a876 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 18 Jun 2016 16:09:36 +0200 Subject: l 2: bump nixpkgs f215f9e -> 7d93230 --- lass/2configs/nixpkgs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lass/2configs') diff --git a/lass/2configs/nixpkgs.nix b/lass/2configs/nixpkgs.nix index c893011a3..c6d8a5f8c 100644 --- a/lass/2configs/nixpkgs.nix +++ b/lass/2configs/nixpkgs.nix @@ -3,6 +3,6 @@ { krebs.build.source.nixpkgs = { url = https://github.com/lassulus/nixpkgs; - rev = "f215f9e91e07473e61c9302aaa312c7350e98f0e"; + rev = "7d932301fe1d98a1ef1872a7124e8809279def74"; }; } -- cgit v1.2.3 From ae3a2a954d767127ae1c144685293c03a01cf1c8 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 18 Jun 2016 19:20:26 +0200 Subject: l 2 buildbot: build-all with method=build --- lass/2configs/buildbot-standalone.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass/2configs') diff --git a/lass/2configs/buildbot-standalone.nix b/lass/2configs/buildbot-standalone.nix index e36008335..7d3c236a6 100644 --- a/lass/2configs/buildbot-standalone.nix +++ b/lass/2configs/buildbot-standalone.nix @@ -84,6 +84,7 @@ in { test \ ssh=${sshWrapper} \ target=build@localhost:${config.users.users.build.home}/testbuild \ + method=build \ system={}".format(i)]) bu.append(util.BuilderConfig(name="build-all", -- cgit v1.2.3 From 61c57a2d533334a77d2a0c2cea3fee6380605a0f Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 18 Jun 2016 19:21:32 +0200 Subject: l 2 websites fritz: password protect some dirs --- lass/2configs/websites/fritz.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lass/2configs') diff --git a/lass/2configs/websites/fritz.nix b/lass/2configs/websites/fritz.nix index c2b8ff116..03574d578 100644 --- a/lass/2configs/websites/fritz.nix +++ b/lass/2configs/websites/fritz.nix @@ -1,10 +1,10 @@ { config, pkgs, lib, ... }: +with lib; let inherit (import { config = {}; inherit lib; }) genid head - nameValuePair ; inherit (import {inherit lib pkgs;}) ssl @@ -58,6 +58,18 @@ in { "ttf_kleinaspach_de" ]; + #password protect some dirs + krebs.nginx.servers."biostase.de".locations = [ + (nameValuePair "/old_biostase.de" '' + auth_basic "Administrator Login"; + auth_basic_user_file /srv/http/biostase.de/old_biostase.de/.htaccess; + '') + (nameValuePair "/mysqldumper" '' + auth_basic "Administrator Login"; + auth_basic_user_file /srv/http/biostase.de/mysqldumper/.htaccess; + '') + ]; + users.users.root.openssh.authorizedKeys.keys = [ config.krebs.users.fritz.pubkey ]; -- cgit v1.2.3 From 6e2cbdfb734d24a5c4dfb37b9ccc0b093c07c1f6 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 18 Jun 2016 20:08:46 +0200 Subject: l 2 radio: remove unneeded sudo snippet --- lass/2configs/radio.nix | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/radio.nix b/lass/2configs/radio.nix index d7cd20a36..3a38af286 100644 --- a/lass/2configs/radio.nix +++ b/lass/2configs/radio.nix @@ -54,10 +54,6 @@ in { mpc_cli ]; - security.sudo.extraConfig = '' - ${mainUser.name} ALL=(${name}) NOPASSWD: ALL - ''; - services.mpd = { enable = true; group = "radio"; -- cgit v1.2.3 From b408721046b0c84047d25f54764775d32264906d Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 18 Jun 2016 21:53:44 +0200 Subject: l 2: add power-action.nix --- lass/2configs/power-action.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lass/2configs/power-action.nix (limited to 'lass/2configs') diff --git a/lass/2configs/power-action.nix b/lass/2configs/power-action.nix new file mode 100644 index 000000000..ca4b2afe8 --- /dev/null +++ b/lass/2configs/power-action.nix @@ -0,0 +1,23 @@ +{ config, pkgs, ... }: + +let + suspend = pkgs.writeDash "suspend" '' + ${pkgs.systemd}/bin/systemctl suspend + ''; + +in { + lass.power-action = { + enable = true; + plans.suspend = { + upperLimit = 10; + lowerLimit = 0; + charging = false; + action = pkgs.writeDash "suspend-wrapper" '' + /var/setuid-wrappers/sudo ${suspend} + ''; + }; + }; + security.sudo.extraConfig = '' + ${config.lass.power-action.user.name} ALL= (root) NOPASSWD: ${suspend} + ''; +} -- cgit v1.2.3 From d2120732b7643f1dd8770b4e7f75ee6b9c991cca Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 18 Jun 2016 22:01:10 +0200 Subject: l 2 baseX: import power-action.nix --- lass/2configs/baseX.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass/2configs') diff --git a/lass/2configs/baseX.nix b/lass/2configs/baseX.nix index 7431617c2..744e8ed98 100644 --- a/lass/2configs/baseX.nix +++ b/lass/2configs/baseX.nix @@ -9,6 +9,7 @@ in { ./xserver ./mpv.nix ./pulse.nix + ./power-action.nix ]; users.extraUsers.mainUser.extraGroups = [ "audio" ]; -- cgit v1.2.3 From fa139f638e07be78393637b049a195b9abf01c30 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 19 Jun 2016 00:26:00 +0200 Subject: l 2 pulse: add /etc/pulse/daemon.conf --- lass/2configs/pulse.nix | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lass/2configs') diff --git a/lass/2configs/pulse.nix b/lass/2configs/pulse.nix index e86ea3b94..3be482191 100644 --- a/lass/2configs/pulse.nix +++ b/lass/2configs/pulse.nix @@ -25,6 +25,13 @@ let default-server = unix:${runDir}/socket ''; + daemonConf = pkgs.writeText "daemon.conf" '' + exit-idle-time=0 + flat-volumes = no + default-fragments = 4 + default-fragment-size-msec = 25 + ''; + configFile = pkgs.writeText "default.pa" '' .include ${pkg}/etc/pulse/default.pa load-module ${toString [ @@ -44,6 +51,7 @@ in #"pulse/client.conf" = mkForce { source = clientConf; }; #"pulse/client.conf".source = mkForce clientConf; "pulse/default.pa".source = configFile; + "pulse/daemon.pa".source = daemonConf; }; systemPackages = [ pkg -- cgit v1.2.3 From e37ac8ecd8dc7282953e83994dc6c4e3c78b7a85 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 19 Jun 2016 00:27:45 +0200 Subject: l 2 power-action: add low battery warning --- lass/2configs/power-action.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lass/2configs') diff --git a/lass/2configs/power-action.nix b/lass/2configs/power-action.nix index ca4b2afe8..0ff8547c7 100644 --- a/lass/2configs/power-action.nix +++ b/lass/2configs/power-action.nix @@ -5,9 +5,22 @@ let ${pkgs.systemd}/bin/systemctl suspend ''; + speak = text: + pkgs.writeDash "speak" '' + ${pkgs.espeak}/bin/espeak -v +whisper -s 110 "${text}" + ''; + in { lass.power-action = { enable = true; + plans.low-battery = { + upperLimit = 30; + lowerLimit = 25; + charging = false; + action = pkgs.writeDash "warn-low-battery" '' + ${speak "power level low"} + ''; + }; plans.suspend = { upperLimit = 10; lowerLimit = 0; @@ -17,6 +30,11 @@ in { ''; }; }; + + users.users.power-action.extraGroups = [ + "audio" + ]; + security.sudo.extraConfig = '' ${config.lass.power-action.user.name} ALL= (root) NOPASSWD: ${suspend} ''; -- cgit v1.2.3 From 914dabb84885df8162a49baba682c46ddba4c3d8 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 19 Jun 2016 17:25:55 +0200 Subject: l 2 baseX: use hardware.pulseaudio again steam sound was broken --- lass/2configs/baseX.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lass/2configs') diff --git a/lass/2configs/baseX.nix b/lass/2configs/baseX.nix index 744e8ed98..6d26ff89a 100644 --- a/lass/2configs/baseX.nix +++ b/lass/2configs/baseX.nix @@ -8,9 +8,13 @@ in { #./urxvt.nix ./xserver ./mpv.nix - ./pulse.nix + #./pulse.nix ./power-action.nix ]; + hardware.pulseaudio = { + enable = true; + systemWide = true; + }; users.extraUsers.mainUser.extraGroups = [ "audio" ]; -- cgit v1.2.3 From cd3da527790b062efcbacce97f45064d8c80dd52 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 21 Jun 2016 20:40:20 +0200 Subject: l 2 vim: use tv's config with neovim --- lass/2configs/vim.nix | 457 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 322 insertions(+), 135 deletions(-) (limited to 'lass/2configs') diff --git a/lass/2configs/vim.nix b/lass/2configs/vim.nix index 8295d9d49..105450fd8 100644 --- a/lass/2configs/vim.nix +++ b/lass/2configs/vim.nix @@ -1,158 +1,345 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: +with config.krebs.lib; let - customPlugins = { - mustang2 = pkgs.vimUtils.buildVimPlugin { - name = "Mustang2"; - src = pkgs.fetchFromGitHub { - owner = "croaker"; - repo = "mustang-vim"; - rev = "6533d7d21bf27cae94d9c2caa575f627f003dfd5"; - sha256 = "0zlmcrr04j3dkiivrhqi90f618lmnnnpvbz1b9msfs78cmgw9w67"; - }; - }; - unimpaired = pkgs.vimUtils.buildVimPlugin { - name = "unimpaired-vim"; - src = pkgs.fetchFromGitHub { - owner = "tpope"; - repo = "vim-unimpaired"; - rev = "11dc568dbfd7a56866a4354c737515769f08e9fe"; - sha256 = "1an941j5ckas8l3vkfhchdzjwcray16229rhv3a1d4pbxifwshi8"; - }; - }; - brogrammer = pkgs.vimUtils.buildVimPlugin { - name = "brogrammer"; - src = pkgs.fetchFromGitHub { - owner = "marciomazza"; - repo = "vim-brogrammer-theme"; - rev = "3e412d8e8909d8d89eb5a4cbe955b5bc0833a3c3"; - sha256 = "0am1qk8ls74z5ipgf9viacayq08y9i9vd7sxxiivwgsjh2ancbv6"; - }; - }; - file-line = pkgs.vimUtils.buildVimPlugin { - name = "file-line"; - src = pkgs.fetchFromGitHub { - owner = "bogado"; - repo = "file-line"; - rev = "f9ffa1879ad84ce4a386110446f395bc1795b72a"; - sha256 = "173n47w9zd01rcyrrmm194v79xq7d1ggzr19n1lsxrqfgr2c1rvk"; - }; - }; + out = { + environment.systemPackages = [ + vim + ]; + + environment.etc.vimrc.source = vimrc; + + environment.variables.EDITOR = mkForce "vim"; + environment.variables.VIMINIT = ":so /etc/vimrc"; }; -in { + extra-runtimepath = concatMapStringsSep "," (pkg: "${pkg.rtp}") [ + pkgs.vimPlugins.undotree + pkgs.vimPlugins.Gundo + (pkgs.vimUtils.buildVimPlugin { + name = "file-line-1.0"; + src = pkgs.fetchgit { + url = git://github.com/bogado/file-line; + rev = "refs/tags/1.0"; + sha256 = "0z47zq9rqh06ny0q8lpcdsraf3lyzn9xvb59nywnarf3nxrk6hx0"; + }; + }) + ((rtp: rtp // { inherit rtp; }) (pkgs.writeTextFile (let + name = "hack"; + in { + name = "vim-color-${name}-1.0.2"; + destination = "/colors/${name}.vim"; + text = /* vim */ '' + set background=dark + hi clear + if exists("syntax_on") + syntax clear + endif + + let colors_name = ${toJSON name} + + hi Normal ctermbg=235 + hi Comment ctermfg=242 + hi Constant ctermfg=255 + hi Identifier ctermfg=253 + hi Function ctermfg=253 + hi Statement ctermfg=253 + hi PreProc ctermfg=251 + hi Type ctermfg=251 + hi Delimiter ctermfg=251 + hi Special ctermfg=255 + + hi Garbage ctermbg=088 + hi TabStop ctermbg=016 + hi Todo ctermfg=174 ctermbg=NONE + + hi NixCode ctermfg=040 + hi NixData ctermfg=046 + hi NixQuote ctermfg=071 - environment.systemPackages = [ - (pkgs.vim_configurable.customize { + hi diffNewFile ctermfg=207 + hi diffFile ctermfg=207 + hi diffLine ctermfg=207 + hi diffSubname ctermfg=207 + hi diffAdded ctermfg=010 + hi diffRemoved ctermfg=009 + ''; + }))) + ((rtp: rtp // { inherit rtp; }) (pkgs.writeTextFile (let name = "vim"; + in { + name = "vim-syntax-${name}-1.0.0"; + destination = "/syntax/${name}.vim"; + text = /* vim */ '' + ${concatMapStringsSep "\n" (s: /* vim */ '' + syn keyword vimColor${s} ${s} + \ containedin=ALLBUT,vimComment,vimLineComment + hi vimColor${s} ctermfg=${s} + '') (map (i: lpad 3 "0" (toString i)) (range 0 255))} + ''; + }))) + ((rtp: rtp // { inherit rtp; }) (pkgs.writeTextFile (let + name = "showsyntax"; + in { + name = "vim-plugin-${name}-1.0.0"; + destination = "/plugin/${name}.vim"; + text = /* vim */ '' + if exists('g:loaded_showsyntax') + finish + endif + let g:loaded_showsyntax = 0 - vimrcConfig.customRC = '' - set nocompatible - set t_Co=16 - syntax on - " TODO autoload colorscheme file - set background=dark - colorscheme brogrammer - filetype off - filetype plugin indent on + fu! ShowSyntax() + let id = synID(line("."), col("."), 1) + let name = synIDattr(id, "name") + let transName = synIDattr(synIDtrans(id),"name") + if name != transName + let name .= " (" . transName . ")" + endif + echo "Syntax: " . name + endfu - imap + command! -n=0 -bar ShowSyntax :call ShowSyntax() + ''; + }))) + ]; - set mouse=a - set ruler - set showmatch - set backspace=2 - set visualbell - set encoding=utf8 - set showcmd - set wildmenu + dirs = { + backupdir = "$HOME/.cache/vim/backup"; + swapdir = "$HOME/.cache/vim/swap"; + undodir = "$HOME/.cache/vim/undo"; + }; + files = { + viminfo = "$HOME/.cache/vim/info"; + }; - set title - set titleold= - set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)\ -\ %{v:servername} + mkdirs = let + dirOf = s: le