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_status"
"$hostname"
"$golang"
"direnv"
"$status"
];
right_format = lib.concatStrings [
"$cmd_duration"
];
cmd_duration = {
disabled = false;
show_notifications = true;
min_time = 2000;
format = "[$duration](bold yellow)";
};
directory = {
style = "cyan";
format = ''\[[$path]($style)\] '';
};
direnv = {
disabled = false;
};
git_branch = {
style = "bold cyan";
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 = {
separator = "";
key = {
width = 15;
};
separator = " ";
};
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"
}
];
"break"
"break"
{
type = "os";
key = " OS ";
keyColor = "31";
}
{
type = "kernel";
key = " kernel";
keyColor = "31";
}
{
type = "packages";
key = " 󰏖 packages";
keyColor = "31";
}
{
type = "shell";
key = " shell";
keyColor = "31";
}
"break"
{
type = "wm";
key = " WM ";
keyColor = "32";
}
{
type = "wmtheme";
key = " 󰉼 theme";
keyColor = "32";
}
{
type = "icons";
key = " 󰀻 icons";
keyColor = "32";
}
{
type = "cursor";
key = " cursor";
keyColor = "32";
}
{
type = "terminal";
key = " terminal";
keyColor = "32";
}
{
type = "processes";
key = " processes";
keyColor = "32";
}
"break"
{
type = "host";
format = "{5} {1} Type {2}";
key = " PC ";
keyColor = "33";
}
{
type = "cpu";
format = "{1} ({3}) @ {7} GHz";
key = " cpu";
keyColor = "33";
}
{
type = "gpu";
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 = [
./cli-tools.nix
./fastfetch.nix
];
./direnv.nix
];
# Home Manager needs a bit of information about you and the paths it should
# manage.