mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2026-04-14 13:19:09 +02:00
feat[server]: storage migration finished
This commit is contained in:
parent
c6539ed484
commit
3422a39da5
94 changed files with 1963 additions and 1626 deletions
|
|
@ -15,59 +15,61 @@ in
|
|||
{
|
||||
options = {
|
||||
swarselmodules.server.ids = lib.mkEnableOption "enable persistent ids on server";
|
||||
users.persistentIds = mkOption {
|
||||
default = { };
|
||||
description = ''
|
||||
Maps a user or group name to its expected uid/gid values. If a user/group is
|
||||
used on the system without specifying a uid/gid, this module will assign the
|
||||
corresponding ids defined here, or show an error if the definition is missing.
|
||||
'';
|
||||
type = types.attrsOf (
|
||||
types.submodule {
|
||||
options = {
|
||||
uid = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
default = null;
|
||||
description = "The uid to assign if it is missing in `users.users.<name>`.";
|
||||
users = {
|
||||
persistentIds = mkOption {
|
||||
default = { };
|
||||
description = ''
|
||||
Maps a user or group name to its expected uid/gid values. If a user/group is
|
||||
used on the system without specifying a uid/gid, this module will assign the
|
||||
corresponding ids defined here, or show an error if the definition is missing.
|
||||
'';
|
||||
type = types.attrsOf (
|
||||
types.submodule {
|
||||
options = {
|
||||
uid = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
default = null;
|
||||
description = "The uid to assign if it is missing in `users.users.<name>`.";
|
||||
};
|
||||
gid = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
default = null;
|
||||
description = "The gid to assign if it is missing in `users.groups.<name>`.";
|
||||
};
|
||||
};
|
||||
gid = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
default = null;
|
||||
description = "The gid to assign if it is missing in `users.groups.<name>`.";
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
users.users = mkOption {
|
||||
type = types.attrsOf (
|
||||
types.submodule (
|
||||
{ name, ... }:
|
||||
{
|
||||
config.uid =
|
||||
let
|
||||
persistentUid = cfg.${name}.uid or null;
|
||||
in
|
||||
mkIf (persistentUid != null) (mkDefault persistentUid);
|
||||
}
|
||||
)
|
||||
);
|
||||
};
|
||||
);
|
||||
};
|
||||
|
||||
users.groups = mkOption {
|
||||
type = types.attrsOf (
|
||||
types.submodule (
|
||||
{ name, ... }:
|
||||
{
|
||||
config.gid =
|
||||
let
|
||||
persistentGid = cfg.${name}.gid or null;
|
||||
in
|
||||
mkIf (persistentGid != null) (mkDefault persistentGid);
|
||||
}
|
||||
)
|
||||
);
|
||||
users = mkOption {
|
||||
type = types.attrsOf (
|
||||
types.submodule (
|
||||
{ name, ... }:
|
||||
{
|
||||
config.uid =
|
||||
let
|
||||
persistentUid = cfg.${name}.uid or null;
|
||||
in
|
||||
mkIf (persistentUid != null) (mkDefault persistentUid);
|
||||
}
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
groups = mkOption {
|
||||
type = types.attrsOf (
|
||||
types.submodule (
|
||||
{ name, ... }:
|
||||
{
|
||||
config.gid =
|
||||
let
|
||||
persistentGid = cfg.${name}.gid or null;
|
||||
in
|
||||
mkIf (persistentGid != null) (mkDefault persistentGid);
|
||||
}
|
||||
)
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
config = lib.mkIf config.swarselmodules.server.ids {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue