mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-31 04:04:45 +00:00
nix-gc: add user option
This configures the user that runs the garbage collector, particularly useful for single-user installs. Otherwise it runs as root resulting in permission issues afterwards.
This commit is contained in:
parent
0a8741be9c
commit
f5116b0f4d
1 changed files with 7 additions and 0 deletions
|
@ -14,6 +14,12 @@ in
|
||||||
description = "Automatically run the garbage collector at a specific time.";
|
description = "Automatically run the garbage collector at a specific time.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nix.gc.user = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
description = "User that runs the garbage collector.";
|
||||||
|
};
|
||||||
|
|
||||||
nix.gc.interval = mkOption {
|
nix.gc.interval = mkOption {
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
default = { Hour = 3; Minute = 15; };
|
default = { Hour = 3; Minute = 15; };
|
||||||
|
@ -38,6 +44,7 @@ in
|
||||||
environment.NIX_REMOTE = optionalString config.services.nix-daemon.enable "daemon";
|
environment.NIX_REMOTE = optionalString config.services.nix-daemon.enable "daemon";
|
||||||
serviceConfig.RunAtLoad = false;
|
serviceConfig.RunAtLoad = false;
|
||||||
serviceConfig.StartCalendarInterval = [ cfg.interval ];
|
serviceConfig.StartCalendarInterval = [ cfg.interval ];
|
||||||
|
serviceConfig.UserName = cfg.user;
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue