feat: more nixPath pins

This commit is contained in:
winston 2023-12-29 09:39:36 +01:00
parent c456490501
commit 4ec35dcd2b
Signed by: winston
GPG key ID: 3786770EDBC2B481

View file

@ -4,9 +4,10 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (builtins) attrValues mapAttrs;
inherit (lib) filterAttrs; inherit (lib) filterAttrs;
inherit (pkgs.stdenv) isDarwin isLinux; inherit (pkgs.stdenv) isDarwin isLinux;
flakes = filterAttrs (name: value: value ? outputs) inputs; flakeInputs = filterAttrs (name: value: (value ? outputs) && (name != "self")) inputs;
in { in {
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nix = { nix = {
@ -21,12 +22,12 @@ in {
warn-dirty = false; warn-dirty = false;
} }
// (import ../../../flake.nix).nixConfig; // (import ../../../flake.nix).nixConfig;
registry = builtins.mapAttrs (name: v: {flake = v;}) flakes; registry = mapAttrs (name: v: {flake = v;}) flakeInputs;
nixPath = nixPath =
if isDarwin if isDarwin
then lib.mkForce [{nixpkgs = "${inputs.nixpkgs.outPath}";}] then lib.mkForce (mapAttrs (k: v: v.outPath) flakeInputs)
else if isLinux else if isLinux
then ["nixpkgs=${inputs.nixpkgs.outPath}"] then attrValues (mapAttrs (k: v: "${k}=${v.outPath}") flakeInputs)
else throw "Unsupported platform"; else throw "Unsupported platform";
}; };
} }