inputs: { lib, pkgs, self, settings, ... }: { nix = { package = pkgs.nixVersions.unstable; #automatically get registry from input flakes registry = ( lib.attrsets.mapAttrs ( _: value: { flake = value; } ) ( lib.attrsets.filterAttrs ( _: value: ( !(lib.attrsets.hasAttrByPath ["flake"] value) || value.flake == false ) ) inputs ) // { nixpkgs.flake = inputs.unstable; system.flake = self; } ); #automatically add registry entries to nixPath nixPath = (lib.mapAttrsToList (name: value: name + "=" + value) inputs) ++ ["system=${self}" "nixpkgs=${inputs.unstable}"]; settings = { experimental-features = ["nix-command" "flakes" "repl-flake"]; auto-optimise-store = true; warn-dirty = false; flake-registry = builtins.toFile "empty-flake-registry.json" ''{"flakes":[],"version":2}''; keep-outputs = true; keep-derivations = true; trusted-users = [ "root" "@wheel" ]; allowed-users = [ ]; }; }; #make gcroots for each flake input systemd.tmpfiles.rules = lib.attrsets.mapAttrsToList (name: value: "L+ /nix/var/nix/gcroots/${name} - - - - ${value}") inputs; }