nixos: nix: flake: add each flake input as a registry

This commit is contained in:
Guanran Wang 2023-12-17 17:51:15 +08:00
parent b3ed736c15
commit bc838d609d
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8

View file

@ -1,6 +1,7 @@
{ {
pkgs, pkgs,
inputs, inputs,
lib,
... ...
}: { }: {
# Enable Flakes # Enable Flakes
@ -12,8 +13,11 @@
# Disable flake-registry # Disable flake-registry
# https://nixos-and-flakes.thiscute.world/best-practices/nix-path-and-flake-registry # https://nixos-and-flakes.thiscute.world/best-practices/nix-path-and-flake-registry
nix.settings.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 # Install Git
environment.systemPackages = [pkgs.git]; environment.systemPackages = [pkgs.git];