From 4ec35dcd2b92e42d4ee436b7a03cc1a77788f457 Mon Sep 17 00:00:00 2001 From: winston Date: Fri, 29 Dec 2023 09:39:36 +0100 Subject: [PATCH] feat: more nixPath pins --- machines/common/shared/nix.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/machines/common/shared/nix.nix b/machines/common/shared/nix.nix index 34b464b..f62e0b0 100644 --- a/machines/common/shared/nix.nix +++ b/machines/common/shared/nix.nix @@ -4,9 +4,10 @@ pkgs, ... }: let + inherit (builtins) attrValues mapAttrs; inherit (lib) filterAttrs; inherit (pkgs.stdenv) isDarwin isLinux; - flakes = filterAttrs (name: value: value ? outputs) inputs; + flakeInputs = filterAttrs (name: value: (value ? outputs) && (name != "self")) inputs; in { nixpkgs.config.allowUnfree = true; nix = { @@ -21,12 +22,12 @@ in { warn-dirty = false; } // (import ../../../flake.nix).nixConfig; - registry = builtins.mapAttrs (name: v: {flake = v;}) flakes; + registry = mapAttrs (name: v: {flake = v;}) flakeInputs; nixPath = if isDarwin - then lib.mkForce [{nixpkgs = "${inputs.nixpkgs.outPath}";}] + then lib.mkForce (mapAttrs (k: v: v.outPath) flakeInputs) else if isLinux - then ["nixpkgs=${inputs.nixpkgs.outPath}"] + then attrValues (mapAttrs (k: v: "${k}=${v.outPath}") flakeInputs) else throw "Unsupported platform"; }; }