44 lines
759 B
Nix
44 lines
759 B
Nix
{
|
|
lib,
|
|
pkgs,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
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.";
|
|
};
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
nix = {
|
|
package = pkgs.nix;
|
|
|
|
settings = {
|
|
warn-dirty = false;
|
|
experimental-features = [
|
|
"flakes"
|
|
"nix-command"
|
|
"pipe-operators"
|
|
];
|
|
};
|
|
|
|
optimise = lib.mkIf cfg.optimization.enable {
|
|
automatic = true;
|
|
};
|
|
};
|
|
};
|
|
}
|