From 28d623cf98b5d5b0f23b1b7761c884b8631b8f78 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 20 May 2016 02:52:23 +0200 Subject: Makefile: disable default goal --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 7252ca70e..58a46c643 100644 --- a/Makefile +++ b/Makefile @@ -63,6 +63,10 @@ execute = \ script=$$(echo "$$result" | jq -r .) && \ echo "$$script" | PS5=% sh +ifeq ($(MAKECMDGOALS),) +$(error No goals specified) +endif + # usage: make deploy system=foo [target_host=bar] deploy: ssh ?= ssh deploy: -- cgit v1.2.3 From 47a9308fc9eb41f7fe1f5d160a45e6a23e9f12d1 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 20 May 2016 03:02:35 +0200 Subject: Makefile evaluate: provide access to all of stockholm --- Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 58a46c643..d3823077e 100644 --- a/Makefile +++ b/Makefile @@ -54,9 +54,7 @@ evaluate = \ --show-trace \ -I nixos-config=$(nixos-config) \ -I stockholm=$(stockholm) \ - -E '{ eval, f }: f eval' \ - --arg eval 'import ./.' \ - --arg f "eval@{ config, ... }: $(1)" + -E "let eval = import ; in with eval; $(1)" execute = \ result=$$($(call evaluate,config.krebs.build.$(1))) && \ @@ -77,7 +75,7 @@ deploy: # usage: make LOGNAME=shared system=wolf eval.config.krebs.build.host.name eval eval.:;@$(call evaluate,$${expr-eval}) -eval.%:;@$(call evaluate,$*) +eval.%:;@$(call evaluate,$@) # usage: make install system=foo [target_host=bar] install: ssh ?= ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -- cgit v1.2.3 From 8014be4f2e0a5d9091150d2e4944706c31e4a62d Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 20 May 2016 03:21:56 +0200 Subject: Makefile system: add default value --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index d3823077e..a74e3a877 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ export STOCKHOLM_VERSION ?= $(shell \ printf '%s' "$$date.$$version"; \ ) +system ?= $(HOSTNAME) $(if $(system),,$(error unbound variable: system)) nixos-config ?= $(stockholm)/$(LOGNAME)/1systems/$(system).nix -- cgit v1.2.3 From ca48a77050933cab8114d9047e2e9c72a5496f0b Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 21 May 2016 09:27:55 +0200 Subject: exim-smarthost: allow per-domain defaults in internet-aliases --- krebs/3modules/exim-smarthost.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/3modules/exim-smarthost.nix b/krebs/3modules/exim-smarthost.nix index 8d9227039..aba6ee0b5 100644 --- a/krebs/3modules/exim-smarthost.nix +++ b/krebs/3modules/exim-smarthost.nix @@ -164,7 +164,7 @@ let control = dkim_disable_verify accept message = relay not permitted 2 - recipients = lsearch;${lsearch.internet-aliases} + recipients = lsearch*@;${lsearch.internet-aliases} require message = relay not permitted domains = +local_domains : +relay_to_domains @@ -198,7 +198,7 @@ let internet_aliases: debug_print = "R: internet_aliases for $local_part@$domain" driver = redirect - data = ''${lookup{$local_part@$domain}lsearch{${lsearch.internet-aliases}}} + data = ''${lookup{$local_part@$domain}lsearch*@{${lsearch.internet-aliases}}} dnslookup: debug_print = "R: dnslookup for $local_part@$domain" -- cgit v1.2.3 From 1e9199f93920d794789c8585b7cb196372f4864e Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 21 May 2016 09:28:50 +0200 Subject: krebs internet-aliases: *@eloop.org -> eloop2016@krebsco.de --- krebs/3modules/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix index 2f3c20906..c114b74df 100644 --- a/krebs/3modules/default.nix +++ b/krebs/3modules/default.nix @@ -161,7 +161,7 @@ let ciko.mail = "wieczorek.stefan@gmail.com"; Mic92.mail = "joerg@higgsboson.tk"; in { - "cfp@eloop.org" = [{ mail = "eloop2016@krebsco.de"; }]; + "*@eloop.org" = [{ mail = "eloop2016@krebsco.de"; }]; "eloop2016@krebsco.de" = spam-ml ++ [ ciko Mic92 ]; "postmaster@krebsco.de" = spam-ml; # RFC 822 "lass@krebsco.de" = lass; -- cgit v1.2.3 From ace70674aa9fc4580816225223934b6d7edd9204 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 21 May 2016 09:52:25 +0200 Subject: {mv,tv}.mail: retiolum -> r --- krebs/3modules/tv/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/3modules/tv/default.nix b/krebs/3modules/tv/default.nix index 711121a40..12aa91ba8 100644 --- a/krebs/3modules/tv/default.nix +++ b/krebs/3modules/tv/default.nix @@ -355,11 +355,11 @@ with config.krebs.lib; }; users = rec { mv = { - mail = "mv@cd.retiolum"; + mail = "mv@cd.r"; pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGer9e2+Lew7vnisgBbsFNECEIkpNJgEaqQqgb9inWkQ mv@vod"; }; tv = { - mail = "tv@nomic.retiolum"; + mail = "tv@nomic.r"; pgp.pubkeys.default = '' -----BEGIN PGP PUBLIC KEY BLOCK----- -- cgit v1.2.3 From 97c2e4bbd99f6034d550a83804e508c278045b67 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 21 May 2016 11:18:24 +0200 Subject: krebs.exim: validate config file syntax --- krebs/3modules/exim.nix | 2 +- krebs/5pkgs/builders.nix | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/krebs/3modules/exim.nix b/krebs/3modules/exim.nix index 16a2a37b6..7b18c72c1 100644 --- a/krebs/3modules/exim.nix +++ b/krebs/3modules/exim.nix @@ -37,7 +37,7 @@ in { }; config = lib.mkIf cfg.enable { environment = { - etc."exim.conf".text = '' + etc."exim.conf".source = pkgs.writeEximConfig "exim.conf" '' exim_user = ${cfg.user.name} exim_group = ${cfg.group.name} exim_path = /var/setuid-wrappers/exim diff --git a/krebs/5pkgs/builders.nix b/krebs/5pkgs/builders.nix index 146e6f9e1..70d65cfc3 100644 --- a/krebs/5pkgs/builders.nix +++ b/krebs/5pkgs/builders.nix @@ -56,6 +56,14 @@ rec { ''; }; + writeEximConfig = name: text: pkgs.runCommand name { + inherit text; + passAsFile = [ "text" ]; + } '' + ${pkgs.exim}/bin/exim -C "$textPath" -bV >/dev/null + mv "$textPath" $out + ''; + writeNixFromCabal = name: path: pkgs.runCommand name {} '' ${pkgs.cabal2nix}/bin/cabal2nix ${path} > $out ''; -- cgit v1.2.3