From f70a139bd7e9ba1d197c4b8e5ca0da8917e15f07 Mon Sep 17 00:00:00 2001 From: Purin <118902463+Dylouwu@users.noreply.github.com> Date: Mon, 25 Aug 2025 15:12:35 +0200 Subject: [PATCH] changed nixy from having an upgrade to a test option This allows you to test the configuration without building it, where as upgrade is useless with flakes (and can be confusing with update) Signed-off-by: Purin <118902463+Dylouwu@users.noreply.github.com> --- home/scripts/nixy/default.nix | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/home/scripts/nixy/default.nix b/home/scripts/nixy/default.nix index 884cdbc..b51aec8 100644 --- a/home/scripts/nixy/default.nix +++ b/home/scripts/nixy/default.nix @@ -1,20 +1,15 @@ # - ## Nixy #- -#- Nixy is a simple script that I use to manage my NixOS system. It's a simple script that provides a menu to rebuild, upgrade, update, collect garbage, clean boot menu, etc. +#- Nixy is a simple script that I use to manage my NixOS system. It's a simple script that provides a menu to rebuild, test, update, collect garbage, clean boot menu, etc. #- #- - `nixy` - UI wizard to manage the system. #- - `nixy rebuild` - Rebuild the system. #- - `nixy ...` - ... see the script for more commands. -{ - pkgs, - config, - ... -}: let +{ pkgs, config, ... }: +let configDirectory = config.var.configDirectory; - hostname = config.var.hostname; - nixy = - pkgs.writeShellScriptBin "nixy" + nixy = pkgs.writeShellScriptBin "nixy" # bash '' function exec() { @@ -27,7 +22,7 @@ # "icon;name;command"[] apps=( "󰑓;Rebuild;nixy rebuild" - "󰦗;Upgrade;nixy upgrade" + "󰐊;Test;nixy test" "󰚰;Update;nixy update" ";Collect Garbage;nixy gc" "󰍜;Clean Boot Menu;nixy cb" @@ -54,10 +49,9 @@ [[ $1 == "" ]] && ui if [[ $1 == "rebuild" ]];then - cd ${configDirectory} && git add . - sudo nixos-rebuild switch --flake ${configDirectory}#${hostname} - elif [[ $1 == "upgrade" ]];then - sudo nixos-rebuild switch --upgrade --flake '${configDirectory}#${hostname}' + cd ${configDirectory} && git add . && sudo nixos-rebuild switch --flake + elif [[ $1 == "test" ]];then + cd ${configDirectory} && git add . && sudo nixos-rebuild test --flake elif [[ $1 == "update" ]];then cd ${configDirectory} && nix flake update elif [[ $1 == "gc" ]];then @@ -71,4 +65,4 @@ echo "Unknown argument" fi ''; -in {home.packages = [nixy];} +in { home.packages = [ nixy ]; }