Skip to content

Commit

Permalink
Nix flake registry, NIX_PATH, & input source dir symlinks via flake-u…
Browse files Browse the repository at this point in the history
…tils-plus nixosModule
  • Loading branch information
Lehmanator committed Dec 11, 2023
1 parent ee2c3e4 commit 15d59a9
Showing 1 changed file with 19 additions and 27 deletions.
46 changes: 19 additions & 27 deletions profiles/nix/registry.nix
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
{ inputs, config, lib, pkgs, ... }:
{
imports = [ inputs.nix-quick-registry.nixosModules.local-registry ];
# User: ~/.config/nix/registry.json
# Create Nix registry from nixpkgs
# TODO: Select input based on system type
#nix.registry.nixpkgs.flake = inputs.nixpkgs;
nix = {
#registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
#nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
imports = [
inputs.nix-quick-registry.nixosModules.local-registry
inputs.flake-utils-plus.nixosModules.autoGenFromInputs
];

registry = {
nixos.flake = inputs.nixos;
darwin.flake = inputs.darwin;
nixpkgs = {
#from = {
# id = "nixpkgs";
# type = "indirect";
#};
flake = inputs.nixpkgs;
};
home-manager.flake = inputs.home;
home.flake = inputs.home;
#repo = {
# to = { type = "github";
# owner = "PresqueIsleWineDev";
# repo = "nix-configs";
# };
#};
};
nix = {
generateNixPathFromInputs = true;
generateRegistryFromInputs = true;
linkInputs = true;
localRegistry = {
enable = true;
cacheGlobalRegistry = true;
Expand All @@ -39,3 +20,14 @@
};
};
}
#registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
#nixPath = lib.mapAttrsToList (key: value: "${key}=${value.flake.outPath}") config.nix.registry;
#environment.etc."nixtest" = lib.mapAttrs'
# (fname: flake: {
# name = "nix/inputs2/${fname}";
# value = flake.outPath;
# })
# inputs;

#environment.etc = lib.mapAttrs' (name: value: lib.nameValuePair ("nix/inputs/${name}".source) (value.outPath)) inputs;

0 comments on commit 15d59a9

Please sign in to comment.