From 1d7f360a45f4d90bb70d507cfd2e5b50decedcfb Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Fri, 2 Apr 2021 18:28:44 -0400 Subject: [PATCH] add nixos rebuild scripts --- modules/cli.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/cli.nix b/modules/cli.nix index 2b1484f..badb63c 100644 --- a/modules/cli.nix +++ b/modules/cli.nix @@ -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";