diff --git a/SwarselSystems.org b/SwarselSystems.org index ce02a6b..02b329f 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -1512,6 +1512,7 @@ This is the central station for self-defined packages. These are all referenced { pass-fuzzel = callPackage ./pass-fuzzel { }; cura5 = callPackage ./cura5 { }; + hm-specialisation = callPackage ./hm-specialisation { }; cdw = callPackage ./cdw { }; cdb = callPackage ./cdb { }; bak = callPackage ./bak { }; @@ -1640,6 +1641,27 @@ The version of =cura= used to be quite outdated in nixpkgs. I am fetching a newe #+end_src +**** hm-specialisation + +This script allows for quick git home-manager specialisation switching. + + +#+begin_src nix :tangle pkgs/hm-specialisation/default.nix + { writeShellApplication, fzf, findutils, home-manager }: + + writeShellApplication { + name = "hm-specialisation"; + runtimeInputs = [ fzf findutils home-manager ]; + text = '' + genpath=$(home-manager generations | head -1 | awk '{print $7}') + dirs=$(find "$genpath/specialisation" -type l 2>/dev/null; [ -d "$genpath" ] && echo "$genpath") + "$(echo "$dirs" | fzf --prompt="Choose home-manager specialisation to activate")"/activate + ''; + } + + +#+end_src + **** cdw :PROPERTIES: :CUSTOM_ID: h:73b14c7a-5444-4fed-b7ac-d65542cdeda3 @@ -6317,6 +6339,7 @@ This holds packages that I can use as provided, or with small modifications (as nh nix-output-monitor hyprpicker # color picker + findutils # nix alejandra @@ -6473,6 +6496,7 @@ This is just a separate container for derivations defined in [[#h:64a5cc16-6b16- update-checker github-notifications screenshare + hm-specialisation (pkgs.writeScriptBin "project" '' #! ${pkgs.bash}/bin/bash diff --git a/pkgs/default.nix b/pkgs/default.nix index 316b23d..14fba08 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -5,6 +5,7 @@ in { pass-fuzzel = callPackage ./pass-fuzzel { }; cura5 = callPackage ./cura5 { }; + hm-specialisation = callPackage ./hm-specialisation { }; cdw = callPackage ./cdw { }; cdb = callPackage ./cdb { }; bak = callPackage ./bak { }; diff --git a/pkgs/hm-specialisation/default.nix b/pkgs/hm-specialisation/default.nix new file mode 100644 index 0000000..83ed443 --- /dev/null +++ b/pkgs/hm-specialisation/default.nix @@ -0,0 +1,11 @@ +{ writeShellApplication, fzf, findutils, home-manager }: + +writeShellApplication { + name = "hm-specialisation"; + runtimeInputs = [ fzf findutils home-manager ]; + text = '' + genpath=$(home-manager generations | head -1 | awk '{print $7}') + dirs=$(find "$genpath/specialisation" -type l 2>/dev/null; [ -d "$genpath" ] && echo "$genpath") + "$(echo "$dirs" | fzf --prompt="Choose home-manager specialisation to activate")"/activate + ''; +} diff --git a/profiles/common/home/custom-packages.nix b/profiles/common/home/custom-packages.nix index 69c10ae..4fac240 100644 --- a/profiles/common/home/custom-packages.nix +++ b/profiles/common/home/custom-packages.nix @@ -16,6 +16,7 @@ update-checker github-notifications screenshare + hm-specialisation (pkgs.writeScriptBin "project" '' #! ${pkgs.bash}/bin/bash diff --git a/profiles/common/home/packages.nix b/profiles/common/home/packages.nix index fd15ebf..b6cc5f1 100644 --- a/profiles/common/home/packages.nix +++ b/profiles/common/home/packages.nix @@ -29,6 +29,7 @@ nh nix-output-monitor hyprpicker # color picker + findutils # nix alejandra