2022-07-31 11:03:59 +02:00
|
|
|
# SPDX-FileCopyrightText: 2022 Richard Brežák <richard@brezak.sk>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.magic_rb.flakes;
|
|
|
|
in {
|
|
|
|
options.magic_rb.flakes = {
|
|
|
|
enable = mkEnableOption "Enable flake support";
|
|
|
|
nixMaster = mkEnableOption "Whether to enable Nix master for dwarffs.";
|
|
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
nixpkgs.overlays = mkIf cfg.nixMaster [config.magic_rb.pins.nix.overlay];
|
|
|
|
|
|
|
|
nix = {
|
|
|
|
package =
|
|
|
|
if !cfg.nixMaster
|
2022-10-30 15:27:47 +01:00
|
|
|
then pkgs.nixVersions.stable
|
2022-07-31 11:03:59 +02:00
|
|
|
else pkgs.nix;
|
|
|
|
extraOptions = ''
|
|
|
|
experimental-features = nix-command flakes
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|