.dotfiles/pkgs/hm-specialisation/default.nix
2024-12-10 22:50:53 +01:00

11 lines
447 B
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
'';
}