2021-04-11 00:25:36 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.magic_rb.flakes;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.magic_rb.flakes = {
|
|
|
|
enable = mkEnableOption "Enable flake support";
|
2021-08-18 22:18:42 +02:00
|
|
|
nixMaster = mkEnableOption "Whether to enable Nix master for dwarffs.";
|
2021-04-11 00:25:36 +02:00
|
|
|
};
|
2021-08-18 22:18:42 +02:00
|
|
|
config = mkIf cfg.enable {
|
|
|
|
nixpkgs.overlays = mkIf cfg.nixMaster [ config.magic_rb.pins.nix.overlay ];
|
|
|
|
|
|
|
|
nix =
|
|
|
|
{
|
|
|
|
package =
|
|
|
|
if !cfg.nixMaster then
|
|
|
|
pkgs.nixFlakes
|
|
|
|
else
|
|
|
|
pkgs.nix;
|
|
|
|
extraOptions = ''
|
2022-04-15 09:56:21 +02:00
|
|
|
experimental-features = nix-command flakes
|
2021-08-18 22:18:42 +02:00
|
|
|
'';
|
|
|
|
};
|
2021-04-11 00:25:36 +02:00
|
|
|
};
|
|
|
|
}
|