From 7ccc041397dc7bc25bcbcf37a4133d0da9d9a5ab Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 14 Dec 2023 13:19:34 -0800 Subject: use devshell to build / switch the configuration --- bin/update.sh | 21 --------------------- flake/devshell.nix | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 21 deletions(-) delete mode 100755 bin/update.sh diff --git a/bin/update.sh b/bin/update.sh deleted file mode 100755 index 1593716..0000000 --- a/bin/update.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -e - -GREEN='\033[1;32m' -CLEAR='\033[0m' - -export NIXPKGS_ALLOW_UNFREE=1 - -# Navigate to the directory of this script -cd "$(dirname "$(readlink -f "$0")")" -cd .. - -echo "${GREEN}Starting build...${CLEAR}" -nix --experimental-features 'nix-command flakes' build .#darwinConfigurations."$(hostname -s)".system "$@" - -echo "${GREEN}Switching to new generation...${CLEAR}" -./result/sw/bin/darwin-rebuild switch --flake .# "$@" - -echo "${GREEN}Cleaning up...${CLEAR}" -unlink ./result - -echo "${GREEN}Done${CLEAR}" diff --git a/flake/devshell.nix b/flake/devshell.nix index 6e1d40e..8124ed4 100644 --- a/flake/devshell.nix +++ b/flake/devshell.nix @@ -24,6 +24,24 @@ commands = [ { package = config.treefmt.build.wrapper; } + { + name = "update"; + help = "Update + Commit the Lock File"; + command = "nix flake update --commit-lock-file"; + category = "nix"; + } + { + name = "build-darwin"; + category = "darwin"; + help = "Build the current darwin configuration"; + command = "darwin-rebuild build --flake .#"; + } + { + name = "switch-darwin"; + category = "darwin"; + help = "Switch to the current darwin configuration"; + command = "darwin-rebuild switch --flake .#"; + } ]; }; -- cgit v1.2.3