# The config files in ../../config, put where the programs read them. This # replaces symlink.sh from the old dotfiles repo. { config, lib, pkgs, ... }: let cfg = config.dot; # A file or directory of config/: linked to the checkout when liveConfig is # on (edits apply at once), copied into the store otherwise. link = rel: if cfg.liveConfig then config.lib.file.mkOutOfStoreSymlink "${cfg.repoPath}/config/${rel}" else ../../config + "/${rel}"; # Configs the programs write themselves (GOverlay, btop, micro, apps that # register URL handlers): copied in only when missing, and never overwritten, # so changes made in the app stick. Your existing files in /home win. seeds = { ".config/btop/btop.conf" = "btop/btop.conf"; ".config/MangoHud/MangoHud.conf" = "MangoHud/MangoHud.conf"; ".config/vkBasalt/vkBasalt.conf" = "vkBasalt/vkBasalt.conf"; ".config/vkSumi/vkSumi.conf" = "vkSumi/vkSumi.conf"; ".config/micro/settings.json" = "micro/settings.json"; ".config/micro/bindings.json" = "micro/bindings.json"; ".config/mimeapps.list" = "mimeapps.list"; }; in { xdg.configFile = { "hypr".source = link "hypr"; "waybar".source = link "waybar"; "dunst".source = link "dunst"; "kitty".source = link "kitty"; "fuzzel".source = link "fuzzel"; "nvim".source = link "nvim"; "qt6ct".source = link "qt6ct"; "kdeglobals".source = link "kde/kdeglobals"; "philly/theme.css".source = link "philly/theme.css"; # Kvantum: the active theme is KvArcDark# (your customised copy of KvArcDark, # made with Kvantum Manager; it uses the stock theme's artwork). RiceDark is # the tweaked theme from the old repo, with the stock KvArcDark artwork # copied in under its name, as kvantum/install.sh did. "Kvantum/kvantum.kvconfig".source = link "kvantum/kvantum.kvconfig"; "Kvantum/KvArcDark#/KvArcDark#.kvconfig".source = link "kvantum/KvArcDark#.kvconfig"; "Kvantum/RiceDark/RiceDark.kvconfig".source = link "kvantum/RiceDark.kvconfig"; "Kvantum/RiceDark/RiceDark.svg".source = "${pkgs.kdePackages.qtstyleplugin-kvantum}/share/Kvantum/KvArcDark/KvArcDark.svg"; "micro/colorschemes".source = ../../config/micro/colorschemes; }; home.file.".p10k.zsh".source = link "zsh/p10k.zsh"; home.activation = { seedConfigs = lib.hm.dag.entryAfter [ "writeBoundary" ] ( lib.concatStrings ( lib.mapAttrsToList (target: rel: '' if [ ! -e "$HOME/${target}" ]; then run mkdir -p "$(dirname "$HOME/${target}")" run install -m644 ${../../config + "/${rel}"} "$HOME/${target}" fi '') seeds ) ); # Firefox: user.js and userChrome.css in the default profile, which Firefox # creates itself (Home Manager's own Firefox module would make a new profile # and take over profiles.ini). Same as symlink.sh did. firefoxProfile = lib.hm.dag.entryAfter [ "writeBoundary" ] '' ini="$HOME/.config/mozilla/firefox/profiles.ini" if [ -f "$ini" ]; then profile=$(${pkgs.gawk}/bin/awk -F= ' /^\[Install/ { install = 1; next } /^\[/ { install = 0 } install && $1 == "Default" { print $2; exit } ' "$ini") if [ -n "$profile" ]; then dir="$HOME/.config/mozilla/firefox/$profile" run mkdir -p "$dir/chrome" run ln -sfn ${link "firefox/user.js"} "$dir/user.js" run ln -sfn ${link "firefox/userChrome.css"} "$dir/chrome/userChrome.css" fi else warnEcho "Firefox has no profile yet: start Firefox once, then run home-manager switch (or nixos-rebuild switch) again." fi ''; }; }