add nixos rebuild scripts

This commit is contained in:
Sean Buckley 2021-04-02 18:28:44 -04:00
parent 8c566779be
commit 1d7f360a45

View file

@ -8,6 +8,18 @@ let
"-git-assume-unchanged-size 0"
];
rebuild-scripts = (map
(x: (pkgs.writeShellScriptBin "sc-${builtins.head x}" "nixos-rebuild ${lib.concatStringsSep " " (builtins.tail x)}"))
[
[ "switch" "switch" ]
[ "build" "build" ]
[ "boot" "boot" ]
[ "switch-upgrade" "switch" "--recreate-lock-file" "--refresh" ]
[ "build-upgrade" "build" "--recreate-lock-file" "--refresh" ]
[ "boot-upgrade" "boot" "--recreate-lock-file" "--refresh" ]
]
);
in
{
environment.systemPackages = with pkgs; [
@ -66,7 +78,7 @@ in
echo "$(git ls-remote https://github.com/NixOS/nixpkgs.git "$branch" | cut -f1) latest available"
echo
'')
];
] ++ rebuild-scripts;
environment.variables.EDITOR = "vim";