From 60cc5637365af3fcfb4fdb0eed36d26beea7a697 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 a632cf7..1daacdb 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.3.1 From 41ab71cb129c170608778d8acd3de1478d252800 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 28 Aug 2015 21:48:29 +0200 Subject: tv configs test: init --- tv/1systems/wu.nix | 1 + tv/2configs/test.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tv/2configs/test.nix (limited to 'tv/2configs') diff --git a/tv/1systems/wu.nix b/tv/1systems/wu.nix index 6131897..34ba565 100644 --- a/tv/1systems/wu.nix +++ b/tv/1systems/wu.nix @@ -33,6 +33,7 @@ in ../2configs/mail-client.nix ../2configs/xserver.nix ../2configs/synaptics.nix # TODO w110er if xserver is enabled + ../2configs/test.nix ../2configs/urlwatch.nix { environment.systemPackages = with pkgs; [ diff --git a/tv/2configs/test.nix b/tv/2configs/test.nix new file mode 100644 index 0000000..f96b9e9 --- /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.3.1 From aeb406859e507e4e7872d0689bfab9940366a8d6 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 f96b9e9..fa556ec 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.3.1 From b9ba0d66d1b34831eba134bc27f13099fd184795 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/1systems/cd.nix | 2 +- tv/2configs/charybdis.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tv/2configs') diff --git a/tv/1systems/cd.nix b/tv/1systems/cd.nix index 9f412d9..8d6ac95 100644 --- a/tv/1systems/cd.nix +++ b/tv/1systems/cd.nix @@ -3,7 +3,7 @@ with lib; let - tvpkgs = import ../5pkgs { inherit pkgs; }; + tvpkgs = import ../5pkgs { inherit lib pkgs; }; in { diff --git a/tv/2configs/charybdis.nix b/tv/2configs/charybdis.nix index a295221..6be6c02 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.3.1 From ff4283704f16b2f708ab9a0063063149379e0f5e Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 29 Aug 2015 00:19:52 +0200 Subject: tv: use only pkgs --- tv/1systems/cd.nix | 6 +----- tv/1systems/wu.nix | 16 ++++++---------- tv/2configs/charybdis.nix | 6 +----- tv/2configs/mail-client.nix | 5 ++--- tv/2configs/test.nix | 6 ++---- tv/5pkgs/default.nix | 5 ++--- 6 files changed, 14 insertions(+), 30 deletions(-) (limited to 'tv/2configs') diff --git a/tv/1systems/cd.nix b/tv/1systems/cd.nix index 8d6ac95..0049387 100644 --- a/tv/1systems/cd.nix +++ b/tv/1systems/cd.nix @@ -2,10 +2,6 @@ with lib; -let - tvpkgs = import ../5pkgs { inherit lib pkgs; }; -in - { krebs.build.host = config.krebs.hosts.cd; krebs.build.user = config.krebs.users.tv; @@ -136,7 +132,7 @@ in server-names = singleton "viljetic.de"; # TODO directly set root (instead via location) locations = singleton (nameValuePair "/" '' - root ${tvpkgs.viljetic-pages}; + root ${pkgs.viljetic-pages}; ''); }; } diff --git a/tv/1systems/wu.nix b/tv/1systems/wu.nix index 34ba565..622fd72 100644 --- a/tv/1systems/wu.nix +++ b/tv/1systems/wu.nix @@ -2,10 +2,6 @@ with lib; -let - tvpkgs = import ../5pkgs { inherit lib pkgs; }; -in - { krebs.build.host = config.krebs.hosts.wu; krebs.build.user = config.krebs.users.tv; @@ -39,12 +35,12 @@ in environment.systemPackages = with pkgs; [ # stockholm + genid git gnumake + hashPassword + lentil parallel - tvpkgs.genid - tvpkgs.hashPassword - tvpkgs.lentil (pkgs.writeScriptBin "ff" '' #! ${pkgs.bash}/bin/bash exec sudo -u ff -i <