stockholm/tv/2configs/test.nix

32 lines
668 B
Nix
Raw Normal View History

2015-08-28 19:48:29 +00:00
{ config, lib, pkgs, ... }:
with import ../4lib { inherit lib pkgs; };
let
out = {
environment.systemPackages = [
su-test
];
2015-08-28 19:48:29 +00:00
security.sudo.extraConfig = ''
tv ALL=(test) NOPASSWD: ALL
'';
users.extraUsers.test = {
shell = "${test-shell}";
};
};
2015-08-28 22:19:52 +00:00
su-test = pkgs.execveBin "su-test" rec {
filename = "/var/setuid-wrappers/sudo";
argv = ["sudo" "-u" "test" "-i"];
};
2015-08-28 22:19:52 +00:00
test-shell = pkgs.execve "test-shell" rec {
2015-08-28 19:48:29 +00:00
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