From a7e14fb69ae3a3f805d5251660847f3fa514addb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikodem=20Rabuli=C5=84ski?= Date: Thu, 1 May 2025 22:02:11 +0200 Subject: [PATCH] modules/system/flake-qol: double copying nixpkgs is no more --- modules/system/flake-qol.nix | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/modules/system/flake-qol.nix b/modules/system/flake-qol.nix index 38a5228..d3e2f10 100644 --- a/modules/system/flake-qol.nix +++ b/modules/system/flake-qol.nix @@ -7,6 +7,18 @@ }: let cfg = config.settei.flake-qol; + + nixpkgsInputToFlakeRef = + input: + if input._type or "" == "flake" then + { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + inherit (input) lastModified narHash rev; + } + else + input; in { _file = ./flake-qol.nix; @@ -20,6 +32,12 @@ in default = true; }; inputs = mkOption { type = types.unspecified; }; + nixpkgsRef = mkOption { + type = types.unspecified; + default = cfg.inputs.nixpkgs; + apply = + ref: if builtins.isString ref then builtins.parseFlakeRef ref else nixpkgsInputToFlakeRef ref; + }; inputs-flakes = mkOption { type = types.attrs; readOnly = true; @@ -44,8 +62,8 @@ in settei.user.extraArgs = reexportedArgs; nix = { - registry = lib.mapAttrs (_: flake: { inherit flake; }) cfg.inputs-flakes; - nixPath = lib.mapAttrsToList (name: _: "${name}=flake:${name}") cfg.inputs-flakes; + registry.nixpkgs.to = cfg.nixpkgsRef; + nixPath = [ "nixpkgs=flake:nixpkgs" ]; }; }; }