From b4326e31444e1dab51d7c4469f43d37dab2d73d5 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 18 Oct 2015 01:05:49 +0200 Subject: krebs 4 infest: umount /mnt/boot prior to /boot --- krebs/4lib/infest/finalize.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'krebs') diff --git a/krebs/4lib/infest/finalize.sh b/krebs/4lib/infest/finalize.sh index 0039960c..94b13e0b 100644 --- a/krebs/4lib/infest/finalize.sh +++ b/krebs/4lib/infest/finalize.sh @@ -3,8 +3,8 @@ set -eux { umount /mnt/nix umount /mnt/root - umount /boot || : umount /mnt/boot + umount /boot || : umount /mnt coreutils_path=$(set +f; for i in /nix/store/*coreutils*/bin; do :; done; echo $i) -- cgit v1.2.3 From c3a1bca74c1d7f6e598918a8fb52c192c38999d6 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 18 Oct 2015 04:12:51 +0200 Subject: krebs 4 infest: add compatibility for centos 6.5 --- krebs/4lib/infest/prepare.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'krebs') diff --git a/krebs/4lib/infest/prepare.sh b/krebs/4lib/infest/prepare.sh index 9fbd5be8..94c9b0fb 100644 --- a/krebs/4lib/infest/prepare.sh +++ b/krebs/4lib/infest/prepare.sh @@ -18,6 +18,13 @@ prepare() {( esac ;; esac + elif test -e /etc/centos-release; then + case $(cat /etc/centos-release) in + 'CentOS release 6.5 (Final)') + prepare_centos "$@" + exit + ;; + esac fi echo "$0 prepare: unknown OS" >&2 exit -1 -- cgit v1.2.3 From ffef87c5dfc7cf6443bbef2fcc6661a06365e098 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 18 Oct 2015 17:50:54 +0200 Subject: l: specify krebs.hosts.*.nets.gg23 --- krebs/3modules/lass/default.nix | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'krebs') diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix index afedf95f..5c48d964 100644 --- a/krebs/3modules/lass/default.nix +++ b/krebs/3modules/lass/default.nix @@ -104,7 +104,11 @@ with import ../../4lib { inherit lib; }; uriel = { cores = 1; dc = "lass"; - nets = rec { + nets = { + gg23 = { + addrs4 = ["10.23.1.12"]; + aliases = ["uriel.gg23"]; + }; retiolum = { addrs4 = ["10.243.81.176"]; addrs6 = ["42:dc25:60cf:94ef:759b:d2b6:98a9:2e56"]; @@ -131,7 +135,11 @@ with import ../../4lib { inherit lib; }; mors = { cores = 2; dc = "lass"; - nets = rec { + nets = { + gg23 = { + addrs4 = ["10.23.1.11"]; + aliases = ["mors.gg23"]; + }; retiolum = { addrs4 = ["10.243.0.2"]; addrs6 = ["42:0:0:0:0:0:0:dea7"]; @@ -155,6 +163,22 @@ with import ../../4lib { inherit lib; }; ssh.privkey.path = ; ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINAMPlIG+6u75GJ3kvsPF6OoIZsU+u8ZQ+rdviv5fNMD"; }; + schnabel-ap = { + nets = { + gg23 = { + addrs4 = ["10.23.1.20"]; + aliases = ["schnabel-ap.gg23"]; + }; + }; + }; + Reichsfunk-ap = { + nets = { + gg23 = { + addrs4 = ["10.23.1.10"]; + aliases = ["Reichsfunk-ap.gg23"]; + }; + }; + }; }; users = addNames { -- cgit v1.2.3 From 2efaf0f219850cd02cc77cb41d6c1c1bdd9de6ba Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 20 Oct 2015 20:06:17 +0200 Subject: populate dir: improve error message --- krebs/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'krebs') diff --git a/krebs/default.nix b/krebs/default.nix index c23cf152..5e6595ce 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -221,11 +221,15 @@ let out = { ${config.path}/ \ root@${target}:${config.target-path} ''; - url = "file://${config.host.name}${config.path}"; + current-url = "${current-user-name}@${current-host.name}"; + source-url = "file://${config.host.name}${config.path}"; + target-url = "root@${target}:${config.target-path}"; in #if can-link then link-method else if can-push then push-method else - throw "cannot source ${url}"; + throw + # /!\ revise this message when using more than just push-method + "No way to push ${source-url} from ${current-url} to ${target-url}"; methods.git = config: rootssh target '' -- cgit v1.2.3 From acb53c23dcb11de02e642e7f99e83401531e48c1 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 20 Oct 2015 20:19:40 +0200 Subject: populate dir: drop link-method fragments --- krebs/default.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'krebs') diff --git a/krebs/default.nix b/krebs/default.nix index 5e6595ce..40b3550c 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -203,11 +203,8 @@ let out = { current-host = config.krebs.hosts.${current-host-name}; current-user = config.krebs.users.${current-user-name}; - target-host = config.krebs.hosts.${system}; - methods.dir = config: let - can-link = config.host.name == target-host.name; can-push = config.host.name == current-host.name; push-method = '' rsync \ @@ -219,13 +216,12 @@ let out = { --delete-excluded \ -vrLptgoD \ ${config.path}/ \ - root@${target}:${config.target-path} + ${target-url} ''; current-url = "${current-user-name}@${current-host.name}"; source-url = "file://${config.host.name}${config.path}"; target-url = "root@${target}:${config.target-path}"; in - #if can-link then link-method else if can-push then push-method else throw # /!\ revise this message when using more than just push-method -- cgit v1.2.3 From 9cb1fdc946aecc96bd9bbadca77b6d7e3c87abd3 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 20 Oct 2015 20:24:25 +0200 Subject: populate dir: reduce noise in error message --- krebs/default.nix | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'krebs') diff --git a/krebs/default.nix b/krebs/default.nix index 40b3550c..3e86c046 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -216,16 +216,13 @@ let out = { --delete-excluded \ -vrLptgoD \ ${config.path}/ \ - ${target-url} + root@${target}:${config.target-path} ''; - current-url = "${current-user-name}@${current-host.name}"; - source-url = "file://${config.host.name}${config.path}"; - target-url = "root@${target}:${config.target-path}"; in if can-push then push-method else - throw - # /!\ revise this message when using more than just push-method - "No way to push ${source-url} from ${current-url} to ${target-url}"; + let dir = "file://${config.host.name}${config.path}"; in + # /!\ revise this message when using more than just push-method + throw "No way to push ${dir} from ${current-host.name} to ${target}"; methods.git = config: rootssh target '' -- cgit v1.2.3 From 914c4c4a2fb6be95f7f4dbc9134fd272ec210c26 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 20 Oct 2015 20:28:26 +0200 Subject: krebs default: drop redundant "lib." --- krebs/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'krebs') diff --git a/krebs/default.nix b/krebs/default.nix index 3e86c046..9258c236 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -48,14 +48,14 @@ let out = { # eval "$RSYNC_RSH \"\$@\"" #} - ${lib.rootssh target '' + ${rootssh target '' ${builtins.readFile ./4lib/infest/prepare.sh} ${builtins.readFile ./4lib/infest/install-nix.sh} ''} - (${lib.populate args}) + (${populate args}) - ${lib.rootssh target '' + ${rootssh target '' export PATH; PATH=/root/.nix-profile/bin:$PATH src=$(type -p nixos-install) @@ -79,7 +79,7 @@ let out = { { cat_src | sed -n "1,$i{p}" - cat ${lib.doc (install args)} + cat ${doc (install args)} cat_src | sed -n "$i,\''${$i!p}" } > nixos-install chmod +x nixos-install -- cgit v1.2.3 From 9bbdfb85cf333fde4050bbef738c54ca988db228 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 20 Oct 2015 22:13:42 +0200 Subject: export krebs.populate --- krebs/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'krebs') diff --git a/krebs/default.nix b/krebs/default.nix index 9258c236..4d09075c 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -8,6 +8,7 @@ let out = { inherit deploy; inherit infest; inherit init; + inherit populate; inherit lib; }; -- cgit v1.2.3 From fc45cc29265e9b3e51033fddd5d8ea1042c1aa41 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 20 Oct 2015 23:17:32 +0200 Subject: export krebs.nixos-install Collaterally, unexport krebs.populate again. --- krebs/default.nix | 101 ++++++++++++++++++++++++++---------------------------- 1 file changed, 48 insertions(+), 53 deletions(-) (limited to 'krebs') diff --git a/krebs/default.nix b/krebs/default.nix index 4d09075c..de805a89 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -8,8 +8,8 @@ let out = { inherit deploy; inherit infest; inherit init; - inherit populate; inherit lib; + inherit nixos-install; }; deploy = @@ -24,7 +24,7 @@ let out = { set -efu (${populate args}) ${rootssh target '' - ${install args} + ${nix-install args} ${config.krebs.build.profile}/bin/switch-to-configuration switch ''} echo OK @@ -40,63 +40,14 @@ let out = { # krebs.infest set -efu - # XXX type -p is non-standard - #export RSYNC_RSH; RSYNC_RSH="$(type -p ssh) \ - # -o 'HostName $ {target.host.infest.addr}' \ - # -o 'Port $ {toString target.host.infest.port}' \ - #" - #ssh() { - # eval "$RSYNC_RSH \"\$@\"" - #} - ${rootssh target '' ${builtins.readFile ./4lib/infest/prepare.sh} ${builtins.readFile ./4lib/infest/install-nix.sh} ''} - (${populate args}) + (${nixos-install args}) ${rootssh target '' - export PATH; PATH=/root/.nix-profile/bin:$PATH - - src=$(type -p nixos-install) - cat_src() { - sed < "$src" "$( - { sed < "$src" -n ' - /^if ! test -e "\$mountPoint\/\$NIXOS_CONFIG/,/^fi$/= - /^nixpkgs=/= - /^NIX_PATH=/,/^$/{/./=} - - # Disable: Copy the NixOS/Nixpkgs sources to the target as - # the initial contents of the NixOS channel. - /^srcs=/,/^ln -sfn /= - ' - } | sed 's:$:s/^/#krebs#/:' - )" - } - - # Location to insert install - i=$(sed -n '/^echo "building the system configuration/=' "$src") - - { - cat_src | sed -n "1,$i{p}" - cat ${doc (install args)} - cat_src | sed -n "$i,\''${$i!p}" - } > nixos-install - chmod +x nixos-install - - ## Wrap inserted install into chroot. - #nix_env=$(cat_src | sed -n ' - # s:.*\(/nix/store/[a-z0-9]*-nix-[0-9.]\+/bin/nix-env\).*:\1:p;T;q - #') - #echo nix-env is $nix_env - #sed -i ' - # s:^nix-env:chroot $mountPoint '"$nix_env"': - #' nixos-install - - unset SSL_CERT_FILE - ./nixos-install - ${builtins.readFile ./4lib/infest/finalize.sh} ''} ''; @@ -136,6 +87,50 @@ let out = { EOF ''; + nixos-install = + { system ? current-host-name + , target ? system + }@args: let + in '' + #! /bin/sh + # ${current-date} ${current-user-name}@${current-host-name} + # krebs.nixos-install + (${populate args}) + + ${rootssh target '' + export PATH; PATH=/root/.nix-profile/bin:$PATH + + src=$(type -p nixos-install) + cat_src() { + sed < "$src" "$( + { sed < "$src" -n ' + /^if ! test -e "\$mountPoint\/\$NIXOS_CONFIG/,/^fi$/= + /^nixpkgs=/= + /^NIX_PATH=/,/^$/{/./=} + + # Disable: Copy the NixOS/Nixpkgs sources to the target as + # the initial contents of the NixOS channel. + /^srcs=/,/^ln -sfn /= + ' + } | sed 's:$:s/^/#krebs#/:' + )" + } + + # Location to insert `nix-install` + i=$(sed -n '/^echo "building the system configuration/=' "$src") + + { + cat_src | sed -n "1,$i{p}" + cat ${doc (nix-install args)} + cat_src | sed -n "$i,\''${$i!p}" + } > nixos-install + chmod +x nixos-install + + unset SSL_CERT_FILE + ./nixos-install + ''} + ''; + lib = import ./4lib { lib = import ; } // rec { stockholm-path = ../.; nspath = ns: p: stockholm-path + "/${ns}/${p}"; @@ -153,7 +148,7 @@ let out = { stockholm.users.${current-user-name}.${system}.config or (abort "unknown system: ${system}, user: ${current-user-name}"); - install = + nix-install = { system ? current-host-name , target ? system }: -- cgit v1.2.3 From 226ea391caec5b3f2f112de263dd2db3a0e012f4 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 21 Oct 2015 00:08:18 +0200 Subject: stockholm: provide krebs lib --- krebs/3modules/build.nix | 2 +- krebs/3modules/default.nix | 2 +- krebs/3modules/git.nix | 2 +- krebs/3modules/github-hosts-sync.nix | 3 +-- krebs/3modules/lass/default.nix | 2 +- krebs/3modules/makefu/default.nix | 2 +- krebs/3modules/tv/default.nix | 2 +- krebs/4lib/default.nix | 2 -- krebs/5pkgs/default.nix | 5 ++--- krebs/default.nix | 7 +------ 10 files changed, 10 insertions(+), 19 deletions(-) (limited to 'krebs') diff --git a/krebs/3modules/build.nix b/krebs/3modules/build.nix index 57495ea6..1205e192 100644 --- a/krebs/3modules/build.nix +++ b/krebs/3modules/build.nix @@ -1,6 +1,6 @@ { config, lib, ... }: -with import ../4lib { inherit lib; }; +with lib; let target = config.krebs.build // { user.name = "root"; }; diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index ff0cc834..e2aea705 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -1,6 +1,6 @@ { config, lib, ... }: -with import ../4lib { inherit lib; }; +with lib; let cfg = config.krebs; diff --git a/krebs/3modules/git.nix b/krebs/3modules/git.nix index 64b7820b..23412949 100644 --- a/krebs/3modules/git.nix +++ b/krebs/3modules/git.nix @@ -6,7 +6,7 @@ # TODO when authorized_keys changes, then restart ssh # (or kill already connected users somehow) -with import ../4lib { inherit lib; }; +with lib; let cfg = config.krebs.git; diff --git a/krebs/3modules/github-hosts-sync.nix b/krebs/3modules/github-hosts-sync.nix index 2a1df9e0..5503ee8d 100644 --- a/krebs/3modules/github-hosts-sync.nix +++ b/krebs/3modules/github-hosts-sync.nix @@ -1,7 +1,6 @@ { config, lib, pkgs, ... }: -with builtins; -with import ../4lib { inherit lib; }; +with lib; let cfg = config.krebs.github-hosts-sync; diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix index afedf95f..59052021 100644 --- a/krebs/3modules/lass/default.nix +++ b/krebs/3modules/lass/default.nix @@ -1,6 +1,6 @@ { lib, ... }: -with import ../../4lib { inherit lib; }; +with lib; { hosts = addNames { diff --git a/krebs/3modules/makefu/default.nix b/krebs/3modules/makefu/default.nix index 4628b2ac..9cf5c9ae 100644 --- a/krebs/3modules/makefu/default.nix +++ b/krebs/3modules/makefu/default.nix @@ -1,6 +1,6 @@ { lib, ... }: -with import ../../4lib { inherit lib; }; +with lib; { hosts = addNames { diff --git a/krebs/3modules/tv/default.nix b/krebs/3modules/tv/default.nix index 5d5fead8..5a1ff141 100644 --- a/krebs/3modules/tv/default.nix +++ b/krebs/3modules/tv/default.nix @@ -1,6 +1,6 @@ { lib, ... }: -with import ../../4lib { inherit lib; }; +with lib; { dns.providers = { diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix index 0a610131..396307c2 100644 --- a/krebs/4lib/default.nix +++ b/krebs/4lib/default.nix @@ -3,8 +3,6 @@ with builtins; with lib; -builtins // -lib // rec { eq = x: y: x == y; diff --git a/krebs/5pkgs/default.nix b/krebs/5pkgs/default.nix index 84fb8725..0ec4b3de 100644 --- a/krebs/5pkgs/default.nix +++ b/krebs/5pkgs/default.nix @@ -1,7 +1,6 @@ -{ pkgs, ... }: - -with import ../4lib { inherit (pkgs) lib; }; +{ lib, pkgs, ... }: +with lib; let subdirs = mapAttrs (_: flip pkgs.callPackage {}) (subdirsOf ./.); pkgs' = pkgs // subdirs; diff --git a/krebs/default.nix b/krebs/default.nix index de805a89..5518a449 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -1,6 +1,7 @@ { current-date , current-host-name , current-user-name +, lib , stockholm }: @@ -8,7 +9,6 @@ let out = { inherit deploy; inherit infest; inherit init; - inherit lib; inherit nixos-install; }; @@ -131,11 +131,6 @@ let out = { ''} ''; - lib = import ./4lib { lib = import ; } // rec { - stockholm-path = ../.; - nspath = ns: p: stockholm-path + "/${ns}/${p}"; - }; - doc = s: let b = "EOF${builtins.hashString "sha256" s}"; in '' -- cgit v1.2.3 From 309102967ebad616d3f6a0dec361d80a61092ec8 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 21 Oct 2015 01:32:44 +0200 Subject: l: add test systems --- krebs/3modules/lass/default.nix | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'krebs') diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix index 5c48d964..3f81acb9 100644 --- a/krebs/3modules/lass/default.nix +++ b/krebs/3modules/lass/default.nix @@ -2,7 +2,34 @@ with import ../../4lib { inherit lib; }; -{ +let + testHosts = lib.genAttrs [ + "test-arch" + "test-centos6" + "test-centos7" + ] (name: { + inherit name; + nets = { + retiolum = { + addrs4 = ["10.243.111.111"]; + addrs6 = ["42:0:0:0:0:0:0:7357"]; + aliases = [ + "test.retiolum" + ]; + tinc.pubkey = '' + -----BEGIN RSA PUBLIC KEY----- + MIIBCgKCAQEAy41YKF/wpHLnN370MSdnAo63QUW30aw+6O79cnaJyxoL6ZQkk4Nd + mrX2tBIfb2hhhgm4Jecy33WVymoEL7EiRZ6gshJaYwte51Jnrac6IFQyiRGMqHY5 + TG/6IzzTOkeQrT1fw3Yfh0NRfqLBZLr0nAFoqgzIVRxvy+QO1gCU2UDKkQ/y5df1 + K+YsMipxU08dsOkPkmLdC/+vDaZiEdYljIS3Omd+ED5JmLM3MSs/ZPQ8xjkjEAy8 + QqD9/67bDoeXyg1ZxED2n0+aRKtU/CK/66Li//yev6yv38OQSEM4t/V0dr9sjLcY + VIdkxKf96F9r3vcDf/9xw2HrqVoy+D5XYQIDAQAB + -----END RSA PUBLIC KEY----- + ''; + }; + }; + }); +in { hosts = addNames { echelon = { cores = 4; @@ -180,7 +207,7 @@ with import ../../4lib { inherit lib; }; }; }; - }; + } // testHosts; users = addNames { lass = { pubkey = readFile ../../Zpubkeys/lass.ssh.pub; -- cgit v1.2.3 From 3ce57c3de3f3dc95669d3a0564f6f7d0ff425321 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 21 Oct 2015 00:08:18 +0200 Subject: stockholm: provide krebs lib --- krebs/3modules/build.nix | 2 +- krebs/3modules/default.nix | 2 +- krebs/3modules/git.nix | 2 +- krebs/3modules/github-hosts-sync.nix | 3 +-- krebs/3modules/lass/default.nix | 2 +- krebs/3modules/makefu/default.nix | 2 +- krebs/3modules/tv/default.nix | 2 +- krebs/4lib/default.nix | 2 -- krebs/5pkgs/default.nix | 5 ++--- krebs/default.nix | 7 +------ 10 files changed, 10 insertions(+), 19 deletions(-) (limited to 'krebs') diff --git a/krebs/3modules/build.nix b/krebs/3modules/build.nix index 57495ea6..1205e192 100644 --- a/krebs/3modules/build.nix +++ b/krebs/3modules/build.nix @@ -1,6 +1,6 @@ { config, lib, ... }: -with import ../4lib { inherit lib; }; +with lib; let target = config.krebs.build // { user.name = "root"; }; diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index 756245c0..c695589c 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -1,6 +1,6 @@ { config, lib, ... }: -with import ../4lib { inherit lib; }; +with lib; let cfg = config.krebs; diff --git a/krebs/3modules/git.nix b/krebs/3modules/git.nix index 64b7820b..23412949 100644 --- a/krebs/3modules/git.nix +++ b/krebs/3modules/git.nix @@ -6,7 +6,7 @@ # TODO when authorized_keys changes, then restart ssh # (or kill already connected users somehow) -with import ../4lib { inherit lib; }; +with lib; let cfg = config.krebs.git; diff --git a/krebs/3modules/github-hosts-sync.nix b/krebs/3modules/github-hosts-sync.nix index 2a1df9e0..5503ee8d 100644 --- a/krebs/3modules/github-hosts-sync.nix +++ b/krebs/3modules/github-hosts-sync.nix @@ -1,7 +1,6 @@ { config, lib, pkgs, ... }: -with builtins; -with import ../4lib { inherit lib; }; +with lib; let cfg = config.krebs.github-hosts-sync; diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix index 3f81acb9..d86c0056 100644 --- a/krebs/3modules/lass/default.nix +++ b/krebs/3modules/lass/default.nix @@ -1,6 +1,6 @@ { lib, ... }: -with import ../../4lib { inherit lib; }; +with lib; let testHosts = lib.genAttrs [ diff --git a/krebs/3modules/makefu/default.nix b/krebs/3modules/makefu/default.nix index acc5d7dd..42764e48 100644 --- a/krebs/3modules/makefu/default.nix +++ b/krebs/3modules/makefu/default.nix @@ -1,6 +1,6 @@ { lib, ... }: -with import ../../4lib { inherit lib; }; +with lib; { hosts = addNames { diff --git a/krebs/3modules/tv/default.nix b/krebs/3modules/tv/default.nix index 5d5fead8..5a1ff141 100644 --- a/krebs/3modules/tv/default.nix +++ b/krebs/3modules/tv/default.nix @@ -1,6 +1,6 @@ { lib, ... }: -with import ../../4lib { inherit lib; }; +with lib; { dns.providers = { diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix index 0a610131..396307c2 100644 --- a/krebs/4lib/default.nix +++ b/krebs/4lib/default.nix @@ -3,8 +3,6 @@ with builtins; with lib; -builtins // -lib // rec { eq = x: y: x == y; diff --git a/krebs/5pkgs/default.nix b/krebs/5pkgs/default.nix index 84fb8725..0ec4b3de 100644 --- a/krebs/5pkgs/default.nix +++ b/krebs/5pkgs/default.nix @@ -1,7 +1,6 @@ -{ pkgs, ... }: - -with import ../4lib { inherit (pkgs) lib; }; +{ lib, pkgs, ... }: +with lib; let subdirs = mapAttrs (_: flip pkgs.callPackage {}) (subdirsOf ./.); pkgs' = pkgs // subdirs; diff --git a/krebs/default.nix b/krebs/default.nix index de805a89..5518a449 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -1,6 +1,7 @@ { current-date , current-host-name , current-user-name +, lib , stockholm }: @@ -8,7 +9,6 @@ let out = { inherit deploy; inherit infest; inherit init; - inherit lib; inherit nixos-install; }; @@ -131,11 +131,6 @@ let out = { ''} ''; - lib = import ./4lib { lib = import ; } // rec { - stockholm-path = ../.; - nspath = ns: p: stockholm-path + "/${ns}/${p}"; - }; - doc = s: let b = "EOF${builtins.hashString "sha256" s}"; in '' -- cgit v1.2.3 From 9c9a7d611ed9201e84ed49067027e85389313b7c Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 21 Oct 2015 02:21:56 +0200 Subject: krebs.nixos-install: bring back chroot wrapper Because we _do_ need it. :D --- krebs/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'krebs') diff --git a/krebs/default.nix b/krebs/default.nix index 5518a449..5f1cfb95 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -126,6 +126,16 @@ let out = { } > nixos-install chmod +x nixos-install + # Wrap inserted nix-install into chroot. + nix_env=$(cat_src | sed -n ' + s:.*\(/nix/store/[a-z0-9]*-nix-[0-9.]\+/bin/nix-env\).*:\1:p;T;q + ') + echo nix-env is $nix_env + sed -i ' + s:^NIX_PATH=:chroot $mountPoint /usr/bin/env &: + s:^nix-env:'"$nix_env"': + ' nixos-install + unset SSL_CERT_FILE ./nixos-install ''} -- cgit v1.2.3 From 48abef60c172bdd5d15e574138824a89b23fa86d Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 21 Oct 2015 12:45:50 +0200 Subject: krebs.nixos-install: discover coreutils in /mnt --- krebs/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'krebs') diff --git a/krebs/default.nix b/krebs/default.nix index 5f1cfb95..24d9e843 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -130,9 +130,12 @@ let out = { nix_env=$(cat_src | sed -n ' s:.*\(/nix/store/[a-z0-9]*-nix-[0-9.]\+/bin/nix-env\).*:\1:p;T;q ') + coreutils=$(find /mnt/nix/store \ + -mindepth 1 -maxdepth 1 -type d -name '*-coreutils-*' \ + | head -n 1 | sed s:^/mnt::) echo nix-env is $nix_env sed -i ' - s:^NIX_PATH=:chroot $mountPoint /usr/bin/env &: + s:^NIX_PATH=:chroot $mountPoint '"$coreutils"'/bin/env &: s:^nix-env:'"$nix_env"': ' nixos-install -- cgit v1.2.3 From df04a82426ad36726da7becae5ec4b6c33d8d14b Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 21 Oct 2015 13:13:49 +0200 Subject: krebs.nixos-infest: set SSL_CERT_FILE properly --- krebs/default.nix | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'krebs') diff --git a/krebs/default.nix b/krebs/default.nix index 24d9e843..0b055cd2 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -130,16 +130,24 @@ let out = { nix_env=$(cat_src | sed -n ' s:.*\(/nix/store/[a-z0-9]*-nix-[0-9.]\+/bin/nix-env\).*:\1:p;T;q ') - coreutils=$(find /mnt/nix/store \ - -mindepth 1 -maxdepth 1 -type d -name '*-coreutils-*' \ - | head -n 1 | sed s:^/mnt::) - echo nix-env is $nix_env + echo "nix-env is $nix_env" >&2 + getchrootpath() {( + name=$1 + path=$(find /mnt/nix/store \ + -mindepth 1 -maxdepth 1 -type d -name '*-'"$name"'-*' \ + | head -n 1 | sed s:^/mnt::) + echo "$name is $path" >&2 + echo "$path" + )} + cacert=$(getchrootpath cacert) + coreutils=$(getchrootpath coreutils) + env="$coreutils/bin/env \ + SSL_CERT_FILE=$cacert/etc/ssl/certs/ca-bundle.crt" sed -i ' - s:^NIX_PATH=:chroot $mountPoint '"$coreutils"'/bin/env &: + s:^NIX_PATH=:chroot $mountPoint '"$env"' &: s:^nix-env:'"$nix_env"': ' nixos-install - unset SSL_CERT_FILE ./nixos-install ''} ''; -- cgit v1.2.3 From 0863983b7d7568266ed078dbce7ff96e08f2f082 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 21 Oct 2015 13:16:04 +0200 Subject: wu: add alias cgit.wu.retiolum --- krebs/3modules/tv/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'krebs') diff --git a/krebs/3modules/tv/default.nix b/krebs/3modules/tv/default.nix index 5a1ff141..f3dcd18b 100644 --- a/krebs/3modules/tv/default.nix +++ b/krebs/3modules/tv/default.nix @@ -231,6 +231,7 @@ with lib; addrs6 = ["42:0:0:0:0:0:0:1337"]; aliases = [ "wu.retiolum" + "cgit.wu.retiolum" ]; tinc.pubkey = '' -----BEGIN RSA PUBLIC KEY----- -- cgit v1.2.3 From b55f07e57af69f918182405d473d22981c515b86 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 21 Oct 2015 13:48:53 +0200 Subject: mkdir: 104.233.84.215 -> 104.167.114.142 --- krebs/3modules/tv/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'krebs') diff --git a/krebs/3modules/tv/default.nix b/krebs/3modules/tv/default.nix index f3dcd18b..4c295dff 100644 --- a/krebs/3modules/tv/default.nix +++ b/krebs/3modules/tv/default.nix @@ -65,7 +65,7 @@ with lib; dc = "tv"; #dc = "cac"; nets = rec { internet = { - addrs4 = ["104.233.84.215"]; + addrs4 = ["104.167.114.142"]; aliases = [ "mkdir.internet" ]; -- cgit v1.2.3 From 14f08e2a1c6e8065c0fef15539df030eb2054ac1 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 21 Oct 2015 13:51:10 +0200 Subject: k 3 l: add cores to testsystems --- krebs/3modules/lass/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'krebs') diff --git a/krebs/3modules/lass/default.nix b/krebs/3modules/lass/default.nix index d86c0056..498282b0 100644 --- a/krebs/3modules/lass/default.nix +++ b/krebs/3modules/lass/default.nix @@ -9,6 +9,7 @@ let "test-centos7" ] (name: { inherit name; + cores = 1; nets = { retiolum = { addrs4 = ["10.243.111.111"]; -- cgit v1.2.3 From fc64fd18cb8677f08d038a086de879fd69f89b8c Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 22 Oct 2015 00:20:16 +0200 Subject: krebs.*: make StrictHostKeyChecking configurable --- krebs/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'krebs') diff --git a/krebs/default.nix b/krebs/default.nix index 0b055cd2..08de7229 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -3,6 +3,7 @@ , current-user-name , lib , stockholm +, StrictHostKeyChecking ? "yes" }: let out = { @@ -260,7 +261,10 @@ let out = { in out; rootssh = target: script: - "ssh root@${target} -T ${doc '' + let + flags = "-o StrictHostKeyChecking=${StrictHostKeyChecking}"; + in + "ssh ${flags} root@${target} -T ${doc '' set -efu ${script} ''}"; -- cgit v1.2.3 From 4b8ffc1bfd494de1fafde2527a337ad5eb31a27c Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 22 Oct 2015 00:23:02 +0200 Subject: krebs.nixos-install: fail if pkg cannot be found Collaterally, search in /nix instead of /mnt/nix --- krebs/default.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'krebs') diff --git a/krebs/default.nix b/krebs/default.nix index 08de7229..40d245f9 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -132,16 +132,20 @@ let out = { s:.*\(/nix/store/[a-z0-9]*-nix-[0-9.]\+/bin/nix-env\).*:\1:p;T;q ') echo "nix-env is $nix_env" >&2 - getchrootpath() {( + findpkg() {( name=$1 - path=$(find /mnt/nix/store \ + path=$(find /nix/store \ -mindepth 1 -maxdepth 1 -type d -name '*-'"$name"'-*' \ | head -n 1 | sed s:^/mnt::) - echo "$name is $path" >&2 - echo "$path" + if echo "$path" | grep .; then + echo "$name is $path" >&2 + else + echo "Error: package not found: $name" >&2 + exit 1 + fi )} - cacert=$(getchrootpath cacert) - coreutils=$(getchrootpath coreutils) + cacert=$(findpkg cacert) + coreutils=$(findpkg coreutils) env="$coreutils/bin/env \ SSL_CERT_FILE=$cacert/etc/ssl/certs/ca-bundle.crt" sed -i ' -- cgit v1.2.3 From df6f0392cbdf7923537eb5d328bd345cde11eb53 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 22 Oct 2015 00:49:51 +0200 Subject: krebs.nixos-install: cacert -> /root/SSL_CERT_FILE --- krebs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'krebs') diff --git a/krebs/default.nix b/krebs/default.nix index 40d245f9..31a7f7d0 100644 --- a/krebs/default.nix +++ b/krebs/default.nix @@ -146,8 +146,8 @@ let out = { )} cacert=$(findpkg cacert) coreutils=$(findpkg coreutils) - env="$coreutils/bin/env \ - SSL_CERT_FILE=$cacert/etc/ssl/certs/ca-bundle.crt" + cp "$cacert"/etc/ssl/certs/ca-bundle.crt /mnt/root/SSL_CERT_FILE + env="$coreutils/bin/env SSL_CERT_FILE=/root/SSL_CERT_FILE" sed -i ' s:^NIX_PATH=:chroot $mountPoint '"$env"' &: s:^nix-env:'"$nix_env"': -- cgit v1.2.3 From 709ebf6bbcc2e0d4644ed35cd42db47c4f2e78c5 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 23 Oct 2015 15:31:31 +0200 Subject: krebs 3 zone-generation: for consistency, add newline at the end --- krebs/3modules/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'krebs') diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index 075db182..bc858f66 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -105,8 +105,8 @@ let # Implements environment.etc."zones/" environment.etc = let - stripEmptyLines = s: concatStringsSep "\n" - (remove "\n" (remove "" (splitString "\n" s))); + stripEmptyLines = s: (concatStringsSep "\n" + (remove "\n" (remove "" (splitString "\n" s)))) + "\n"; all-zones = foldAttrs (sum: current: sum + "\n" +current ) "" ([cfg.zone-head-config] ++ combined-hosts); combined-hosts = (mapAttrsToList (name: value: value.extraZones) cfg.hosts ); -- cgit v1.2.3 From e281271239289a266777d0b429e604ec9aeaed41 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 25 Oct 2015 02:32:19 +0100 Subject: {tv cfgs => krebs pkgs} writeNixFromCabal --- krebs/5pkgs/default.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'krebs') diff --git a/krebs/5pkgs/default.nix b/krebs/5pkgs/default.nix index 0ec4b3de..7df7b7d3 100644 --- a/krebs/5pkgs/default.nix +++ b/krebs/5pkgs/default.nix @@ -54,4 +54,8 @@ subdirs // rec { gcc -O -Wall -o "$exe" $src strip --strip-unneeded "$exe" ''; + + writeNixFromCabal = name: path: pkgs.runCommand name {} '' + ${pkgs.cabal2nix}/bin/cabal2nix ${path} > $out + ''; } -- cgit v1.2.3 From daa8fe2aa83451e7d4fc120f7fd417409ac2666c Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 25 Oct 2015 14:07:51 +0100 Subject: init users.shared.wolf --- krebs/3modules/default.nix | 1 + krebs/3modules/shared/default.nix | 42 +++++++++++++++++++++++++++++++++++++++ krebs/Zhosts/wolf | 10 ++++++++++ 3 files changed, 53 insertions(+) create mode 100644 krebs/3modules/shared/default.nix create mode 100644 krebs/Zhosts/wolf (limited to 'krebs') diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index e244ef7b..dd2f9e76 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -76,6 +76,7 @@ let imp = mkMerge [ { krebs = import ./lass { inherit lib; }; } { krebs = import ./makefu { inherit lib; }; } + { krebs = import ./shared { inherit lib; }; } { krebs = import ./tv { inherit lib; }; } { krebs.dns.providers = { diff --git a/krebs/3modules/shared/default.nix b/krebs/3modules/shared/default.nix new file mode 100644 index 00000000..24dd7b78 --- /dev/null +++ b/krebs/3modules/shared/default.nix @@ -0,0 +1,42 @@ +{ lib, ... }: + +with lib; + +{ + hosts = addNames { + wolf = { + #dc = "shack"; + nets = { + #shack = { + # addrs4 = [ TODO ]; + # aliases = ["wolf.shack"]; + #}; + retiolum = { + addrs4 = ["10.243.77.1"]; + addrs6 = ["42:0:0:0:0:0:77:1"]; + aliases = [ + "wolf.retiolum" + ]; + tinc.pubkey = '' + -----BEGIN RSA PUBLIC KEY----- + MIIBCgKCAQEAzpXyEATt8+ElxPq650/fkboEC9RvTWqN6UIAl/R4Zu+uDhAZ2ekb + HBjoSbRxu/0w2I37nwWUhEOemxGm4PXCgWrtO0jeRF4nVNYu3ZBppA3vuVALUWq7 + apxRUEL9FdsWQlXGo4PVd20dGaDTi8M/Ggo755MStVTY0rRLluxyPq6VAa015sNg + 4NOFuWm0NDn4e+qrahTCTiSjbCU8rWixm0GktV40kdg0QAiFbEcRhuXF1s9/yojk + 7JT/nFg6LELjWUSSNZnioj5oSfVbThDRelIld9VaAKBAZZ5/zy6T2XSeDfoepytH + 8aw6itEuTCy1M1DTiTG+12SPPw+ubG+NqQIDAQAB + -----END RSA PUBLIC KEY----- + ''; + }; + }; + ssh.privkey.path = ; + ssh.pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKYMXMWZIK0jjnZDM9INiYAKcwjXs2241vew54K8veCR"; + }; + }; + users = addNames { + shared = { + mail = "spam@krebsco.de"; + pubkey = "lol"; # TODO krebs.users.shared.pubkey should be unnecessary + }; + }; +} diff --git a/krebs/Zhosts/wolf b/krebs/Zhosts/wolf new file mode 100644 index 00000000..ded8275b --- /dev/null +++ b/krebs/Zhosts/wolf @@ -0,0 +1,10 @@ +Subnet = 10.243.77.1/32 +Subnet = 42:0:0:0:0:0:77:1/128 +-----BEGIN RSA PUBLIC KEY----- +MIIBCgKCAQEAzpXyEATt8+ElxPq650/fkboEC9RvTWqN6UIAl/R4Zu+uDhAZ2ekb +HBjoSbRxu/0w2I37nwWUhEOemxGm4PXCgWrtO0jeRF4nVNYu3ZBppA3vuVALUWq7 +apxRUEL9FdsWQlXGo4PVd20dGaDTi8M/Ggo755MStVTY0rRLluxyPq6VAa015sNg +4NOFuWm0NDn4e+qrahTCTiSjbCU8rWixm0GktV40kdg0QAiFbEcRhuXF1s9/yojk +7JT/nFg6LELjWUSSNZnioj5oSfVbThDRelIld9VaAKBAZZ5/zy6T2XSeDfoepytH +8aw6itEuTCy1M1DTiTG+12SPPw+ubG+NqQIDAQAB +-----END RSA PUBLIC KEY----- -- cgit v1.2.3 From 8f15daf2ea25304e9cbc8d449fb92078b2fb6f03 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 25 Oct 2015 14:15:21 +0100 Subject: init krebs.current --- krebs/3modules/current.nix | 26 ++++++++++++++++++++++++++ krebs/3modules/default.nix | 1 + 2 files changed, 27 insertions(+) create mode 100644 krebs/3modules/current.nix (limited to 'krebs') diff --git a/krebs/3modules/current.nix b/krebs/3modules/current.nix new file mode 100644 index 00000000..41941e28 --- /dev/null +++ b/krebs/3modules/current.nix @@ -0,0 +1,26 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + cfg = config.krebs.current; + + out = { + options.krebs.current = api; + config = mkIf cfg.enable imp; + }; + + api = { + enable = mkEnableOption "krebs.current"; + host = mkOption { + type = types.host; + }; + user = mkOption { + type = types.user; + }; + }; + + imp = { + }; + +in out diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index dd2f9e76..2b5fc478 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -8,6 +8,7 @@ let imports = [ ./bepasty-server.nix ./build.nix + ./current.nix ./exim-retiolum.nix ./exim-smarthost.nix ./github-hosts-sync.nix -- cgit v1.2.3 From cca25c7b66c44e0ec826d466bd48f2463df03fe9 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 25 Oct 2015 18:06:46 +0100 Subject: wry: listen for graphs.retiolum --- krebs/3modules/makefu/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'krebs') diff --git a/krebs/3modules/makefu/default.nix b/krebs/3modules/makefu/default.nix index d328033c..e36a083f 100644 --- a/krebs/3modules/makefu/default.nix +++ b/krebs/3modules/makefu/default.nix @@ -185,6 +185,7 @@ with lib; addrs6 = ["42:6e1e:cc8a:7cef:827:f938:8c64:baad"]; aliases = [ "graphs.wry.retiolum" + "graphs.retiolum" "paste.wry.retiolum" "paste.retiolum" "wry.retiolum" -- cgit v1.2.3 From 642583145200f5a2cb8be1b38707e2b2ea3dc3e5 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 25 Oct 2015 21:54:59 +0100 Subject: k 3 tinc_graphs: is now completely self-contained --- krebs/3modules/tinc_graphs.nix | 7 +++++-- krebs/5pkgs/tinc_graphs/default.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 krebs/5pkgs/tinc_graphs/default.nix (limited to 'krebs') diff --git a/krebs/3modules/tinc_graphs.nix b/krebs/3modules/tinc_graphs.nix index a6c62835..e415d20a 100644 --- a/krebs/3modules/tinc_graphs.nix +++ b/krebs/3modules/tinc_graphs.nix @@ -95,8 +95,12 @@ let ExecStartPre = pkgs.writeScript "tinc_graphs-init" '' #!/bin/sh + mkdir -p "${internal_dir}" "${external_dir}" if ! test -e "${cfg.workingDir}/internal/index.html"; then - cp -fr "$(${pkgs.tinc_graphs}/bin/tincstats-static-dir)/internal/" "${internal_dir}" + cp -fr "$(${pkgs.tinc_graphs}/bin/tincstats-static-dir)/internal/." "${internal_dir}" + fi + if ! test -e "${cfg.workingDir}/external/index.html"; then + cp -fr "$(${pkgs.tinc_graphs}/bin/tincstats-static-dir)/external/." "${external_dir}" fi ''; @@ -118,7 +122,6 @@ let users.extraUsers.tinc_graphs = { uid = 3925439960; #genid tinc_graphs home = "/var/spool/tinc_graphs"; - createHome = true; }; krebs.nginx.servers = mkIf cfg.nginx.enable { diff --git a/krebs/5pkgs/tinc_graphs/default.nix b/krebs/5pkgs/tinc_graphs/default.nix new file mode 100644 index 00000000..3040cabe --- /dev/null +++ b/krebs/5pkgs/tinc_graphs/default.nix @@ -0,0 +1,26 @@ +{stdenv,fetchurl,pkgs,python3Packages, ... }: + +python3Packages.buildPythonPackage rec { + name = "tinc_graphs-${version}"; + version = "0.3.8"; + propagatedBuildInputs = with pkgs;[ + python3Packages.pygeoip + ## ${geolite-legacy}/share/GeoIP/GeoIPCity.dat + ]; + src = fetchurl { + url = "https://pypi.python.org/packages/source/t/tinc_graphs/tinc_graphs-${version}.tar.gz"; + sha256 = "0jc014ipx9pbx5dwi9s5n921c2c26m5vvzrvpjmca550gpdqd5f4"; + }; + preFixup = with pkgs;'' + wrapProgram $out/bin/build-graphs --prefix PATH : "$out/bin" + wrapProgram $out/bin/all-the-graphs --prefix PATH : "${imagemagick}/bin:${graphviz}/bin:$out/bin" + wrapProgram $out/bin/tinc-stats2json --prefix PATH : "${tinc}/bin" + ''; + + meta = { + homepage = http://krebsco.de/; + description = "Create Graphs from Tinc Stats"; + license = stdenv.lib.licenses.wtfpl; + }; +} + -- cgit v1.2.3 From cb1b101dfa2c8e0aa9a3ef0c64788912e0148085 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 26 Oct 2015 00:02:51 +0100 Subject: tinc_graphs: clean up mv {makefu,krebs} --- krebs/5pkgs/tinc_graphs/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'krebs') diff --git a/krebs/5pkgs/tinc_graphs/default.nix b/krebs/5pkgs/tinc_graphs/default.nix index 3040cabe..e5f1e40e 100644 --- a/krebs/5pkgs/tinc_graphs/default.nix +++ b/krebs/5pkgs/tinc_graphs/default.nix @@ -2,14 +2,14 @@ python3Packages.buildPythonPackage rec { name = "tinc_graphs-${version}"; - version = "0.3.8"; + version = "0.3.9"; propagatedBuildInputs = with pkgs;[ python3Packages.pygeoip ## ${geolite-legacy}/share/GeoIP/GeoIPCity.dat ]; src = fetchurl { url = "https://pypi.python.org/packages/source/t/tinc_graphs/tinc_graphs-${version}.tar.gz"; - sha256 = "0jc014ipx9pbx5dwi9s5n921c2c26m5vvzrvpjmca550gpdqd5f4"; + sha256 = "0hjmkiclvyjb3707285x4b8mk5aqjcvh383hvkad1h7p1n61qrfx"; }; preFixup = with pkgs;'' wrapProgram $out/bin/build-graphs --prefix PATH : "$out/bin" -- cgit v1.2.3 From 526adba3c81d267266946e7fc96a4a3b51cab366 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 26 Oct 2015 00:04:15 +0100 Subject: k 3 urlwatch: add verbose flag --- krebs/3modules/urlwatch.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'krebs') diff --git a/krebs/3modules/urlwatch.nix b/krebs/3modules/urlwatch.nix index 80d9f5e9..206bc569 100644 --- a/krebs/3modules/urlwatch.nix +++ b/krebs/3modules/urlwatch.nix @@ -56,6 +56,13 @@ let https://nixos.org/channels/nixos-unstable/git-revision ]; }; + verbose = mkOption { + type = types.bool; + default = false; + description = '' + verbose output of urlwatch + ''; + }; }; urlsFile = toFile "urls" (concatStringsSep "\n" cfg.urls); @@ -106,7 +113,7 @@ let cd /tmp - urlwatch -e --urls="$urlsFile" > changes 2>&1 || : + urlwatch -e ${optionalString cfg.verbose "-v"} --urls="$urlsFile" > changes || : if test -s changes; then date=$(date -R) -- cgit v1.2.3