2024-12-16 12:55:24 +00:00
|
|
|
{ x, ... }:
|
2024-12-17 12:10:05 +00:00
|
|
|
with x;
|
|
|
|
{
|
2024-11-21 09:24:15 +00:00
|
|
|
programs.fish.functions = {
|
|
|
|
clone.body = ''
|
|
|
|
echo "cd ~/git/"
|
|
|
|
cd $HOME/git
|
|
|
|
git clone $argv && cd $(basename $argv .git)
|
|
|
|
'';
|
|
|
|
# NIX
|
|
|
|
rebuild.body = ''
|
2024-12-03 14:20:37 +00:00
|
|
|
git add --all ${flakeDir}/.
|
2024-11-21 09:24:15 +00:00
|
|
|
for ARG in $argv
|
|
|
|
if [ $ARG = home ]
|
2024-12-03 14:20:37 +00:00
|
|
|
command nh home switch
|
2024-11-21 09:24:15 +00:00
|
|
|
return $status
|
|
|
|
else if [ $ARG = host ]
|
2024-12-03 14:20:37 +00:00
|
|
|
command sudo nh os switch
|
2024-11-21 09:24:15 +00:00
|
|
|
return $status
|
|
|
|
else
|
2024-12-03 14:20:37 +00:00
|
|
|
else if [ $ARG = both ]
|
|
|
|
command nh home switch
|
|
|
|
command sudo nh os switch
|
|
|
|
return $status
|
|
|
|
else
|
|
|
|
command echo "Select 'home' or 'host' os 'both'"
|
2024-11-21 09:24:15 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|