{ inputs, config, vars, pkgs, ... }: let unstable = import inputs.nixpkgs-unstable { system = pkgs.stdenv.hostPlatform.system; config.allowUnfree = true; }; in { imports = [ # ./quickshell (import ./nvim { inherit unstable; }) ./bt.nix ./cargo.nix ./chromium.nix ./dav ./dunst.nix ./fastfetch.nix ./firefox.nix ./fish.nix ./git.nix ./goose.nix ./hyprland.nix ./hyprlock.nix ./mail ./mpv.nix ./newsboat.nix ./nom.nix ./ntfy.nix ./nushell.nix ./tenere.nix ./ticker.nix ./vale.nix ./walker.nix ./wallpapers ./waybar ./zaread.nix ]; home = { file = { ".cache/nix-index/.keep".text = ""; "Calendar/radicale/.keep".text = ""; "Contacts/radicale/.keep".text = ""; Downloads.source = config.lib.file.mkOutOfStoreSymlink "/media/skydrive/Downloads"; }; enableNixpkgsReleaseCheck = true; stateVersion = "25.05"; shell = { enableBashIntegration = true; enableFishIntegration = true; enableNushellIntegration = true; }; username = "${vars.user}"; sessionVariables = { BROWSER = "${pkgs.firefox}/bin/firefox"; CARGO_REGISTRIES_RELESOFT_CREDENTIAL_PROVIDER = "cargo:token"; CARGO_REGISTRIES_RELESOFT_INDEX = "sparse+https://git.relesoft.io/api/packages/relesoft/cargo/"; CARGO_REGISTRIES_RELESOFT_IO_PROTOCOL = "sparse"; CARGO_REGISTRIES_RELESOFT_TOKEN = "$(${pkgs.coreutils}/bin/cat ${config.age.secrets.relesoft_cargo_token.path})"; CC = "clang"; CURSOR_SIZE = "16"; DEFAULT_BROWSER = "${pkgs.firefox}/bin/firefox"; ELECTRON_OZONE_PLATFORM_HINT = "auto"; GDK_SCALE = "1"; MOZ_USE_XINPUT2 = "1"; NIXOS_OZONE_WL = "1"; OPENAI_API_KEY = "$(${pkgs.coreutils}/bin/cat ${config.age.secrets.openai_auth_token.path})"; PAGER = "${pkgs.nvimpager}/bin/nvimpager"; PISTOL_CHROMA_FORMATTER = "terminal256"; PISTOL_CHROMA_STYLE = "monokai"; SHIORI_PASSWORD = "$(${pkgs.coreutils}/bin/cat ${config.age.secrets.shiori_password.path})"; TERMCMD = "${pkgs.ghostty}/bin/ghostty"; UNSPLASH_ACCESS_KEY = "$(${pkgs.coreutils}/bin/cat ${config.age.secrets.unsplash_access_key.path})"; VISUAL = "${pkgs.neovim}/bin/nvim"; }; pointerCursor = { package = pkgs.rose-pine-hyprcursor; hyprcursor.enable = true; gtk.enable = true; name = "rose-pine-hyprcursor"; size = 22; }; homeDirectory = "/home/${vars.user}"; packages = with pkgs; [ # tui tools bluetui # bluetooth management clipse # clipboard management impala # iwd terminal ui lux # youtube-downloader rmpc # tui for mpd rtorrent # torrent systemctl-tui tenere # llm tui ticker # stock ticker wthrr # weather forecast from openmeteo # gui foliate # ebook reader ghostty # terminal emulator hypridle hyprpaper libreoffice lxqt.pavucontrol-qt rose-pine-hyprcursor # hyprcursor theme sqlitebrowser # sqlite swayimg # image viewer wireshark # spell checking aspell aspellDicts.en # english aspell dictionary aspellDicts.en-computers aspellDicts.en-science aspellDicts.fi # finnish aspell dictionary enchant # spell cherker interface hunspell hunspellDicts.en-us libvoikko # finnish spelling nuspell # spell checker # support ethtool # ethernet driver info ffmpeg libcamera # source camera stack libnotify # send notifications libwebp material-icons material-symbols mermaid-cli # diagrams wl-clipboard wttrbar # weather bar # cli-tools appimage-run attic-client # nix cache client brightnessctl cloc # count llines of code dmidecode # memory information espflash # ESP32 flasher espup # ESP32 development fd # find files by filenames file # show the type of file font-awesome # icons forgejo-cli # forgejo-cli gat # cat but with extra features grim # screen capture inxi # system innformation jq # commandline json parser kramdown-asciidoc # command to convert markdown to asciidoc minio-client # minio command line moor # less replacement ntfy-sh # notifications nvimpager # use neovim as pager pistol # file preview pkg-config # needed for compilation poppler-utils # pdf utilities rdrview # extract content from web page reader # extract web page and pipe recutils # text-based database ripgrep # faster grep slurp # screen are capture sqlite # simple database timg # show image in shell unstable.goose-cli # llm cli unstable.vale # spellcheck unstable.valeStyles.microsoft # spellcheck linters unstable.valeStyles.write-good # spellcheck linters whisper-cpp # tts wlogout # logout helper xdg-utils xh # curl replacement xxd # view binary files zellij # terminal multiplexer # Development antora # documentation tool for asciidoc asciidoctor-with-extensions # asciidoc is a markdown replacement clang # c and rust cmake # c couchbase-shell # couchbase d2 # graphs gnumake # makefile lean4 # theorem prover - broken lld # c and rust linker nodePackages.jsdoc # javascript documentation unstable.go unstable.golint # linter for go uv # python package installer ]; }; age = { identityPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ]; secrets = { miniflux_api_key = { path = "${config.home.homeDirectory}/.secrets/miniflux_api_key"; file = ../secrets/miniflux_api_key.age; }; openai_auth_token.file = ../secrets/openai_auth_token.age; minio = { path = "${config.home.homeDirectory}/.mc/config.json"; file = ../secrets/minio.age; }; relesoft_cargo_token.file = ../secrets/relesoft_cargo_token.age; shiori_password.file = ../secrets/shiori_password.age; radicale = { path = "${config.home.homeDirectory}/.secrets/radicale"; file = ../secrets/radicale.age; }; unsplash_access_key = { path = "${config.home.homeDirectory}/.secrets/unsplash"; file = ../secrets/unsplash_access_key.age; }; gmail = { file = ../secrets/gmail.age; path = "${config.home.homeDirectory}/.secrets/gmail"; mode = "600"; }; relesoft = { file = ../secrets/relesoft.age; path = "${config.home.homeDirectory}/.secrets/relesoft"; mode = "600"; }; }; }; gtk = { colorScheme = "dark"; enable = true; theme = { package = pkgs.whitesur-gtk-theme; name = "WhiteSur-Dark"; }; iconTheme = { package = pkgs.nordzy-icon-theme; name = "Nordzy"; }; font = { package = pkgs.roboto-flex; name = "Roboto Flex 11"; }; }; qt = { enable = false; style = { package = pkgs.darkly; name = "Darkly"; }; }; programs = { obsidian = { enable = true; defaultSettings.app = { strictLineBreaks = true; showUnsupportedFiles = true; alwaysUpdateLinks = true; pdfExportSettings = { includeName = true; pageSize = "A4"; landscape = false; margin = "0"; downscalePercent = 100; }; }; vaults = { obsidian-vault = { enable = true; target = "Documents/obsidian-vault"; settings = { communityPlugins = [ #obsidian-livesync = { # enable = true; #}; #lean-syntax-highlight = { # enable = true; #}; ]; }; }; }; }; home-manager.enable = true; chawan = { enable = true; settings = { buffer = { autofocus = true; history = true; images = true; scripting = true; styling = true; }; input = { vi-numeric-prefix = true; }; }; }; nix-search-tv = { enable = true; enableTelevisionIntegration = true; settings = { indexes = [ "nixpkgs" "home-manager" "nixos" ]; experimental = { }; }; }; television = { enable = true; enableFishIntegration = true; }; zathura = { enable = true; extraConfig = '' set selection-clipboard clipboard set database sqlite ''; }; rbw = { enable = true; settings = { email = "${vars.email}"; base_url = "https://vault.tammi.cc"; pinentry = pkgs.pinentry-gnome3; }; }; element-desktop = { enable = true; settings = { "m.homeserver" = { base_url = "https://matrix.relesoft.io"; server_name = "relesoft.io"; }; default_theme = "dark"; }; }; zellij = { # modern tmux enable = true; enableFishIntegration = false; }; zoxide = { # smarter cd command enable = true; enableFishIntegration = true; enableNushellIntegration = true; }; carapace = { enable = true; enableNushellIntegration = true; enableFishIntegration = true; }; gpg = { enable = true; settings = { no-comments = true; }; }; fzf = { enable = true; enableFishIntegration = true; # use CTRL+t for files, CTRL + r for history defaultOptions = [ "--style full" "--preview '${pkgs.pistol}/bin/pistol {}'" ]; }; yazi = { # file browser enable = true; enableNushellIntegration = true; enableFishIntegration = true; settings = { mgr = { show_hidden = true; show_symlink = true; sort_by = "mtime"; sort_dir_first = true; sort_reverse = true; }; preview = { image_filter = "lanczos3"; image_quality = 90; }; }; }; atuin = { enable = true; enableFishIntegration = true; enableNushellIntegration = true; daemon = { enable = true; }; settings = { auto_sync = true; style = "compact"; sync_address = "https://atuin.tammi.cc"; sync_frequency = "5m"; update_check = false; workspaces = true; }; }; starship = { enable = true; enableFishIntegration = true; enableTransience = true; enableNushellIntegration = true; }; eza = { enable = true; enableFishIntegration = true; enableNushellIntegration = true; git = true; icons = "auto"; extraOptions = [ "--color=always" "--tree" "--level=1" "--group-directories-first" "--dereference" ]; }; nix-index = { enable = true; enableFishIntegration = true; enableNushellIntegration = true; }; pistol.enable = true; ghostty = { enable = true; systemd = { enable = true; }; installVimSyntax = true; enableFishIntegration = true; settings = { copy-on-select = true; font-family = "Iosevka Nerd Font"; font-size = 12; mouse-hide-while-typing = true; theme = "nord"; }; themes = { nord = { background = "#2e3440"; cursor-color = "#d8dee9"; cursor-text = "#2e3440"; foreground = "#d8dee9"; selection-background = "#3f4758"; selection-foreground = "#d8dee9"; palette = [ "0=#3b4252" "1=#bf616a" "2=#a3be8c" "3=#ebcb8b" "4=#81a1c1" "5=#b48ead" "6=#88c0d0" "7=#e5e9f0" "8=#4c566a" "9=#bf616a" "10=#a3be8c" "11=#ebcb8b" "12=#81a1c1" "13=#b48ead" "14=#8fbcbb" "15=#eceff4" ]; }; }; }; ssh = { enableDefaultConfig = false; enable = true; matchBlocks."*" = { compression = true; controlMaster = "auto"; controlPersist = "10m"; serverAliveInterval = 1; serverAliveCountMax = 3; }; extraConfig = " HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256 KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256 MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr "; }; }; services = { home-manager = { autoExpire = { store.cleanup = true; enable = true; }; }; ssh-agent = { enable = true; enableFishIntegration = true; enableNushellIntegration = true; }; mpris-proxy.enable = true; mpd = { enable = true; musicDirectory = "/media/skydrive/Music/"; # extraArgs = [ "--verbose" ]; network = { listenAddress = "any"; startWhenNeeded = true; port = 6600; }; }; wl-clip-persist = { enable = true; }; psd = { enable = true; backupLimit = 5; }; gpg-agent = { defaultCacheTtl = 1800; enable = true; enableFishIntegration = true; enableNushellIntegration = true; enableSshSupport = true; pinentry.package = pkgs.pinentry-gnome3; }; clipse = { enable = true; }; }; manual = { html.enable = true; json.enable = true; }; fonts = { fontconfig = { enable = true; defaultFonts = { serif = [ "Roboto Serif" ]; sansSerif = [ "Roboto Flex" ]; monospace = [ "Iosevka Nerd Font" ]; emoji = [ "Twitter Color Emoji" ]; }; }; }; xdg = { enable = true; autostart.enable = true; portal = { enable = true; config.common = { default = [ "*" ]; "org.freedesktop.impl.portal.FileChooser" = "termfilechooser"; }; xdgOpenUsePortal = true; extraPortals = with pkgs; [ xdg-desktop-portal-wlr xdg-desktop-portal-termfilechooser ]; }; desktopEntries = { nvim = { categories = [ ]; comment = "A text editor"; exec = ''${pkgs.neovim}/bin/nvim''; genericName = "Editor"; name = "nvim"; terminal = true; }; }; mimeApps = { enable = true; defaultApplications = { "application/pdf" = [ "org.pwmt.zathura.desktop" ]; "inode/directory" = "yazi.desktop"; "image/jpeg" = [ "swayimg.desktop" ]; "image/png" = [ "swayimg.desktop" ]; "image/webp" = [ "swayimg.desktop" ]; "text/html" = [ "firefox.desktop" ]; "text/json" = [ "nvim.desktop" ]; "text/markdown" = "nvim.desktop"; "text/plain" = "nvim.desktop"; "video/mp4" = "mpv.desktop"; "video/webm" = "mpv.desktop"; "x-scheme-handler/about" = "firefox.desktop"; "x-scheme-handler/http" = "firefox.desktop"; "x-scheme-handler/https" = "firefox.desktop"; "x-scheme-handler/unknown" = "firefox.desktop"; }; }; }; systemd.user = { startServices = "sd-switch"; }; xdg.configFile."xdg-desktop-portal-termfilechooser/config".source = (pkgs.formats.toml { }).generate "termfilechooser-config" { filechooser = { cmd = "yazi-wrapper.sh"; default_dir = "/home/petri/Downloads"; open_mode = "suggested"; save_mode = "last"; }; }; xdg.configFile."xdg-desktop-portal-termfilechooser/yazi-wrapper.sh" = { force = true; executable = true; source = pkgs.writeShellScript "yazi-wrapper" /* bash */ '' # This wrapper script is invoked by xdg-desktop-portal-termfilechooser. # For more information about input/output arguments read `xdg-desktop-portal-termfilechooser(5)` set -e if [ "$6" -ge 4 ]; then set -x fi multiple="$1" directory="$2" save="$3" path="$4" out="$5" # Build yazi arguments yazi_args="" if [ "$save" = "1" ]; then # save a file yazi_args="--chooser-file=$out $path" elif [ "$directory" = "1" ]; then # upload files from a directory yazi_args="--chooser-file=$out --cwd-file=$out.1 $path" elif [ "$multiple" = "1" ]; then # upload multiple files yazi_args="--chooser-file=$out $path" else # upload only 1 file yazi_args="--chooser-file=$out $path" fi # Execute ghostty with yazi ${pkgs.ghostty}/bin/ghostty -e ${pkgs.yazi}/bin/yazi $yazi_args # Handle directory case output if [ "$directory" = "1" ]; then if [ ! -s "$out" ] && [ -s "$out.1" ]; then ${pkgs.coreutils}/bin/cat "$out.1" > "$out" rm -f "$out.1" else rm -f "$out.1" fi fi ''; }; }