Move git options to separate module
This commit is contained in:
parent
2af3a6de6f
commit
de8021cbb8
|
@ -1,7 +1,59 @@
|
|||
{ lib, ... }: {
|
||||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
gitType = types.submodule (
|
||||
{ ... }: {
|
||||
options = {
|
||||
defaultBranch = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "The name of the default branch in newly created repositories.";
|
||||
default = null;
|
||||
};
|
||||
|
||||
flow = {
|
||||
mainBranch = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "The name of the stable branch in git flow.";
|
||||
default = null;
|
||||
};
|
||||
|
||||
devBranch = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "The name of the development branch in git flow.";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
aliases = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
description = "The git command aliases to install.";
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
gitOption = mkOption {
|
||||
type = gitType;
|
||||
description = "The git related options.";
|
||||
default = {};
|
||||
};
|
||||
in {
|
||||
options = {
|
||||
valhalla = {
|
||||
git = (import ./git/options.nix) { inherit lib; };
|
||||
git = gitOption;
|
||||
|
||||
users = mkOption {
|
||||
type = types.attrsOf (types.submodule (
|
||||
{ ... }: {
|
||||
options = {
|
||||
git = gitOption;
|
||||
};
|
||||
}));
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
in {
|
||||
defaultBranch = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "The name of the default branch in git.";
|
||||
default = null;
|
||||
};
|
||||
|
||||
flow = {
|
||||
mainBranch = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "The name of the stable branch in git flow.";
|
||||
default = null;
|
||||
};
|
||||
|
||||
devBranch = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "The name of the development branch in git flow.";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
aliases = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
description = "Git command aliases to install.";
|
||||
default = {};
|
||||
};
|
||||
}
|
|
@ -47,8 +47,6 @@
|
|||
description = "The additional groups of the user.";
|
||||
default = [];
|
||||
};
|
||||
|
||||
git = (import ./git/options.nix) { inherit lib; };
|
||||
};
|
||||
}));
|
||||
description = "The users to create on the machine.";
|
||||
|
|
Loading…
Reference in a new issue