This repository has been archived on 2025-10-08. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
nixos-config/options/host/nix.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;
};
};
};
}