feat: make nix settings available in home-manager standalone config
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
osConfig ? null,
|
osConfig ? null,
|
||||||
|
inputs,
|
||||||
lib,
|
lib,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
@@ -20,6 +22,24 @@ in
|
|||||||
|
|
||||||
kekleo = lib.mkIf (osConfig != null) (mkDefaultSharedAttrs config.kekleo (osConfig.kekleo or { }));
|
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 = {
|
home.sessionVariables = {
|
||||||
XDG_CACHE_HOME = "$HOME/.cache";
|
XDG_CACHE_HOME = "$HOME/.cache";
|
||||||
XDG_CONFIG_HOME = "$HOME/.config";
|
XDG_CONFIG_HOME = "$HOME/.config";
|
||||||
|
|||||||
Reference in New Issue
Block a user