From bc838d609d577becf0bc2fab6dd5d71d17304b27 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Sun, 17 Dec 2023 17:51:15 +0800 Subject: [PATCH] nixos: nix: flake: add each flake input as a registry --- nixos/profiles/core/nix/flake.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nixos/profiles/core/nix/flake.nix b/nixos/profiles/core/nix/flake.nix index 641dea6..8feab2a 100755 --- a/nixos/profiles/core/nix/flake.nix +++ b/nixos/profiles/core/nix/flake.nix @@ -1,6 +1,7 @@ { pkgs, inputs, + lib, ... }: { # Enable Flakes @@ -12,8 +13,11 @@ # Disable flake-registry # https://nixos-and-flakes.thiscute.world/best-practices/nix-path-and-flake-registry nix.settings.flake-registry = ""; - nix.registry.nixpkgs.flake = inputs.nixpkgs; - nix.registry.nixpkgs-stable.flake = inputs.nixpkgs-stable; + + # Add each flake input as a registry + # To make nix3 commands consistent with the flake + # https://github.com/Misterio77/nix-config/blob/main/hosts/common/global/nix.nix + nix.registry = lib.mapAttrs (_: value: {flake = value;}) inputs; # Install Git environment.systemPackages = [pkgs.git];