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, ... }:
|
||||
let
|
||||
cfg = config.sconfig.flakes;
|
||||
upgradeArg = if cfg.rebuildPath == "/etc/nixos" then "--refresh --recreate-lock-file" else "--refresh";
|
||||
in
|
||||
{
|
||||
options.sconfig.flakes = {
|
||||
|
@ -21,18 +20,8 @@ in
|
|||
'';
|
||||
|
||||
environment.systemPackages = map
|
||||
(x: (pkgs.writeShellScriptBin
|
||||
"sc-${builtins.head x}"
|
||||
"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 ]
|
||||
];
|
||||
(x: (pkgs.writeShellScriptBin "sc-${x}" "nixos-rebuild ${x} --refresh --flake ${cfg.rebuildPath}"))
|
||||
[ "switch" "build" "boot" ];
|
||||
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue