non important commit
This commit is contained in:
parent
571702cf8e
commit
02e359e44e
1 changed files with 9 additions and 66 deletions
|
|
@ -5,6 +5,8 @@
|
|||
}: {
|
||||
home.packages = with pkgs; [
|
||||
bat
|
||||
fzf
|
||||
fd
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
|
|
@ -47,61 +49,13 @@
|
|||
fastfetch
|
||||
}
|
||||
|
||||
|
||||
def flake [...command: string] {
|
||||
let git_result = do { git rev-parse --show-toplevel } | complete
|
||||
if $git_result.exit_code != 0 {
|
||||
print "You are not in a git repository"
|
||||
return
|
||||
}
|
||||
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
|
||||
def --env f [] {
|
||||
let dir = (
|
||||
fd --type d --follow --exclude .git
|
||||
| fzf --height 40% --reverse --border
|
||||
)
|
||||
if ($dir != "") {
|
||||
cd $dir
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -130,19 +84,8 @@
|
|||
home = "edit /home/maxag/.nix-config/home/${device-name}/home.nix";
|
||||
config = "edit /home/maxag/.nix-config/configuration/${device-name}/configuration.nix";
|
||||
cat = "bat -p -P";
|
||||
nvim = "edit";
|
||||
nix-shell = "nix-shell --run nu";
|
||||
};
|
||||
};
|
||||
|
||||
zoxide = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
enableNushellIntegration = true;
|
||||
|
||||
options = [
|
||||
"--cmd cd"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue