non important commit

This commit is contained in:
maxstrb 2025-11-06 14:54:27 +01:00
parent 571702cf8e
commit 02e359e44e

View file

@ -5,6 +5,8 @@
}: { }: {
home.packages = with pkgs; [ home.packages = with pkgs; [
bat bat
fzf
fd
]; ];
home.sessionVariables = { home.sessionVariables = {
@ -47,61 +49,13 @@
fastfetch fastfetch
} }
def --env f [] {
def flake [...command: string] { let dir = (
let git_result = do { git rev-parse --show-toplevel } | complete fd --type d --follow --exclude .git
if $git_result.exit_code != 0 { | fzf --height 40% --reverse --border
print "You are not in a git repository" )
return if ($dir != "") {
} cd $dir
let root = $git_result.stdout | str trim
let flake_path = $root | path join "flake.nix"
if not ($flake_path | path exists) {
print "There is no flake in this repository"
return
}
let dev_check = do { nix develop $root --command true } | complete
if $dev_check.exit_code == 0 {
if ($command | is-empty) {
nix develop $root
} else {
nix develop $root --command ...$command
}
} else {
print "This flake doesn't have a default shell"
}
}
def edit [user_file?: path] {
let file = if ($user_file | is-empty) {
pwd
} else {
$user_file
}
let git_result = do { git rev-parse --show-toplevel } | complete
if $git_result.exit_code != 0 {
nvim $file
return
}
let root = $git_result.stdout | str trim
let flake_path = $root | path join "flake.nix"
if not ($flake_path | path exists) {
nvim $file
return
}
let dev_check = do { nix develop $root --command true } | complete
if $dev_check.exit_code == 0 {
if ($user_file | is-empty) {
nix develop $root --command nvim
} else {
nix develop $root --command nvim $file
}
} else {
nvim $file
} }
} }
@ -130,19 +84,8 @@
home = "edit /home/maxag/.nix-config/home/${device-name}/home.nix"; home = "edit /home/maxag/.nix-config/home/${device-name}/home.nix";
config = "edit /home/maxag/.nix-config/configuration/${device-name}/configuration.nix"; config = "edit /home/maxag/.nix-config/configuration/${device-name}/configuration.nix";
cat = "bat -p -P"; cat = "bat -p -P";
nvim = "edit";
nix-shell = "nix-shell --run nu"; nix-shell = "nix-shell --run nu";
}; };
}; };
zoxide = {
enable = true;
enableBashIntegration = true;
enableNushellIntegration = true;
options = [
"--cmd cd"
];
};
}; };
} }