From 99572e81c003af6b80593bbe74a89caeca2546b1 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Mon, 13 May 2024 20:57:23 -0400 Subject: [PATCH] just recipe improvements --- justfile | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/justfile b/justfile index 7bc8e0b..4b3958f 100644 --- a/justfile +++ b/justfile @@ -1,8 +1,10 @@ +SYSTEM := "$(echo $HOSTNAME)" + default: @just --list # Output what derivations will be built -test TYPE="nix" SYSTEM="desktop": +test SYSTEM TYPE="nix": #!/usr/bin/env bash set -euo pipefail case "{{TYPE}}" in @@ -36,7 +38,7 @@ test TYPE="nix" SYSTEM="desktop": esac # Build the nix expression and hydrate the results directory - pass VM flag to build a VM -build TYPE="nix" SYSTEM="desktop": +build SYSTEM TYPE="nix": #!/usr/bin/env bash set -euo pipefail case "{{TYPE}}" in @@ -85,15 +87,25 @@ build TYPE="nix" SYSTEM="desktop": ;; esac +search PKG: + nix search nixpkgs {{PKG}} + +pkgs: + @xdg-open https://search.nixos.org/packages + +options: + @xdg-open https://search.nixos.org/options + # NixOS-rebuild switch short-hand -up SYSTEM="desktop": - @echo "Switching to next generation" - sudo nixos-rebuild switch --flake .#{{SYSTEM}} +switch BACK: + @echo -e "\033[32m->> Switching to next generation ->>\033[0m" + @sudo nixos-rebuild switch --flake .#{{SYSTEM}} # NixOS-rebuild boot short-hand -boot SYSTEM="desktop": +boot: + @echo -e "\033[34m->> Reboot to new generation ->>\033[0m" @echo "Switching to next generation on reboot" - sudo nixos-rebuild boot --flake .#{{SYSTEM}} + @sudo nixos-rebuild boot --flake .#{{SYSTEM}} # Commit all changes and push to upstream gh MESSAGE: