-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodule.nix
40 lines (34 loc) · 994 Bytes
/
module.nix
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{config, lib, pkgs, ...}:
with lib;
let
cfg = config.services.fragile;
fragile = pkgs.callPackage ./. { suPath = "${config.security.wrapperDir}/su"; };
in {
options = {
services.fragile.enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable fragile, placing it in the system packages.
This may have security implications.
'';
};
services.fragile.permitNixbldSudo = mkOption {
type = types.bool;
default = true;
description = ''
Whether to permit passwordless sudo access to fragile for users in the
nixbld group.
'';
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ fragile ];
security.sudo.extraConfig = mkIf cfg.permitNixbldSudo ''
# services.fragile.permitNixbldSudo
Cmnd_Alias FRAGILE = ${fragile}/bin/fragile
Defaults!FRAGILE env_keep += NIX_PATH
%nixbld ALL = NOPASSWD: FRAGILE
'';
};
}