feat: make nix settings available in home-manager standalone config

This commit is contained in:
2026-07-16 10:18:00 +02:00
parent 2c4512dff3
commit 404b3c5796
+20
View File
@@ -1,7 +1,9 @@
{
config,
osConfig ? null,
inputs,
lib,
pkgs,
...
}:
let
@@ -20,6 +22,24 @@ in
kekleo = lib.mkIf (osConfig != null) (mkDefaultSharedAttrs config.kekleo (osConfig.kekleo or { }));
nix =
let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in
{
package = pkgs.nix;
settings = {
experimental-features = osConfig.nix.settings.experimental-features or "nix-command flakes";
# Opinionated: disable global registry
flake-registry = "";
};
# Opinionated: make flake registry and nix path match flake inputs
registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
home.sessionVariables = {
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";