1
0
Fork 0
mirror of https://git.sr.ht/~neverness/ultima synced 2025-01-09 09:43:53 +00:00
ultima/modules/home/shells/fish/functions.nix
2024-12-03 23:20:37 +09:00

44 lines
978 B
Nix

{ flakeDir, ... }: {
programs.fish.functions = {
clone.body = ''
echo "cd ~/git/"
cd $HOME/git
git clone $argv && cd $(basename $argv .git)
'';
# NIX
rebuild.body = ''
git add --all ${flakeDir}/.
for ARG in $argv
if [ $ARG = home ]
command nh home switch
return $status
else if [ $ARG = host ]
command sudo nh os switch
return $status
else
else if [ $ARG = both ]
command nh home switch
command sudo nh os switch
return $status
else
command echo "Select 'home' or 'host' os 'both'"
end
end
'';
nrun.body = ''
nix run nixpkgs#$argv
'';
nshell.body = ''
nix shell nixpkgs#$argv
'';
nbuild.body = ''
nix build nixpkgs#$argv
'';
nclean.body = ''
nix-env --delete-generations old
nix-store --gc
nix-collect-garbage -d
'';
};
}