moar options

This commit is contained in:
Kopatz
2024-04-16 21:53:03 +02:00
parent 409d684b17
commit 468c978e62
11 changed files with 141 additions and 100 deletions

View File

@@ -1,8 +1,18 @@
{ inputs, config, pkgsVersion, ... }:
{lib, inputs, config, pkgsVersion, ... }:
with lib;
let
cfg = config.kop.nix.settings;
in
{
nix.optimise.automatic = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.registry.nixpkgs.flake = pkgsVersion;
nix.nixPath = ["nixpkgs=flake:nixpkgs"];
home-manager.users.${config.mainUser.name}.home.sessionVariables.NIX_PATH = "nixpkgs=flake:nixpkgs$\{NIX_PATH:+:$NIX_PATH}";
options.kop.nix.settings = {
enable = mkEnableOption "Enables various nix settings";
};
config = mkIf cfg.enable {
nix.optimise.automatic = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.registry.nixpkgs.flake = pkgsVersion;
nix.nixPath = ["nixpkgs=flake:nixpkgs"];
home-manager.users.${config.mainUser.name}.home.sessionVariables.NIX_PATH = "nixpkgs=flake:nixpkgs$\{NIX_PATH:+:$NIX_PATH}";
};
}