mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
shrink sc-scripts
This commit is contained in:
parent
005102ff74
commit
31b749cd83
1 changed files with 2 additions and 13 deletions
|
@ -1,7 +1,6 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.sconfig.flakes;
|
cfg = config.sconfig.flakes;
|
||||||
upgradeArg = if cfg.rebuildPath == "/etc/nixos" then "--refresh --recreate-lock-file" else "--refresh";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.sconfig.flakes = {
|
options.sconfig.flakes = {
|
||||||
|
@ -21,18 +20,8 @@ in
|
||||||
'';
|
'';
|
||||||
|
|
||||||
environment.systemPackages = map
|
environment.systemPackages = map
|
||||||
(x: (pkgs.writeShellScriptBin
|
(x: (pkgs.writeShellScriptBin "sc-${x}" "nixos-rebuild ${x} --refresh --flake ${cfg.rebuildPath}"))
|
||||||
"sc-${builtins.head x}"
|
[ "switch" "build" "boot" ];
|
||||||
"nixos-rebuild ${lib.concatStringsSep " " (builtins.tail x)} --flake ${cfg.rebuildPath}"
|
|
||||||
))
|
|
||||||
[
|
|
||||||
[ "switch" "switch" ]
|
|
||||||
[ "build" "build" ]
|
|
||||||
[ "boot" "boot" ]
|
|
||||||
[ "switch-upgrade" "switch" upgradeArg ]
|
|
||||||
[ "build-upgrade" "build" upgradeArg ]
|
|
||||||
[ "boot-upgrade" "boot" upgradeArg ]
|
|
||||||
];
|
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue