1
0
Fork 0
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:
Daiderd Jordan 2019-01-02 20:19:23 +01:00
parent 0a8741be9c
commit f5116b0f4d
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -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;
};
};