mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
ofborg: automatically add ofborg
to known{Users,Groups}
This commit is contained in:
parent
dd48cbd776
commit
569153467b
2 changed files with 4 additions and 11 deletions
|
@ -18,11 +18,6 @@ with lib;
|
|||
nix.gc.automatic = true;
|
||||
nix.gc.options = "--max-freed $((25 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | awk '{ print $4 }')))";
|
||||
|
||||
# Manage user for ofborg, this enables creating/deleting users
|
||||
# depending on what modules are enabled.
|
||||
users.knownGroups = [ "ofborg" ];
|
||||
users.knownUsers = [ "ofborg" ];
|
||||
|
||||
# Used for backwards compatibility, please read the changelog before changing.
|
||||
# $ darwin-rebuild changelog
|
||||
system.stateVersion = 5;
|
||||
|
|
|
@ -46,12 +46,6 @@ in
|
|||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
assertions = [
|
||||
{ assertion = elem "ofborg" config.users.knownGroups; message = "set users.knownGroups to enable ofborg group"; }
|
||||
{ assertion = elem "ofborg" config.users.knownUsers; message = "set users.knownUsers to enable ofborg user"; }
|
||||
];
|
||||
|
||||
warnings = mkIf (isDerivation cfg.configFile) [
|
||||
"services.ofborg.configFile is a derivation, credentials will be world readable"
|
||||
];
|
||||
|
@ -87,9 +81,13 @@ in
|
|||
users.users.ofborg.shell = "/bin/bash";
|
||||
users.users.ofborg.description = "OfBorg service user";
|
||||
|
||||
users.knownUsers = [ "ofborg" ];
|
||||
|
||||
users.groups.ofborg.gid = mkDefault 531;
|
||||
users.groups.ofborg.description = "Nix group for OfBorg service";
|
||||
|
||||
users.knownGroups = [ "ofborg" ];
|
||||
|
||||
# FIXME: create logfiles automatically if defined.
|
||||
system.activationScripts.preActivation.text = ''
|
||||
mkdir -p '${user.home}'
|
||||
|
|
Loading…
Reference in a new issue