nixos-config/modules/nix/link-inputs.nix
Charlotte 🦝 Delenk eaaa6c9546
Some checks reported errors
Hydra nixosConfigurations.not522 Hydra build #25196 of nixos-config:pr618:nixosConfigurations.not522
Hydra nixosConfigurations.not522-installer Hydra build #25197 of nixos-config:pr618:nixosConfigurations.not522-installer
Hydra nixosConfigurations.container-default-aarch64-linux Hydra build #25193 of nixos-config:pr618:nixosConfigurations.container-default-aarch64-linux
Hydra nixosConfigurations.container-default-riscv64-linux Hydra build #25194 of nixos-config:pr618:nixosConfigurations.container-default-riscv64-linux
Hydra nixosConfigurations.rainbow-resort Hydra build #25199 of nixos-config:pr618:nixosConfigurations.rainbow-resort
Hydra packages.x86_64-linux.package-updater Hydra build #25203 of nixos-config:pr618:packages.x86_64-linux.package-updater
Hydra packages.aarch64-linux.package-updater Hydra build #25201 of nixos-config:pr618:packages.aarch64-linux.package-updater
Hydra packages.riscv64-linux.package-updater Hydra build #25202 of nixos-config:pr618:packages.riscv64-linux.package-updater
Hydra nixosConfigurations.container-default-x86_64-linux Hydra build #25195 of nixos-config:pr618:nixosConfigurations.container-default-x86_64-linux
Hydra nixosConfigurations.thinkrac Hydra build #25200 of nixos-config:pr618:nixosConfigurations.thinkrac
Hydra nixosConfigurations.pc-installer Hydra build #25198 of nixos-config:pr618:nixosConfigurations.pc-installer
Hydra checks.x86_64-linux.containers-default Hydra build #25192 of nixos-config:pr618:checks.x86_64-linux.containers-default
remove nix registry if nix is disabled
2024-11-11 10:28:36 +01:00

24 lines
621 B
Nix

{
lib,
pureInputs,
config,
...
}:
let
# Taken from https://github.com/gytis-ivaskevicius/flake-utils-plus/blob/master/lib/options.nix
inherit (lib) filterAttrs mapAttrs';
flakes = filterAttrs (
name: value: (value ? outputs) && (name != "self") && (name != "nixos-config")
) pureInputs;
nixRegistry = builtins.mapAttrs (name: v: { flake = v; }) flakes;
in
{
nix.registry = nixRegistry;
environment.etc = mapAttrs' (name: value: {
name = "nix/inputs/${name}";
value = lib.mkIf config.nix.enable {
source = value.outPath;
};
}) flakes;
nix.nixPath = [ "/etc/nix/inputs" ];
}