great refactor 2

This commit is contained in:
elwrcl committed 2026-07-27 22:12:20 +03:00
1 parent 805f592a26
commit f84fc26666
12 files changed
+428 -176

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./nu.nix
];
}
+69
View File
@@ -0,0 +1,69 @@
{ ... }:
{
programs.nushell = {
enable = true;
shellAliases = {
ls = "eza --icons --group-directories-first";
ll = "eza -lah --icons --group-directories-first";
la = "eza -a --icons --group-directories-first";
lt = "eza --tree --level=2 --icons";
cat = "bat";
df = "df -h";
du = "du -h";
free = "free -h";
rm = "trash-put";
sysinfo = "fastfetch";
monitor = "sudo btop";
ports = "sudo ss -tulpn";
myip = "curl ifconfig.me";
gs = "git status";
ga = "git add";
gp = "git push";
gl = "git log --oneline --graph --decorate";
".." = "cd ..";
"..." = "cd ../..";
"...." = "cd ../../..";
};
environmentVariables = {
MESA_SHADER_CACHE_MAX_SIZE = "2G";
MESA_SHADER_CACHE_DIR = "/tmp/mesa_shader_cache";
};
extraEnv = ''
$env.PATH = ($env.PATH | prepend $"($env.HOME)/.local/bin")
'';
extraConfig = ''
$env.config.show_banner = false
def gc [msg: string] { git commit -m $msg }
def rebuild [] {
git -C ~/copland add -A
git -C ~/copland commit -m "update"
nh os switch
}
def rebuild-dry [] { nh os switch --dry }
def rebuild-cop [] {
nix flake update --flake ~/copland
git -C ~/copland add -A
git -C ~/copland commit -m $"flake update (date now | format date '%Y-%m-%d')"
nh os switch
}
def extract [file: string] {
let ext = ($file | path parse | get extension)
match $ext {
"gz" => { tar xzf $file },
"bz2" => { tar xjf $file },
"tar" => { tar xf $file },
"zip" => { unzip $file },
"7z" => { 7z x $file },
"rar" => { unrar e $file },
_ => { print $"'($file)' can't be extracted" }
}
}
'';
};
}