clear (refactor options): refactor options
This commit is contained in:
parent
00ea2b0c36
commit
bfce36ce73
22 changed files with 340 additions and 463 deletions
|
|
@ -5,25 +5,17 @@
|
|||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
|
||||
cfg = config.host.nix;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
host.nix = {
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Nix settings for host.";
|
||||
};
|
||||
optimization.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Nix store optimization.";
|
||||
};
|
||||
};
|
||||
options.host.nix = {
|
||||
enable = mkEnableOption "Nix settings strfor host.";
|
||||
optimization.enable = mkEnableOption "Nix store optimization.";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
config = mkIf cfg.enable {
|
||||
nix = {
|
||||
package = pkgs.nix;
|
||||
|
||||
|
|
@ -36,7 +28,7 @@ in
|
|||
];
|
||||
};
|
||||
|
||||
optimise = lib.mkIf cfg.optimization.enable {
|
||||
optimise = mkIf cfg.optimization.enable {
|
||||
automatic = true;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Reference in a new issue