mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-05 08:17:01 +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.automatic = true;
|
||||||
nix.gc.options = "--max-freed $((25 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | awk '{ print $4 }')))";
|
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.
|
# Used for backwards compatibility, please read the changelog before changing.
|
||||||
# $ darwin-rebuild changelog
|
# $ darwin-rebuild changelog
|
||||||
system.stateVersion = 5;
|
system.stateVersion = 5;
|
||||||
|
|
|
@ -46,12 +46,6 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
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) [
|
warnings = mkIf (isDerivation cfg.configFile) [
|
||||||
"services.ofborg.configFile is a derivation, credentials will be world readable"
|
"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.shell = "/bin/bash";
|
||||||
users.users.ofborg.description = "OfBorg service user";
|
users.users.ofborg.description = "OfBorg service user";
|
||||||
|
|
||||||
|
users.knownUsers = [ "ofborg" ];
|
||||||
|
|
||||||
users.groups.ofborg.gid = mkDefault 531;
|
users.groups.ofborg.gid = mkDefault 531;
|
||||||
users.groups.ofborg.description = "Nix group for OfBorg service";
|
users.groups.ofborg.description = "Nix group for OfBorg service";
|
||||||
|
|
||||||
|
users.knownGroups = [ "ofborg" ];
|
||||||
|
|
||||||
# FIXME: create logfiles automatically if defined.
|
# FIXME: create logfiles automatically if defined.
|
||||||
system.activationScripts.preActivation.text = ''
|
system.activationScripts.preActivation.text = ''
|
||||||
mkdir -p '${user.home}'
|
mkdir -p '${user.home}'
|
||||||
|
|
Loading…
Add table
Reference in a new issue