summaryrefslogtreecommitdiffstats
path: root/tv/2configs/test.nix
blob: f96b9e98e95eb87e83d43503d7156ce6ad2a8e2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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