fastfetch and direnv configured

This commit is contained in:
2024-12-29 10:17:39 -08:00
parent 2909114434
commit 3c2f85ccb0
5 changed files with 245 additions and 76 deletions

View File

@@ -79,14 +79,31 @@
"$git_branch" "$git_branch"
"$git_status" "$git_status"
"$hostname" "$hostname"
"$golang"
"direnv"
"$status" "$status"
]; ];
right_format = lib.concatStrings [
"$cmd_duration"
];
cmd_duration = {
disabled = false;
show_notifications = true;
min_time = 2000;
format = "[$duration](bold yellow)";
};
directory = { directory = {
style = "cyan"; style = "cyan";
format = ''\[[$path]($style)\] ''; format = ''\[[$path]($style)\] '';
}; };
direnv = {
disabled = false;
};
git_branch = { git_branch = {
style = "bold cyan"; style = "bold cyan";
format = ''\[[$symbol$branch(:$remote_branch)]($style)\] ''; format = ''\[[$symbol$branch(:$remote_branch)]($style)\] '';

26
home-manager/direnv.nix Normal file
View File

@@ -0,0 +1,26 @@
{
programs = {
direnv = {
enable = true;
enableZshIntegration = true;
# export_function needed for per directory function/alias with direnv: https://github.com/direnv/direnv/issues/73
stdlib = ''
export_function() {
local name=$1
local alias_dir=$PWD/.direnv/aliases
mkdir -p "$alias_dir"
PATH_add "$alias_dir"
local target="$alias_dir/$name"
if declare -f "$name" >/dev/null; then
echo "#!$SHELL" > "$target"
declare -f "$name" >> "$target" 2>/dev/null
# notice that we add shell variables to the function trigger.
echo "$name \$*" >> "$target"
chmod +x "$target"
fi
}
'';
nix-direnv.enable = true;
};
};
}

View File

@@ -0,0 +1,96 @@
{
programs = {
fastfetch = {
enable = true;
settings = {
logo = {
source = "/etc/nixos/home-manager/commands/fastfetch/assets/image.png";
type = "kitty";
height = 20;
padding = {
top = 2;
left= 3;
};
};
display = {
separator = "";
key = {
width = 15;
};
};
modules = [
{
key = ;
"type": "custom"
},
{
// draw borders first to make colors of left and right border consistant
"key": " \u001b[11D\u001b[31m user",
"type": "title",
"format": "{1}"
},
{
"key": " \u001b[11D\u001b[32m󰇅 hname",
"type": "title",
"format": "{2}"
},
{
"key": " \u001b[11D\u001b[33m󰅐 uptime",
"type": "uptime"
},
{
"key": " \u001b[11D\u001b[34m󰟾 distro",
"type": "os"
},
{
"key": " \u001b[11D\u001b[35m kernel",
"type": "kernel"
},
{
"key": " \u001b[11D\u001b[36m󰇄 desktop",
"type": "de"
},
{
"key": " \u001b[11D\u001b[31m term",
"type": "terminal"
},
{
"key": " \u001b[11D\u001b[32m shell",
"type": "shell"
},
{
"key": " \u001b[11D\u001b[33m󰍛 battery",
"type": "battery"
},
{
"key": " \u001b[11D\u001b[34m󰉉 disk",
"type": "disk",
"folders": "/"
},
{
"key": " \u001b[11D\u001b[35m memory",
"type": "memory"
},
{
"key": " \u001b[11D\u001b[36m󰩟 network",
"type": "localip",
"format": "{1} ({4})"
},
{
"key": "",
"type": "custom"
},
{
"key": " \u001b[11D\u001b[m colors",
"type": "colors",
"symbol": "circle"
},
{
"key": "",
"type": "custom"
}
];
};
};
};
}

View File

@@ -13,83 +13,112 @@
}; };
}; };
display = { display = {
separator = ""; separator = " ";
key = {
width = 15;
};
}; };
modules = [ modules = [
{ "break"
"key": "", "break"
"type": "custom" {
}, type = "os";
{ key = " OS ";
// draw borders first to make colors of left and right border consistant keyColor = "31";
"key": " \u001b[11D\u001b[31m user", }
"type": "title", {
"format": "{1}" type = "kernel";
}, key = " kernel";
{ keyColor = "31";
"key": " \u001b[11D\u001b[32m󰇅 hname", }
"type": "title", {
"format": "{2}" type = "packages";
}, key = " 󰏖 packages";
{ keyColor = "31";
"key": " \u001b[11D\u001b[33m󰅐 uptime", }
"type": "uptime" {
}, type = "shell";
{ key = " shell";
"key": " \u001b[11D\u001b[34m󰟾 distro", keyColor = "31";
"type": "os" }
}, "break"
{ {
"key": " \u001b[11D\u001b[35m kernel", type = "wm";
"type": "kernel" key = " WM ";
}, keyColor = "32";
{ }
"key": " \u001b[11D\u001b[36m󰇄 desktop", {
"type": "de" type = "wmtheme";
}, key = " 󰉼 theme";
{ keyColor = "32";
"key": " \u001b[11D\u001b[31m term", }
"type": "terminal" {
}, type = "icons";
{ key = " 󰀻 icons";
"key": " \u001b[11D\u001b[32m shell", keyColor = "32";
"type": "shell" }
}, {
{ type = "cursor";
"key": " \u001b[11D\u001b[33m󰍛 battery", key = " cursor";
"type": "battery" keyColor = "32";
}, }
{ {
"key": " \u001b[11D\u001b[34m󰉉 disk", type = "terminal";
"type": "disk", key = " terminal";
"folders": "/" keyColor = "32";
}, }
{ {
"key": " \u001b[11D\u001b[35m memory", type = "processes";
"type": "memory" key = " processes";
}, keyColor = "32";
{ }
"key": " \u001b[11D\u001b[36m󰩟 network", "break"
"type": "localip", {
"format": "{1} ({4})" type = "host";
}, format = "{5} {1} Type {2}";
{ key = " PC ";
"key": "", keyColor = "33";
"type": "custom" }
}, {
{ type = "cpu";
"key": " \u001b[11D\u001b[m colors", format = "{1} ({3}) @ {7} GHz";
"type": "colors", key = " cpu";
"symbol": "circle" keyColor = "33";
}, }
{ {
"key": "", type = "gpu";
"type": "custom" format = "{1} {2} @ {12} GHz";
} key = " 󰢮 gpu";
]; keyColor = "33";
}
{
type = "memory";
key = " memory";
keyColor = "33";
}
{
type = "swap";
key = " 󰓡 swap";
keyColor = "33";
}
{
type = "disk";
key = " 󰋊 disk";
keyColor = "33";
}
{
type = "monitor";
key = " monitor";
keyColor = "33";
}
{
type = "battery";
key = " 󰂀 battery";
keyColor = "33";
}
{
type = "localip";
key = " 󰩟 local ip";
keyColor = "33";
}
];
}; };
}; };
}; };

View File

@@ -4,7 +4,8 @@
imports = [ imports = [
./cli-tools.nix ./cli-tools.nix
./fastfetch.nix ./fastfetch.nix
]; ./direnv.nix
];
# Home Manager needs a bit of information about you and the paths it should # Home Manager needs a bit of information about you and the paths it should
# manage. # manage.