From c1aaaca7f7febe0c587342ae74e7045bb9a67c5a Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 28 Aug 2015 21:31:59 +0200 Subject: krebs += pkgs.writeC lib.toC --- tv/2configs/mail-client.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tv/2configs') diff --git a/tv/2configs/mail-client.nix b/tv/2configs/mail-client.nix index a632cf7c4..1daacdb4c 100644 --- a/tv/2configs/mail-client.nix +++ b/tv/2configs/mail-client.nix @@ -1,6 +1,6 @@ -{ pkgs, ... }: +{ lib, pkgs, ... }: -with import ../5pkgs { inherit pkgs; }; +with import ../5pkgs { inherit lib pkgs; }; { environment.systemPackages = [ -- cgit v1.2.3 From 62865ae6ae46e006cea7ee80b931fc5be27d3449 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 28 Aug 2015 21:48:29 +0200 Subject: tv configs test: init --- tv/2configs/test.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tv/2configs/test.nix (limited to 'tv/2configs') diff --git a/tv/2configs/test.nix b/tv/2configs/test.nix new file mode 100644 index 000000000..f96b9e98e --- /dev/null +++ b/tv/2configs/test.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +with import ../4lib { inherit lib pkgs; }; + +let + tvpkgs = import ../5pkgs { inherit lib pkgs; }; + + out = { + security.sudo.extraConfig = '' + tv ALL=(test) NOPASSWD: ALL + ''; + users.extraUsers.test = { + shell = "${test-shell}"; + }; + }; + + test-shell = tvpkgs.execve "test-shell" rec { + filename = "${pkgs.bash}/bin/bash"; + argv = ["sh" "--noprofile" "-l"]; + envp.ENV = pkgs.writeText "test-env" '' + ${shell.cat "Hello, `$(j0w\nd0g!)`!\\o/\n"} >&2 + ''; + }; + +in out -- cgit v1.2.3 From 8e5137481852df6fb5488296a7081b5180e6954f Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 28 Aug 2015 22:14:34 +0200 Subject: tv configs test: systemPackages += su-test --- tv/2configs/test.nix | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tv/2configs') diff --git a/tv/2configs/test.nix b/tv/2configs/test.nix index f96b9e98e..fa556ec78 100644 --- a/tv/2configs/test.nix +++ b/tv/2configs/test.nix @@ -6,6 +6,9 @@ let tvpkgs = import ../5pkgs { inherit lib pkgs; }; out = { + environment.systemPackages = [ + su-test + ]; security.sudo.extraConfig = '' tv ALL=(test) NOPASSWD: ALL ''; @@ -14,6 +17,11 @@ let }; }; + su-test = tvpkgs.execveBin "su-test" rec { + filename = "/var/setuid-wrappers/sudo"; + argv = ["sudo" "-u" "test" "-i"]; + }; + test-shell = tvpkgs.execve "test-shell" rec { filename = "${pkgs.bash}/bin/bash"; argv = ["sh" "--noprofile" "-l"]; -- cgit v1.2.3 From 144fcda288eb050153620c386511c7722e031029 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 28 Aug 2015 22:27:23 +0200 Subject: {tv,krebs}: import krebs pkgs with lib --- tv/2configs/charybdis.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tv/2configs') diff --git a/tv/2configs/charybdis.nix b/tv/2configs/charybdis.nix index a2952219d..6be6c02c6 100644 --- a/tv/2configs/charybdis.nix +++ b/tv/2configs/charybdis.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ... }: let - tvpkgs = import ../5pkgs { inherit pkgs; }; + tvpkgs = import ../5pkgs { inherit lib pkgs; }; in with builtins; -- cgit v1.2.3 From 09257f97823e9a57cda749c2d5a69b18ef484cec Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 29 Aug 2015 00:19:52 +0200 Subject: tv: use only pkgs --- tv/2configs/charybdis.nix | 6 +----- tv/2configs/mail-client.nix | 5 ++--- tv/2configs/test.nix | 6 ++---- 3 files changed, 5 insertions(+), 12 deletions(-) (limited to 'tv/2configs') diff --git a/tv/2configs/charybdis.nix b/tv/2configs/charybdis.nix index 6be6c02c6..a949026de 100644 --- a/tv/2configs/charybdis.nix +++ b/tv/2configs/charybdis.nix @@ -1,9 +1,5 @@ { config, lib, pkgs, ... }: -let - tvpkgs = import ../5pkgs { inherit lib pkgs; }; -in - with builtins; with lib; let @@ -63,7 +59,7 @@ let ExecStart = pkgs.writeScript "charybdis-service" '' #! /bin/sh set -euf - exec ${tvpkgs.charybdis}/bin/charybdis-ircd \ + exec ${pkgs.charybdis}/bin/charybdis-ircd \ -foreground \ -logfile /dev/stderr \ -configfile ${configFile} diff --git a/tv/2configs/mail-client.nix b/tv/2configs/mail-client.nix index 1daacdb4c..8b6f8bbcd 100644 --- a/tv/2configs/mail-client.nix +++ b/tv/2configs/mail-client.nix @@ -1,7 +1,6 @@ -{ lib, pkgs, ... }: - -with import ../5pkgs { inherit lib pkgs; }; +{ pkgs, ... }: +with pkgs; { environment.systemPackages = [ much diff --git a/tv/2configs/test.nix b/tv/2configs/test.nix index fa556ec78..409b4e9b4 100644 --- a/tv/2configs/test.nix +++ b/tv/2configs/test.nix @@ -3,8 +3,6 @@ with import ../4lib { inherit lib pkgs; }; let - tvpkgs = import ../5pkgs { inherit lib pkgs; }; - out = { environment.systemPackages = [ su-test @@ -17,12 +15,12 @@ let }; }; - su-test = tvpkgs.execveBin "su-test" rec { + su-test = pkgs.execveBin "su-test" rec { filename = "/var/setuid-wrappers/sudo"; argv = ["sudo" "-u" "test" "-i"]; }; - test-shell = tvpkgs.execve "test-shell" rec { + test-shell = pkgs.execve "test-shell" rec { filename = "${pkgs.bash}/bin/bash"; argv = ["sh" "--noprofile" "-l"]; envp.ENV = pkgs.writeText "test-env" '' -- cgit v1.2.3