Bruno BELANYI
c7c38865e9
This option doesn't really work the way it should anyway [1].
This reverts commit cbf6ea9ac9
.
[1]: https://github.com/NixOS/nixpkgs/pull/138741
36 lines
864 B
Nix
36 lines
864 B
Nix
# Nix related settings
|
|
{ config, inputs, lib, pkgs, ... }:
|
|
let
|
|
cfg = config.my.system.nix;
|
|
in
|
|
{
|
|
options.my.system.nix = with lib; {
|
|
enable = my.mkDisableOption "nix configuration";
|
|
|
|
addToRegistry = my.mkDisableOption "add inputs and self to registry";
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
|
{
|
|
nix = {
|
|
package = pkgs.nixFlakes;
|
|
|
|
extraOptions = ''
|
|
experimental-features = nix-command flakes
|
|
'';
|
|
};
|
|
}
|
|
|
|
(lib.mkIf cfg.addToRegistry {
|
|
nix.registry = {
|
|
# Allow me to use my custom package using `nix run self#pkg`
|
|
self.flake = inputs.self;
|
|
# Use pinned nixpkgs when using `nix run pkgs#<whatever>`
|
|
pkgs.flake = inputs.nixpkgs;
|
|
# Add NUR to run some packages that are only present there
|
|
nur.flake = inputs.nur;
|
|
};
|
|
})
|
|
]);
|
|
}
|