before git push
This commit is contained in:
parent
d18110a018
commit
07d51c404c
10 changed files with 145 additions and 368 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
pkgs,
|
||||
name,
|
||||
device-name,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
|
|
@ -17,59 +17,72 @@
|
|||
nushell = {
|
||||
enable = true;
|
||||
|
||||
extraConfig = ''
|
||||
if "ZELLIJ" in $env == false {
|
||||
zellij
|
||||
exit
|
||||
} else {
|
||||
if "IN_NIX_SHELL" in $env == false {
|
||||
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 garbage [] {
|
||||
sudo nix-collect-garbage --delete-old
|
||||
sudo nixos-rebuild switch --flake /home/maxag/.nix-config
|
||||
}
|
||||
|
||||
def c [] {
|
||||
clear
|
||||
fastfetch
|
||||
}
|
||||
|
||||
def flake [
|
||||
shell?: string
|
||||
--edit (-e)
|
||||
--command (-c): string
|
||||
] {
|
||||
if $edit {
|
||||
nvim ~/.nix-config/flakes/flake.nix
|
||||
} else {
|
||||
match $command {
|
||||
null => {nix develop $"/home/maxag/.nix-config/flakes/#($shell)"}
|
||||
_ => {nix develop $"/home/maxag/.nix-config/flakes/#($shell)" --command bash -c $"($command)"}
|
||||
def flake [
|
||||
shell?: string
|
||||
--edit (-e)
|
||||
--command (-c): string
|
||||
] {
|
||||
if $edit {
|
||||
nvim ~/.nix-config/flakes/flake.nix
|
||||
} else {
|
||||
match $command {
|
||||
null => {nix develop $"/home/maxag/.nix-config/flakes/#($shell)"}
|
||||
_ => {nix develop $"/home/maxag/.nix-config/flakes/#($shell)" --command bash -c $"($command)"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def edit [file: path] {
|
||||
match ($file | path parse | get extension) {
|
||||
"rs" => {
|
||||
flake rust -c $"nvim ($file)"
|
||||
def edit [file: path] {
|
||||
match ($file | path parse | get extension) {
|
||||
"rs" => {
|
||||
flake rust -c $"nvim ($file)"
|
||||
}
|
||||
"zig" => {
|
||||
flake zig -c $"nvim ($file)"
|
||||
}
|
||||
"c" | "cpp" => {
|
||||
flake c -c $"nvim ($file)"
|
||||
}
|
||||
"cs" => {
|
||||
flake c-sharp -c $"nvim ($file)"
|
||||
}
|
||||
_ => {nvim $file}
|
||||
}
|
||||
"zig" => {
|
||||
flake zig -c $"nvim ($file)"
|
||||
}
|
||||
"c" | "cpp" => {
|
||||
flake c -c $"nvim ($file)"
|
||||
}
|
||||
"cs" => {
|
||||
flake c-sharp -c $"nvim ($file)"
|
||||
}
|
||||
_ => {nvim $file}
|
||||
}
|
||||
}
|
||||
'';
|
||||
|
||||
def rebuild [message?: string] {
|
||||
cd /home/maxag/.nix-config
|
||||
let commit_message = if $message != null {$message} else {"non important commit"}
|
||||
git add .
|
||||
git commit -m $commit_message
|
||||
|
||||
sudo nixos-rebuild switch --flake .
|
||||
}
|
||||
'';
|
||||
|
||||
settings = {
|
||||
show_banner = false;
|
||||
|
|
@ -77,10 +90,9 @@
|
|||
|
||||
shellAliases = {
|
||||
zel = "zellij";
|
||||
rebuild = "sudo nixos-rebuild switch --flake /home/maxag/.nix-config";
|
||||
system = "nvim /home/maxag/.nix-config/flake.nix";
|
||||
home = "nvim /home/maxag/.nix-config/home/${name}/home.nix";
|
||||
config = "nvim /home/maxag/.nix-config/configuration/${name}/configuration.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";
|
||||
nvim = "edit";
|
||||
nix-shell = "nix-shell --run nu";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue