mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
27 lines
666 B
Nix
27 lines
666 B
Nix
{ config, pkgs, lib, ... }:
|
|
let
|
|
cfg = config.sconfig.flakes;
|
|
in
|
|
{
|
|
options.sconfig.flakes = {
|
|
enable = lib.mkEnableOption "Enable Flakes";
|
|
rebuildPath = lib.mkOption {
|
|
default = "/etc/nixos";
|
|
type = lib.types.str;
|
|
description = "Flake to use when running nixos-rebuild helper scripts";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
nix.package = pkgs.nixFlakes;
|
|
nix.extraOptions = ''
|
|
experimental-features = nix-command flakes
|
|
'';
|
|
|
|
environment.systemPackages = map
|
|
(x: (pkgs.writeShellScriptBin "sc-${x}" "nixos-rebuild ${x} --refresh --flake ${cfg.rebuildPath}"))
|
|
[ "switch" "build" "boot" ];
|
|
|
|
};
|
|
}
|