diff --git a/modules/minimal.nix b/modules/minimal.nix index dd489be..045276b 100644 --- a/modules/minimal.nix +++ b/modules/minimal.nix @@ -10,6 +10,7 @@ [ ./hardware-configuration.nix ./zsh.nix + #./ncli.nix #./neovim.nix ./packages.nix ]; diff --git a/modules/ncli.nix b/modules/ncli.nix index 8541643..c7a7ff4 100644 --- a/modules/ncli.nix +++ b/modules/ncli.nix @@ -181,7 +181,7 @@ in echo "✓ Update and rebuild finished successfully for $HOST" if [ -n "$current" ]; then - sudo /run/current-system/specialisation/$current/bin/switch-to-configuration switch + sudo /run/current-system/specialisation/$current/bin/switch-to-configuration test else echo "No specialization tag found, staying on default system." fi @@ -210,6 +210,41 @@ in git add -A && git commit -m "$commit_msg" ;; + home-backups) + ls -a ~ | grep backup + ;; + switch) + current="" + if [ -f /etc/nixos-tags ]; then + current=$(cat /etc/nixos-tags) + fi + + if [ "$#" -ge 2 ]; then + spec_name="$2" + if [ -n "$current" ]; then + echo "Already on specialization: $current. Cannot switch directly to '$spec_name'. Please reboot or return to default first." + else + if [ -d "/run/current-system/specialisation/$spec_name" ]; then + echo "Switching to specialization: $spec_name" + sudo /run/current-system/specialisation/$spec_name/bin/switch-to-configuration test + else + echo "Error: Specialization '$spec_name' not found." + echo "Available specializations:" + ls /run/current-system/specialisation/ + fi + fi + else + if [ -n "$current" ]; then + echo "Already on a specialization: $current. To switch, please reboot, or use 'sudo nixos-rebuild switch --flake .' to get back to default, and then switch after." + else + specs=$(ls /run/current-system/specialisation/) + echo "Specializations available:" + echo "$specs" + echo "" + echo "To switch to a specialization, run: 'ncli switch '" + fi + fi + ;; push) cd "$HOME/$PROJECT" || { echo "Error: Could not change to $HOME/$PROJECT"; exit 1; } git push origin $(git branch --show-current) diff --git a/modules/packages.nix b/modules/packages.nix index 54d772f..039de4c 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -54,6 +54,7 @@ sqlite #Desktop Applications + jetbrains.datagrip ryubing vlc #steam