global/nix: handle local registry manually

This commit is contained in:
Infinidoge 2023-09-18 10:08:38 -04:00
parent 169e641c10
commit b1fc6ebc90
3 changed files with 36 additions and 43 deletions

52
flake.lock generated
View file

@ -240,6 +240,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-registry": {
"flake": false,
"locked": {
"lastModified": 1692779116,
"narHash": "sha256-erTXdDToRA8whxURoEgBGWj550vcUirO6adEFIjQ0M0=",
"owner": "NixOS",
"repo": "flake-registry",
"rev": "3f641cbae15d3c74370aa9b97fd0ac478a114305",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "flake-registry",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1659877975, "lastModified": 1659877975,
@ -361,22 +377,6 @@
"type": "github" "type": "github"
} }
}, },
"globalRegistry": {
"flake": false,
"locked": {
"lastModified": 1692779116,
"narHash": "sha256-erTXdDToRA8whxURoEgBGWj550vcUirO6adEFIjQ0M0=",
"owner": "NixOS",
"repo": "flake-registry",
"rev": "3f641cbae15d3c74370aa9b97fd0ac478a114305",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "flake-registry",
"type": "github"
}
},
"haumea": { "haumea": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -658,29 +658,12 @@
"url": "ssh://git@github.com/Infinidoge/universe-private" "url": "ssh://git@github.com/Infinidoge/universe-private"
} }
}, },
"quick-nix-registry": {
"inputs": {
"globalRegistry": "globalRegistry"
},
"locked": {
"lastModified": 1627589359,
"narHash": "sha256-h0UhOgGtHwEcb2looQXIFPNmRwiFtXo4bEuBboPJzJo=",
"owner": "divnix",
"repo": "quick-nix-registry",
"rev": "9f1beb3e4de2e538b14ed8ddc71b706fd33b08dd",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "quick-nix-registry",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"devshell": "devshell", "devshell": "devshell",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"flake-registry": "flake-registry",
"fork": "fork", "fork": "fork",
"haumea": "haumea", "haumea": "haumea",
"hlissner-dotfiles": "hlissner-dotfiles", "hlissner-dotfiles": "hlissner-dotfiles",
@ -692,7 +675,6 @@
"nixos-wsl": "nixos-wsl", "nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs_4", "nixpkgs": "nixpkgs_4",
"private": "private", "private": "private",
"quick-nix-registry": "quick-nix-registry",
"rust-overlay": "rust-overlay", "rust-overlay": "rust-overlay",
"stable": "stable", "stable": "stable",
"universe-cli": "universe-cli" "universe-cli": "universe-cli"

View file

@ -36,7 +36,8 @@
hlissner-dotfiles.url = "github:hlissner/dotfiles"; hlissner-dotfiles.url = "github:hlissner/dotfiles";
quick-nix-registry.url = "github:divnix/quick-nix-registry"; flake-registry.url = "github:NixOS/flake-registry";
flake-registry.flake = false;
nixos-wsl.url = "github:nix-community/NixOS-WSL"; nixos-wsl.url = "github:nix-community/NixOS-WSL";
nixos-wsl.inputs.nixpkgs.follows = "nixpkgs"; nixos-wsl.inputs.nixpkgs.follows = "nixpkgs";
@ -125,7 +126,6 @@
# --- Library Modules --- # --- Library Modules ---
inputs.nixos-wsl.nixosModules.wsl inputs.nixos-wsl.nixosModules.wsl
inputs.impermanence.nixosModules.impermanence inputs.impermanence.nixosModules.impermanence
inputs.quick-nix-registry.nixosModules.local-registry
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
inputs.agenix.nixosModules.age inputs.agenix.nixosModules.age

View file

@ -28,9 +28,25 @@ with lib;
let let
flakes = filterAttrs (n: v: v ? outputs) inputs; flakes = filterAttrs (n: v: v ? outputs) inputs;
in in
builtins.mapAttrs (_n: v: { flake = v; }) flakes; (builtins.mapAttrs (_n: v: { flake = v; }) flakes)
// {
nixpkgs-git = {
exact = false;
from.id = "local";
from.type = "indirect";
to.url = "file:///nix/nixpkgs";
to.type = "git";
};
};
nixPath = [
"nixpkgs=${inputs.nixpkgs}"
"home-manager=${inputs.home-manager}"
];
extraOptions = '' extraOptions = ''
flake-registry = ${inputs.flake-registry}/flake-registry.json
extra-experimental-features = flakes nix-command extra-experimental-features = flakes nix-command
extra-substituters = https://nrdxp.cachix.org https://nix-community.cachix.org extra-substituters = https://nrdxp.cachix.org https://nix-community.cachix.org
extra-trusted-public-keys = nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= extra-trusted-public-keys = nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
@ -42,11 +58,6 @@ with lib;
'' + (if config.modules.secrets.enable then '' '' + (if config.modules.secrets.enable then ''
secret-key-files = ${config.secrets.binary-cache-private-key} secret-key-files = ${config.secrets.binary-cache-private-key}
'' else ""); '' else "");
localRegistry = {
enable = true;
cacheGlobalRegistry = true;
};
}; };
nixpkgs.config = { nixpkgs.config = {