NixOS-Config/nixos/modules/legacy.nix

15 lines
535 B
Nix

{config, inputs, lib, ...}: {
# This will add each flake input as a registry to make nix commands consistent with your flake
nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
# This will add your inputs to the system's legacy channels making legacy nix commands consistent
nix.nixPath = ["/etc/nix/path"];
environment.etc =
lib.mapAttrs'
(name: value: {
name = "nix/path/${name}";
value.source = value.flake;
})
config.nix.registry;
}