104 lines
2.3 KiB
Nix
104 lines
2.3 KiB
Nix
{
|
|
pkgs,
|
|
device-name,
|
|
...
|
|
}: {
|
|
home.packages = with pkgs; [
|
|
bat
|
|
fzf
|
|
fd
|
|
eza
|
|
];
|
|
|
|
home.sessionVariables = {
|
|
EDITOR = "nvim";
|
|
};
|
|
|
|
programs = {
|
|
bash.enable = true;
|
|
fzf.enable = true;
|
|
eza.enable = true;
|
|
|
|
direnv = {
|
|
enable = true;
|
|
silent = true;
|
|
nix-direnv .enable = true;
|
|
};
|
|
|
|
nushell = {
|
|
enable = true;
|
|
|
|
extraConfig =
|
|
/*
|
|
nu
|
|
*/
|
|
''
|
|
if "ZELLIJ" in $env == false {
|
|
zellij
|
|
exit
|
|
} else {
|
|
if "IN_NIX_SHELL" in $env == false {
|
|
fastfetch
|
|
}
|
|
}
|
|
|
|
def garbage [] {
|
|
sudo nix-collect-garbage --delete-old
|
|
sudo nixos-rebuild switch --flake /home/maxag/.nix-config
|
|
}
|
|
|
|
def c [] {
|
|
clear
|
|
fastfetch
|
|
}
|
|
|
|
def rebuild [message?: string] {
|
|
cd /home/maxag/.nix-config
|
|
let commit_message = if $message != null {$message} else {"non important commit"}
|
|
|
|
try {
|
|
git pull
|
|
git add .
|
|
git commit -m $commit_message
|
|
git push
|
|
}
|
|
|
|
sudo nixos-rebuild switch --flake .
|
|
}
|
|
|
|
def --env fzf-cd [] {
|
|
let dir = (fd -t d -L . | fzf --reverse --height 40% --border rounded --preview=("eza --color=always --group-directories-first --icons --long {}") --preview-window=border-left)
|
|
if $dir != null and $dir != "" {
|
|
cd $dir
|
|
}
|
|
}
|
|
|
|
$env.config.keybindings = ($env.config.keybindings | append {
|
|
name: "fzf-cd"
|
|
modifier: "control"
|
|
keycode: "char_f"
|
|
mode: "emacs"
|
|
event: [
|
|
{
|
|
send: "executehostcommand"
|
|
cmd: 'fzf-cd'
|
|
}
|
|
]
|
|
})
|
|
'';
|
|
|
|
settings = {
|
|
show_banner = false;
|
|
};
|
|
|
|
shellAliases = {
|
|
zel = "zellij";
|
|
system = "nvim /home/maxag/.nix-config/flake.nix";
|
|
home = "nvim /home/maxag/.nix-config/home/${device-name}/home.nix";
|
|
config = "nvim /home/maxag/.nix-config/configuration/${device-name}/configuration.nix";
|
|
cat = "bat -p -P";
|
|
nix-shell = "nix-shell --run nu";
|
|
};
|
|
};
|
|
};
|
|
}
|