add option for nixpkgs reference in flake registry

This commit is contained in:
xenia 2024-12-02 01:53:59 -05:00
parent 4259429d0c
commit 984654610a
1 changed files with 12 additions and 2 deletions

View File

@ -89,10 +89,20 @@
defaultText = lib.literalExpression "true";
example = lib.literalExpression "false";
};
setNixpkgsFlakeAlias = lib.mkOption {
description = "Set nix path entry for `nixpkgs` to self";
type = lib.types.bool;
default = true;
defaultText = lib.literalExpression "true";
example = lib.literalExpression "false";
};
};
config.nix.registry = lib.mkIf config.dragnpkgs.setFlakeRegistry {
dragnpkgs = self.meta.registry-entry;
config.nix.registry.dragnpkgs = lib.mkIf config.dragnpkgs.setFlakeRegistry self.meta.registry-entry;
config.nix.registry.nixpkgs = lib.mkIf config.dragnpkgs.setNixpkgsFlakeAlias {
from = { id = "nixpkgs"; type = "indirect"; };
to = { id = "dragnpkgs"; type = "indirect"; };
};
config.nix.nixPath = lib.mkIf config.dragnpkgs.setNixPath [