{ config, lib, pkgs, ... }: # TODO: Plasma does not see home manager installed packages let username = "becky"; homedir = "/home/${username}"; zshSourceDirs = [ ./zsh/dingleberry ]; in { # Breaks SDDM # targets.genericLinux.enable = true; # Enable XDG for non terminal apps # https://github.com/nix-community/home-manager/issues/1439 programs.bash.enable = true; xdg = { enable = true; mime = { enable = true; }; mimeApps = { defaultApplications = { "inode/directory" = "org.kde.krusader.desktop"; "model/3mf" = "org.supermaker.superslicer.desktop"; "x-scheme-handler/geo" = "google-maps-geo-handler.desktop"; "x-scheme-handler/http" = "userapp-Firefox-5T0SK2.desktop"; "x-scheme-handler/https" = "userapp-Firefox-5T0SK2.desktop"; "x-scheme-handler/mailto" = "thunderbird.desktop"; "x-scheme-handler/slack" = "slack.desktop"; "x-scheme-handler/tel" = "org.kde.kdeconnect.handler.desktop"; "x-scheme-handler/tg" = "org.telegram.desktop._18faa92ddda377ceaa5a576303af9e59.desktop"; "x-scheme-handler/chrome" = "userapp-Firefox-5T0SK2.desktop"; "text/html" = "userapp-Firefox-5T0SK2.desktop"; "application/x-extension-htm" = "userapp-Firefox-5T0SK2.desktop"; "application/x-extension-html" = "userapp-Firefox-5T0SK2.desktop"; "application/x-extension-shtml" = "userapp-Firefox-5T0SK2.desktop"; "application/xhtml+xml" = "userapp-Firefox-5T0SK2.desktop"; "application/x-extension-xhtml" = "userapp-Firefox-5T0SK2.desktop"; "application/x-extension-xht" = "userapp-Firefox-5T0SK2.desktop"; }; enable = true; }; # portal = { # enable = true; # }; }; nixGL.packages = pkgs.nixgl; nixGL.defaultWrapper = "nvidia"; home.username = username; home.homeDirectory = homedir; home.stateVersion = "24.11"; home.packages = with pkgs; [ nixd # TODO: Move from system to nix # awscli2 # k9s # kubectl # Terminal image viewer viu ]; xdg.configFile = lib.mkMerge [ { "ghostty/config" = { text = '' font-size = 10 theme = catppuccin-mocha window-height = 9999 window-width = 9999 ''; }; } ]; # TODO: Manual ghostty injection programs.bat.syntaxes.ghostty = { src = pkgs.ghostty; file = "share/bat/syntaxes/ghostty.sublime-syntax"; }; programs.vim.plugins = lib.mkMerge [ pkgs.ghostty.vim ]; programs.direnv = { enable = true; nix-direnv.enable = true; }; programs.git = { enable = true; userName = "Arnie"; userEmail = "i@cechis.cz"; ignores = [ ".vscode" ".direnv" ".devenv" ".envrc" ]; extraConfig = { core = { autocrlf = "input"; # TODO: Provide through nix hooksPath = "~/.git/hooks"; editor = "vim"; }; pull.rebase = false; init.defaultBranch = "main"; }; }; # Can't use the nixgl wrapper due to GTK libraries # programs.ghostty = { # enable = true; # installBatSyntax = true; # installVimSyntax = true; # enableZshIntegration = true; # package = config.lib.nixGL.wrap pkgs.ghostty; # settings = { # theme = "catppuccin-mocha"; # font-size = 10; # window-width = 9999; # window-height = 9999; # keybind = [ ]; # }; # }; programs.htop = { enable = true; }; programs.jq = { enable = true; }; programs.k9s = { enable = true; settings = { k9s = { refreshRate = 2; ui = { logoless = true; headless = true; }; logger = { tail = 1000; sinceSeconds = 60 * 30; fullScreen = true; showtime = true; }; }; }; }; programs.lsd = { enable = true; enableAliases = true; settings = { blocks = [ "permission" "user" "group" "size" "date" "git" "name" ]; sorting = { dir-grouping = "first"; }; }; }; programs.mcfly = { enable = true; enableZshIntegration = true; keyScheme = "vim"; # TODO: Test fuzzySearchFactor = 2; settings = { colors = { menubar = { bg = "black"; fg = "red"; }; darkmode = { prompt = "cyan"; timing = "yellow"; }; }; }; }; programs.pay-respects = { enable = true; enableZshIntegration = true; }; # TODO: Configure # programs.ssh = { # enable = true; # }; programs.zsh = { enable = true; shellAliases = { hm-switch = "home-manager switch --impure --flake ~/.config/nix"; configure-ssh-terminfo = "f(){ infocmp -x | ssh \"$@\" -- tic -x -; unset -f f; }; f"; }; dirHashes = { mac = "${homedir}/storage/.macshare"; nix = "${homedir}/.config/nix"; circuitry = "${homedir}/storage/.circuitry"; dev = "${homedir}/storage/.devstack"; ai = "${homedir}/storage/.devstack/ai"; life = "${homedir}/storage/.life"; vysokyujezd = "${homedir}/storage/.life/stavby/vysoky-ujezd"; work = "/mnt/yosuke/share/arnie/work"; smarthome = "/mnt/yosuke/share/arnie/smarthome"; # Hardware v2-red = "${homedir}/storage/.hardware/3d-print/v2-red-V2-2201270017"; "3dprint" = "${homedir}/storage/.hardware/3d-print"; # Development projects = "${homedir}/storage/.devstack/projects"; yp = "${homedir}/storage/.devstack/projects/yp"; ys = "${homedir}/storage/.devstack/projects/ys"; investbay = "${homedir}/storage/.devstack/projects/investbay"; resource = "${homedir}/storage/.devstack/resource"; cechis = "${homedir}/storage/.devstack/projects/dev.cechis.cz"; gh = "${homedir}/storage/.devstack/projects/github/Sharsie"; rpi = "${homedir}/storage/.devstack/projects/hardware/rpi"; c4 = "/mnt/yosuke/share/arnie/smarthome/control4/drivers"; }; initExtra = '' ${builtins.concatStringsSep "\n" ( builtins.map (dir: '' for file in ${dir}/*.zsh; do source "$file" done '') zshSourceDirs )} autoload -U +X bashcompinit && bashcompinit source <(kubectl completion zsh) complete -C '/usr/local/bin/aws_completer' aws # Manual ghostty injection if [[ -n $GHOSTTY_RESOURCES_DIR ]]; then source "$GHOSTTY_RESOURCES_DIR"/shell-integration/zsh/ghostty-integration fi ''; }; systemd.user.services.keepass-sync = { Unit.Description = "Sync KeePass database"; Service = { Type = "oneshot"; ExecStart = toString ( pkgs.writeShellScript "keepass-sync" '' ${pkgs.coreutils}/bin/cp "/mnt/storage/.circuitry/.secret/default.kdbx" "/mnt/storage/.macshare/.secret/arnie.kdbx" '' ); }; Install.WantedBy = [ "default.target" ]; }; systemd.user.timers.keepass-sync = { Unit.Description = "Timer for KeePass sync"; Timer = { OnBootSec = "1m"; OnUnitActiveSec = "10m"; }; Install.WantedBy = [ "timers.target" ]; }; home.sessionVariables = { EDITOR = "vim"; GO111MODULE = "on"; TERMINAL = "ghostty"; }; }