forked from fabian/nix_config
Add 'trivionomicon/' from commit '0ae8676d50
'
git-subtree-dir: trivionomicon git-subtree-mainline:00d3799f90
git-subtree-split:0ae8676d50
This commit is contained in:
commit
ad9c16de0c
50 changed files with 2091 additions and 0 deletions
16
trivionomicon/modules/nix-registry/default.nix
Normal file
16
trivionomicon/modules/nix-registry/default.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
doctrine,
|
||||
flakes,
|
||||
...
|
||||
}:
|
||||
doctrine.lib.mkModule {
|
||||
inherit config;
|
||||
name = "nix-registry";
|
||||
hm = ./hm.nix;
|
||||
options = ./options.nix;
|
||||
|
||||
passthru = {inherit flakes;};
|
||||
}
|
23
trivionomicon/modules/nix-registry/hm.nix
Normal file
23
trivionomicon/modules/nix-registry/hm.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
cfg,
|
||||
flakes,
|
||||
...
|
||||
}: let
|
||||
registryName = name:
|
||||
if name == "self"
|
||||
then cfg.renameSelf
|
||||
else name;
|
||||
|
||||
registryFilter = {
|
||||
nixpkgs = true;
|
||||
unstable = true;
|
||||
self = cfg.renameSelf != null;
|
||||
};
|
||||
in {
|
||||
nix.registry =
|
||||
lib.mapAttrs'
|
||||
(name: value: lib.nameValuePair (registryName name) {flake = value;})
|
||||
(lib.filterAttrs (name: _: registryFilter.${name} or cfg.allInputs) flakes);
|
||||
}
|
19
trivionomicon/modules/nix-registry/options.nix
Normal file
19
trivionomicon/modules/nix-registry/options.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{lib, ...}:
|
||||
with lib.types; {
|
||||
hm = {
|
||||
allInputs = mkOption {
|
||||
type = bool;
|
||||
default = default;
|
||||
description = ''
|
||||
Include all flake inputs. If false, only 'nixpkgs' and 'unstable'
|
||||
(if available) will be added to the flake registry by default.
|
||||
'';
|
||||
};
|
||||
|
||||
renameSelf = mkOption {
|
||||
type = nullOr str;
|
||||
default = "self";
|
||||
description = "Registry name to use for the 'self' input";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue