shrink sc-scripts

This commit is contained in:
Sean Buckley 2021-04-16 12:54:31 -04:00
parent 005102ff74
commit 31b749cd83

View file

@ -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 ]
];
}; };
} }