align nix flake registry with flake.lock

This commit is contained in:
Casper V. Kristensen 2023-11-11 00:49:55 +01:00
parent e641835bbe
commit 2f5e4c57d8

View file

@ -1,4 +1,4 @@
{ config, nix-index-database, lib, pkgs, ... }: {
{ config, nix-index-database, nixpkgs-unstable, nixpkgs, lib, pkgs, ... }: {
imports = [
nix-index-database.nixosModules.nix-index
];
@ -14,6 +14,18 @@
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
};
# The nix registry is used to refer to flakes using symbolic identifiers
# when running commands such as `nix run nixpkgs#hello`. By default,
# the global registry from [1] is used, which aliases `nixpkgs` to the
# nixpkgs-unstable branch. We overwrite the default global `nixpkgs`
# registry with one which refers to the same nixpkgs as the rest of
# the system, aligning it with flake.lock.
# [1] https://github.com/NixOS/flake-registry/blob/master/flake-registry.json
registry = {
nixpkgs.flake = nixpkgs;
nixpkgs-unstable.flake = nixpkgs-unstable;
};
};
nixpkgs.config.allowUnfree = true;