flake-parts/setups: update shared Nix configuration

This commit is contained in:
Gabriel Arazas 2024-06-21 20:57:01 +08:00
parent e1ed34dc29
commit d13428b28b
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360

View File

@ -7,6 +7,9 @@ let
nixpkgs = inputs.${config.nixpkgs.branch}; nixpkgs = inputs.${config.nixpkgs.branch};
home-manager = inputs.${config.homeManagerBranch}; home-manager = inputs.${config.homeManagerBranch};
}; };
flakeInputName = name:
if name == "self" then "config" else name;
in in
{ {
config.modules = [( config.modules = [(
@ -17,19 +20,12 @@ in
nix.registry = nix.registry =
lib.mapAttrs' lib.mapAttrs'
(name: flake: (name: flake:
let lib.nameValuePair (flakeInputName name) { inherit flake; })
name' = if (name == "self") then "config" else name;
in
lib.nameValuePair name' { inherit flake; })
inputs'; inputs';
nix.settings.nix-path = nix.settings.nix-path =
(lib.mapAttrsToList (lib.mapAttrsToList
(name: source: (name: source: "${flakeInputName name}=${source}")
let
name' = if (name == "self") then "config" else name;
in
"${name'}=${source}")
inputs' inputs'
++ [ ++ [
"/nix/var/nix/profiles/per-user/root/channels" "/nix/var/nix/profiles/per-user/root/channels"