Files
homelab/pkgs/hyprchrome-folders.nix
T
darmanandClaude Opus 5.5 760e353335 feat(titan): Zenbook laptop on a shared workstation profile
terra's desktop is split into profiles/workstation.nix (NixOS side) and
home/desktop/ (home-manager side, moved from hosts/terra/home*), so titan,
an ASUS Zenbook Pro Duo UX581 (Intel iGPU + RTX 2060 PRIME offload),
gets the same Hyprland workstation. Per-host monitors, primary/secondary
output and wallpaper are homelab.desktop.* options; the quickshell widgets
read the outputs from QS_PRIMARY_OUTPUT/QS_SECONDARY_OUTPUT instead of
hardcoding DP-2/HDMI-A-1. Folder icons come from a new HyprChrome-Folders
icon theme.

titan gets its own sops file and recipient. LibreChat is removed from
terra along with its secrets declarations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 11:33:03 +02:00

230 lines
10 KiB
Nix

{ lib, stdenvNoCC, gtk3, baseTheme }:
# HyprChrome folders, drawn as the first artboard of the "HyprChrome Folders"
# design canvas (claude.ai/artifact/W2jmmhXLUzt2isUpGEraB6): 20 folder icons on
# a 32px grid in its two finishes, each shipped as its own theme. Only folders
# are drawn; everything else comes from baseTheme via Inherits=.
let
accent = "#e8722a";
accentHot = "#ff6b4a";
# LIT: accent tab over a selection-grey hull, accent emblems.
# SOLID: accent hull, surface-ink emblems.
themes = {
"HyprChrome-Folders" = acc: {
inherit acc;
tab = acc; hull = "#1a1c1f"; seam = ''stroke="#dedede" stroke-opacity="0.12"'';
ink = acc; sub = ''stroke="#858585"''; hole = "#1a1c1f";
};
"HyprChrome-Folders-Solid" = acc: {
inherit acc;
tab = "#292c30"; hull = acc; seam = ''stroke="#0a0a0a" stroke-opacity="0.35"'';
ink = "#0a0a0a"; sub = ''stroke="#0a0a0a" stroke-opacity="0.5"''; hole = acc;
};
};
bases = {
closed = f: ''
<path d="M3 5 H11.5 L13.5 7 H21 L23 9 V11 H3 Z" fill="${f.tab}" stroke="#0a0a0a" stroke-width="0.8"/>
<path d="M3 10 H25 L29 14 V27 H7 L3 23 Z" fill="${f.hull}" stroke="#0a0a0a" stroke-width="0.8"/>
<path d="M3.6 13 H27.4" ${f.seam} stroke-width="0.8"/>
<path d="M25.9 9.1 H29.9 V13.1 Z M2.1 23.9 V27.9 H6.1 Z" fill="${f.acc}"/>
'';
open = f: ''
<path d="M3 9 H25 L29 13 V27 H7 L3 23 Z" fill="#292c30" stroke="#0a0a0a" stroke-width="0.8"/>
<path d="M3 5 H11.5 L13.5 7 H21 L23 9 V11 H3 Z" fill="${f.tab}" stroke="#0a0a0a" stroke-width="0.8"/>
<path d="M5.25 8.5 H20.5 V24 H5.25 Z" fill="#dedede" stroke="#0a0a0a" stroke-width="0.6"/>
<path d="M7.75 10.6 H16.5" stroke="#858585" stroke-width="0.9"/>
<path d="M3 13 H25 L29 17 V27 H7 L3 23 Z" fill="${f.hull}" stroke="#0a0a0a" stroke-width="0.8"/>
<path d="M3.6 16 H27.4" ${f.seam} stroke-width="0.8"/>
<path d="M25.85 8.15 H29.85 V12.15 Z M2.15 23.85 V27.85 H6.15 Z" fill="${f.acc}"/>
'';
};
# the canvas's k / kf / sb / hl classes
paint = f: {
k = ''fill="none" stroke="${f.ink}"'';
kf = ''fill="${f.ink}"'';
sb = ''fill="none" ${f.sub}'';
hl = ''fill="${f.hole}"'';
};
can = p: ''
<path ${p.k} d="M11.5 16.3 H20.5" stroke-width="1.4"/>
<path ${p.k} d="M14.5 16 V15 H17.5 V16" stroke-width="1"/>
<path ${p.k} d="M12.8 17.8 H19.2 V24.5 H13.8 L12.8 23.5 Z" stroke-width="1.2"/>
'';
emblems = {
none = p: "";
homelab = p: ''
<path ${p.k} d="M11.5 15 H20.5 V24.5 H11.5 Z" stroke-width="1.2"/>
<path ${p.k} d="M11.5 18.2 H20.5 M11.5 21.4 H20.5" stroke-width="1"/>
<rect ${p.kf} x="12.8" y="16" width="1.6" height="1.3"/>
<rect ${p.kf} x="12.8" y="19.2" width="1.6" height="1.3"/>
<rect ${p.kf} x="12.8" y="22.4" width="1.6" height="1.3"/>
<path ${p.sb} d="M15.6 16.6 H19.2 M15.6 19.8 H19.2 M15.6 23 H17.4" stroke-width="0.9"/>
'';
home = p: ''
<path ${p.k} d="M11.5 19.5 L16 15 L20.5 19.5 M13 18 V24 H19 V18" stroke-width="1.3"/>
<rect ${p.kf} x="15.1" y="21" width="1.8" height="3"/>
'';
desktop = p: ''
<path ${p.k} d="M11.5 15.5 H20.5 V21.5 H11.5 Z" stroke-width="1.2"/>
<path ${p.k} d="M16 21.5 V23.5 M13.5 24 H18.5" stroke-width="1.2"/>
<path ${p.sb} d="M13 17.3 H16.5" stroke-width="0.9"/>
<rect ${p.kf} x="17.6" y="18.4" width="1.6" height="1.6"/>
'';
documents = p: ''
<path ${p.k} d="M12.5 15 H18 L20 17 V24.5 H12.5 Z" stroke-width="1.2"/>
<path ${p.sb} d="M14.3 19 H18.2 M14.3 21 H18.2 M14.3 23 H16.5" stroke-width="0.9"/>
'';
download = p: ''
<path ${p.k} d="M16 15 V21.5 M13 18.8 L16 21.8 L19 18.8" stroke-width="1.4"/>
<rect ${p.kf} x="12.5" y="23" width="7" height="1.4"/>
'';
music = p: ''
<path ${p.k} d="M14.3 17.2 L19.3 15.7 V22 M14.3 17.2 V23.5" stroke-width="1.2"/>
<rect ${p.kf} x="11.9" y="22.5" width="2.8" height="2"/>
<rect ${p.kf} x="16.9" y="21" width="2.8" height="2"/>
'';
pictures = p: ''
<path ${p.k} d="M11.5 15.5 H20.5 V23.5 H11.5 Z" stroke-width="1.2"/>
<path ${p.sb} d="M12.3 22.7 L15 19.5 L17 21.5 L18.2 20.3 L19.7 21.8" stroke-width="1"/>
<rect ${p.kf} x="17.6" y="17" width="1.6" height="1.6"/>
'';
videos = p: ''
<path ${p.k} d="M11.5 15.5 H20.5 V23.5 H11.5 Z" stroke-width="1.2"/>
<path ${p.kf} d="M14.6 17.3 V21.7 L18.4 19.5 Z"/>
<path ${p.sb} d="M12.6 17 V22 M19.4 17 V22" stroke-width="0.8" stroke-dasharray="1 1"/>
'';
templates = p: ''
<path ${p.k} d="M12.5 15 H18 L20 17 V24.5 H12.5 Z" stroke-width="1.1" stroke-dasharray="1.4 1"/>
<rect ${p.kf} x="14.3" y="18.6" width="3.6" height="1.3"/>
<path ${p.sb} d="M14.3 21.6 H18.2" stroke-width="0.9"/>
'';
publicshare = p: ''
<path ${p.sb} d="M13.2 19.7 L19 16.2 M13.2 19.7 L19 23.2" stroke-width="1"/>
<rect ${p.kf} x="12" y="18.5" width="2.4" height="2.4"/>
<rect ${p.kf} x="17.8" y="15" width="2.4" height="2.4"/>
<rect ${p.kf} x="17.8" y="22" width="2.4" height="2.4"/>
'';
git = p: ''
<path ${p.k} d="M13 16 V23.6 M19 16 V17.5 L13.5 23" stroke-width="1.3"/>
<rect ${p.kf} x="11.8" y="14.8" width="2.4" height="2.4"/>
<rect ${p.kf} x="11.8" y="22.6" width="2.4" height="2.4"/>
<rect ${p.kf} x="17.8" y="14.8" width="2.4" height="2.4"/>
'';
projects = p: ''
<path ${p.k} d="M12 16.5 L15 19.5 L12 22.5" stroke-width="1.5"/>
<rect ${p.kf} x="16" y="21.8" width="4.5" height="1.5"/>
'';
remote = p: ''
<path ${p.sb} d="M11.5 20.5 H14.5 V23.5 H11.5 Z M17.5 15.5 H20.5 V18.5 H17.5 Z" stroke-width="1"/>
<path ${p.k} d="M14.5 22 H15.5 L19 18.5" stroke-width="1.3"/>
<rect ${p.kf} x="12.4" y="21.4" width="1.2" height="1.2"/>
<rect ${p.kf} x="18.4" y="16.4" width="1.2" height="1.2"/>
'';
saved-search = p: ''
<path ${p.k} d="M14 15 H17 L18.5 16.5 V19.5 L17 21 H14 L12.5 19.5 V16.5 Z" stroke-width="1.3"/>
<path ${p.k} d="M18 20.5 L20.5 23" stroke-width="2"/>
'';
locked = p: ''
<path ${p.k} d="M14 19 V16.6 L15 15.6 H17 L18 16.6 V19" stroke-width="1.3"/>
<rect ${p.kf} x="12.5" y="19" width="7" height="5.5"/>
<rect ${p.hl} x="15.5" y="20.8" width="1" height="2"/>
'';
important = p: ''
<path ${p.k} d="M16 15 L20.5 23.5 H11.5 Z" stroke-width="1.3" stroke-linejoin="miter"/>
<rect ${p.kf} x="15.4" y="18.2" width="1.2" height="2.8"/>
<rect ${p.kf} x="15.4" y="21.7" width="1.2" height="1.1"/>
'';
trash = p: can p + ''
<path ${p.sb} d="M15 19.3 V23 M17 19.3 V23" stroke-width="0.9"/>
'';
trash-full = p: can p + ''
<rect ${p.kf} x="14.2" y="19.2" width="1.4" height="3.9"/>
<rect ${p.kf} x="16.4" y="19.2" width="1.4" height="3.9"/>
'';
};
# aliases: the other names apps (and baseTheme) use for the same folder, so
# those don't fall through to baseTheme's own drawing.
icons = {
folder = { emblem = "none"; aliases = [ "inode-directory" "gtk-directory" "gnome-fs-directory" "gnome-folder" "stock_folder" ]; };
folder-open = { base = "open"; emblem = "none"; aliases = [ "folder-drag-accept" "folder-visiting" "gnome-fs-directory-accept" ]; };
folder-homelab = { emblem = "homelab"; };
user-home = { emblem = "home"; aliases = [ "folder-home" "folder_home" "gnome-fs-home" ]; };
user-desktop = { emblem = "desktop"; aliases = [ "folder-desktop" "gnome-fs-desktop" ]; };
folder-documents = { emblem = "documents"; };
folder-download = { emblem = "download"; aliases = [ "folder-downloads" ]; };
folder-music = { emblem = "music"; };
folder-pictures = { emblem = "pictures"; aliases = [ "folder-images" "folder-image" "folder-picture" ]; };
folder-videos = { emblem = "videos"; aliases = [ "folder-video" ]; };
folder-templates = { emblem = "templates"; };
folder-publicshare = { emblem = "publicshare"; aliases = [ "folder-public" ]; };
folder-git = { emblem = "git"; };
folder-projects = { emblem = "projects"; aliases = [ "folder-development" ]; };
folder-remote = { emblem = "remote"; aliases = [ "folder-network" ]; };
folder-saved-search = { emblem = "saved-search"; };
folder-locked = { emblem = "locked"; aliases = [ "folder-encrypted" ]; };
folder-important = { emblem = "important"; hot = true; };
user-trash = { emblem = "trash"; aliases = [ "trash-empty" "gnome-fs-trash-empty" ]; };
user-trash-full = { emblem = "trash-full"; aliases = [ "gnome-fs-trash-full" ]; };
};
svg = finish: name: { emblem, base ? "closed", hot ? false, ... }:
let f = finish (if hot then accentHot else accent); in
builtins.toFile "${name}.svg" ''
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
${bases.${base} f}${emblems.${emblem} (paint f)}</svg>
'';
buildTheme = theme: finish: ''
dir="$out/share/icons/${theme}"
mkdir -p "$dir/places/scalable"
cat > "$dir/index.theme" <<EOF
[Icon Theme]
Name=${theme}
Comment=HyprChrome folders for terra, over ${baseTheme}
Inherits=${baseTheme},hicolor
Directories=places/scalable
[places/scalable]
Context=Places
Size=32
MinSize=16
MaxSize=512
Type=Scalable
EOF
${lib.concatStrings (lib.mapAttrsToList (name: icon: ''
cp ${svg finish name icon} "$dir/places/scalable/${name}.svg"
${lib.concatMapStrings (a: "ln -s ${name}.svg \"$dir/places/scalable/${a}.svg\"\n") (icon.aliases or [ ])}
'') icons)}
gtk-update-icon-cache --force "$dir"
'';
in
stdenvNoCC.mkDerivation {
pname = "hyprchrome-folders";
version = "0.1";
dontUnpack = true;
nativeBuildInputs = [ gtk3 ];
# gtk3's setup hook strips icon-theme.cache from $out by default
dontDropIconThemeCache = true;
installPhase = ''
runHook preInstall
${lib.concatStrings (lib.mapAttrsToList buildTheme themes)}
runHook postInstall
'';
meta = {
description = "HyprChrome folder icon themes (lit + solid finishes)";
platforms = lib.platforms.all;
};
}