mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-28 02:37:09 +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.";
|
||||
};
|
||||
|
||||
nix.gc.user = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = "User that runs the garbage collector.";
|
||||
};
|
||||
|
||||
nix.gc.interval = mkOption {
|
||||
type = types.attrs;
|
||||
default = { Hour = 3; Minute = 15; };
|
||||
|
@ -38,6 +44,7 @@ in
|
|||
environment.NIX_REMOTE = optionalString config.services.nix-daemon.enable "daemon";
|
||||
serviceConfig.RunAtLoad = false;
|
||||
serviceConfig.StartCalendarInterval = [ cfg.interval ];
|
||||
serviceConfig.UserName = cfg.user;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue