From 3ef9a0744e716ab2c5484c253c1cb40dd703e1b0 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 6 Jun 2016 22:09:57 +0200 Subject: l 1: move hardware: mors <-> shodan --- lass/1systems/mors.nix | 4 ++-- lass/1systems/shodan.nix | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'lass') diff --git a/lass/1systems/mors.nix b/lass/1systems/mors.nix index a7a1fd253..b044939d7 100644 --- a/lass/1systems/mors.nix +++ b/lass/1systems/mors.nix @@ -131,8 +131,8 @@ }; services.udev.extraRules = '' - SUBSYSTEM=="net", ATTR{address}=="a0:88:b4:29:26:bc", NAME="wl0" - SUBSYSTEM=="net", ATTR{address}=="f0:de:f1:0c:a7:63", NAME="et0" + SUBSYSTEM=="net", ATTR{address}=="00:24:d7:f0:a0:0c", NAME="wl0" + SUBSYSTEM=="net", ATTR{address}=="f0:de:f1:8f:85:c9", NAME="et0" ''; #TODO activationScripts seem broken, fix them! diff --git a/lass/1systems/shodan.nix b/lass/1systems/shodan.nix index 6829428ff..b05b9d265 100644 --- a/lass/1systems/shodan.nix +++ b/lass/1systems/shodan.nix @@ -69,8 +69,8 @@ with builtins; }; }; - #services.udev.extraRules = '' - # SUBSYSTEM=="net", ATTR{address}=="64:27:37:7d:d8:ae", NAME="wl0" - # SUBSYSTEM=="net", ATTR{address}=="f0:de:f1:b8:c8:2e", NAME="et0" - #''; + services.udev.extraRules = '' + SUBSYSTEM=="net", ATTR{address}=="a0:88:b4:29:26:bc", NAME="wl0" + SUBSYSTEM=="net", ATTR{address}=="f0:de:f1:0c:a7:63", NAME="et0" + ''; } -- cgit v1.2.3 From b447c3953334947421eb4693f66050c37acf2c34 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 6 Jun 2016 22:11:11 +0200 Subject: l 1 mors: disable broken startupScript --- lass/1systems/mors.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lass') diff --git a/lass/1systems/mors.nix b/lass/1systems/mors.nix index b044939d7..598e502ad 100644 --- a/lass/1systems/mors.nix +++ b/lass/1systems/mors.nix @@ -146,7 +146,7 @@ #Autosuspend for USB device Broadcom Bluetooth Device [Broadcom Corp] #echo 'auto' > '/sys/bus/usb/devices/1-1.4/power/control' #Autosuspend for USB device Biometric Coprocessor - echo 'auto' > '/sys/bus/usb/devices/1-1.3/power/control' + #echo 'auto' > '/sys/bus/usb/devices/1-1.3/power/control' #Runtime PMs echo 'auto' > '/sys/bus/pci/devices/0000:00:02.0/power/control' -- cgit v1.2.3 From 85ab676579beac3083b6c278858c0efea4efb358 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 6 Jun 2016 22:11:52 +0200 Subject: l 1 shodan: activate git --- lass/1systems/shodan.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'lass') diff --git a/lass/1systems/shodan.nix b/lass/1systems/shodan.nix index b05b9d265..9a29682a2 100644 --- a/lass/1systems/shodan.nix +++ b/lass/1systems/shodan.nix @@ -5,6 +5,7 @@ with builtins; imports = [ ../. ../2configs/baseX.nix + ../2configs/git.nix ../2configs/exim-retiolum.nix ../2configs/browsers.nix ../2configs/programs.nix -- cgit v1.2.3 From fd95a5a2049580ef66886ca15563bcf798d254b2 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 6 Jun 2016 22:12:55 +0200 Subject: l 1 shodan: mount /dev/pool/home-lass --- lass/1systems/shodan.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lass') diff --git a/lass/1systems/shodan.nix b/lass/1systems/shodan.nix index 9a29682a2..073d86790 100644 --- a/lass/1systems/shodan.nix +++ b/lass/1systems/shodan.nix @@ -68,6 +68,11 @@ with builtins; "/boot" = { device = "/dev/sda1"; }; + + "/home/lass" = { + device = "/dev/pool/home-lass"; + fsType = "ext4"; + }; }; services.udev.extraRules = '' -- cgit v1.2.3 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') 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') 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') 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') 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') 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 72335ce00ec759e5b9d7a1468fe517e66948d8ed Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 8 Jun 2016 18:22:15 +0200 Subject: l 1 prism: serve nix-cache --- lass/1systems/prism.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lass') diff --git a/lass/1systems/prism.nix b/lass/1systems/prism.nix index 6ed80ac39..9a9bd4730 100644 --- a/lass/1systems/prism.nix +++ b/lass/1systems/prism.nix @@ -210,6 +210,30 @@ in { '') ]; } + { + services.nix-serve = { + enable = true; + secretKeyFile = config.krebs.secret.files.nix-serve-key.path; + }; + systemd.services.nix-serve = { + requires = ["secret.service"]; + after = ["secret.service"]; + }; + krebs.secret.files.nix-serve-key = { + path = "/run/secret/nix-serve.key"; + owner.name = "nix-serve"; + source-path = toString + "/nix-serve.key"; + }; + krebs.nginx = { + enable = true; + servers.nix-serve = { + server-names = [ "cache.prism.r" ]; + locations = lib.singleton (lib.nameValuePair "/" '' + proxy_pass http://localhost:${toString config.services.nix-serve.port}; + ''); + }; + }; + } ]; krebs.build.host = config.krebs.hosts.prism; -- 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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') 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/1systems/mors.nix | 1 + lass/2configs/umts.nix | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 lass/2configs/umts.nix (limited to 'lass') diff --git a/lass/1systems/mors.nix b/lass/1systems/mors.nix index 598e502ad..beb5659d0 100644 --- a/lass/1systems/mors.nix +++ b/lass/1systems/mors.nix @@ -29,6 +29,7 @@ ../2configs/cbase.nix ../2configs/mail.nix ../2configs/krebs-pass.nix + ../2configs/umts.nix #../2configs/buildbot-standalone.nix { #risk of rain port 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') 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') 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 92fac1a26e0ab67c295d7cb8984d88e9e022ed1e Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 13 Jun 2016 18:19:35 +0200 Subject: l 1 dishfire: activate simple exim-smarthost --- lass/1systems/dishfire.nix | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'lass') diff --git a/lass/1systems/dishfire.nix b/lass/1systems/dishfire.nix index b5e551952..ec9f53694 100644 --- a/lass/1systems/dishfire.nix +++ b/lass/1systems/dishfire.nix @@ -5,7 +5,7 @@ ../. ../2configs/default.nix - ../2configs/exim-retiolum.nix + #../2configs/exim-retiolum.nix ../2configs/git.nix { boot.loader.grub = { @@ -63,6 +63,35 @@ { predicate = "-p tcp --dport https"; target = "ACCEPT"; } ]; } + { + #TODO: abstract & move to own file + krebs.exim-smarthost = { + enable = true; + relay_from_hosts = map (host: host.nets.retiolum.ip4.addr) [ + config.krebs.hosts.mors + config.krebs.hosts.uriel + config.krebs.hosts.helios + ]; + system-aliases = [ + { from = "mailer-daemon"; to = "postmaster"; } + { from = "postmaster"; to = "root"; } + { from = "nobody"; to = "root"; } + { from = "hostmaster"; to = "root"; } + { from = "usenet"; to = "root"; } + { from = "news"; to = "root"; } + { from = "webmaster"; to = "root"; } + { from = "www"; to = "root"; } + { from = "ftp"; to = "root"; } + { from = "abuse"; to = "root"; } + { from = "noc"; to = "root"; } + { from = "security"; to = "root"; } + { from = "root"; to = "lass"; } + ]; + }; + krebs.iptables.tables.filter.INPUT.rules = [ + { predicate = "-p tcp --dport smtp"; target = "ACCEPT"; } + ]; + } ]; krebs.build.host = config.krebs.hosts.dishfire; -- 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') 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') 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 + lass/5pkgs/default.nix | 1 + lass/5pkgs/rs/default.nix | 6 ++++++ 3 files changed, 8 insertions(+) create mode 100644 lass/5pkgs/rs/default.nix (limited to 'lass') 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 diff --git a/lass/5pkgs/default.nix b/lass/5pkgs/default.nix index 467867f63..402fd1ffc 100644 --- a/lass/5pkgs/default.nix +++ b/lass/5pkgs/default.nix @@ -10,6 +10,7 @@ }; mk_sql_pair = pkgs.callPackage ./mk_sql_pair/default.nix {}; mpv-poll = pkgs.callPackage ./mpv-poll/default.nix {}; + rs = pkgs.callPackage ./rs/default.nix {}; untilport = pkgs.callPackage ./untilport/default.nix {}; urban = pkgs.callPackage ./urban/default.nix {}; xmonad-lass = diff --git a/lass/5pkgs/rs/default.nix b/lass/5pkgs/rs/default.nix new file mode 100644 index 000000000..6b27908fb --- /dev/null +++ b/lass/5pkgs/rs/default.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: + +#TODO: get tab-completion working again +pkgs.writeBashBin "rs" '' + rsync -vaP --append-verify "$@" +'' -- 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') 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') 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') 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') 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 3a92ac0e9b577be9f0d3d36fdfce977171b37560 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 16 Jun 2016 22:42:14 +0200 Subject: l 3: add power-action --- lass/3modules/default.nix | 1 + lass/3modules/power-action.nix | 67 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 lass/3modules/power-action.nix (limited to 'lass') diff --git a/lass/3modules/default.nix b/lass/3modules/default.nix index 380d83a91..b3037205e 100644 --- a/lass/3modules/default.nix +++ b/lass/3modules/default.nix @@ -4,6 +4,7 @@ _: ./ejabberd ./folderPerms.nix ./mysql-backup.nix + ./power-action.nix ./urxvtd.nix ./wordpress_nginx.nix ./xresources.nix diff --git a/lass/3modules/power-action.nix b/lass/3modules/power-action.nix new file mode 100644 index 000000000..fd6dcf57e --- /dev/null +++ b/lass/3modules/power-action.nix @@ -0,0 +1,67 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.lass.power-action; + + out = { + options.lass.power-action = api; + config = mkIf cfg.enable imp; + }; + + api = { + enable = mkEnableOption "power-action"; + user = mkOption { + type = types.user; + default = { + name = "power-action"; + }; + }; + startAt = mkOption { + type = types.str; + default = "*:0/1"; + }; + plans = mkOption { + type = with types; attrsOf (submodule { + options = { + upperLimit = mkOption { + type = int; + }; + lowerLimit = mkOption { + type = int; + }; + action = mkOption { + type = path; + }; + }; + }); + }; + }; + + imp = { + systemd.services.power-action = { + serviceConfig = rec { + ExecStart = startScript; + User = cfg.user; + }; + startAt = cfg.startAt; + }; + users.users.${cfg.user.name} = { + inherit (cfg.user) name uid; + }; + }; + + startScript = pkgs.writeDash "power-action" '' + power="$(${powerlvl})" + ${concatStringsSep "\n" (mapAttrsToList writeRule cfg.plans)} + ''; + + writeRule = _: plan: + "if [ $power -ge ${toString plan.lowerLimit} ] && [ $power -le ${toString plan.upperLimit} ]; then ${plan.action}; fi"; + + powerlvl = pkgs.writeDash "powerlvl" '' + cat /sys/class/power_supply/BAT0/capacity + ''; + +in out -- 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') 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') 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') 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') 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') 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') 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 a6d1879739593d0bc53cf218f031b68410767d90 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 18 Jun 2016 19:51:07 +0200 Subject: =?UTF-8?q?l=203=20power-action:=20fix=20some=20stuff=20(=C2=AF\?= =?UTF-8?q?=5F(=E3=83=84)=5F/=C2=AF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lass/3modules/power-action.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lass') diff --git a/lass/3modules/power-action.nix b/lass/3modules/power-action.nix index fd6dcf57e..631e651ff 100644 --- a/lass/3modules/power-action.nix +++ b/lass/3modules/power-action.nix @@ -1,13 +1,13 @@ { config, lib, pkgs, ... }: -with lib; +with config.krebs.lib; let cfg = config.lass.power-action; out = { options.lass.power-action = api; - config = mkIf cfg.enable imp; + config = lib.mkIf cfg.enable imp; }; api = { @@ -43,7 +43,7 @@ let systemd.ser