diff --git a/.config/nvim/ftplugin/agda.vim b/.config/nvim/ftplugin/agda.vim new file mode 100644 index 00000000..6a5dbec8 --- /dev/null +++ b/.config/nvim/ftplugin/agda.vim @@ -0,0 +1,176 @@ +" Sourced from +" https://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.VIMEditing#:~:text=agda%2Dutf8%2Evim +" (Link is dead so use wayback machine) + +" To add more +" https://www.compart.com/en/unicode/ + +" Superscripts +imap \^0 ⁰ +imap \^1 ¹ +imap \^2 ² +imap \^3 ³ +imap \^4 ⁴ +imap \^5 ⁵ +imap \^6 ⁶ +imap \^7 ⁷ +imap \^8 ⁸ +imap \^9 ⁹ +imap \^+ ⁺ +imap \^- ⁻ +imap \^= ⁼ +imap \^( ⁽ +imap \^) ⁾ +imap \^n ⁿ + +imap \^l ˡ +imap \^r ʳ + +imap \' ′ +imap \'' ″ +imap \''' ‴ +imap \'''' ⁗ + +" Subscripts +imap \_0 ₀ +imap \_1 ₁ +imap \_2 ₂ +imap \_3 ₃ +imap \_4 ₄ +imap \_5 ₅ +imap \_6 ₆ +imap \_7 ₇ +imap \_8 ₈ +imap \_9 ₉ +imap \_+ ₊ +imap \_- ₋ +imap \_= ₌ +imap \_( ₍ +imap \_) ₎ + +" Arrows +imap -> → +imap <-- ← +imap <--> ↔ +imap ==> ⇒ +imap <== ⇐ +imap <==> ⇔ +" +" Symbols from mathematics and logic, LaTeX style +imap \forall ∀ +imap \exists ∃ +imap \in ∈ +imap \ni ∋ +imap \empty ∅ +imap \prod ∏ +imap \sum ∑ +imap \le ≤ +imap \ge ≥ +imap \pm ± +imap \subset ⊂ +imap \subseteq ⊆ +imap \supset ⊃ +imap \supseteq ⊇ +imap \setminus ∖ +imap \cap ∩ +imap \cup ∪ +imap \int ∫ +imap \therefore ∴ +imap \qed ∎ +imap \1 𝟙 +imap \N ℕ +imap \Z ℤ +imap \C ℂ +imap \Q ℚ +imap \R ℝ +imap \E 𝔼 +imap \F 𝔽 +imap \to → +imap \mapsto ↦ +imap \infty ∞ +imap \equiv ≡ +imap \cong ≅ +imap \:= ≔ +imap \=: ≕ +imap \ne ≠ +imap \approx ≈ +imap \perp ⊥ +imap \not ̷ +imap \ldots … +imap \cdots ⋯ +imap \cdot ⋅ +imap \circ ◦ +imap \times × +imap \oplus ⊕ +imap \langle ⟨ +imap \rangle ⟩ + +" Math +imap \monus ∸ + +" Greek alphabet... +imap \alpha α +imap \beta β +imap \gamma γ +imap \delta δ +imap \epsilon ε +imap \zeta ζ +imap \nu η +imap \theta θ +imap \iota ι +imap \kappa κ +imap \lambda λ +imap \mu μ +imap \nu ν +imap \xi ξ +imap \omicron ο +imap \pi π +imap \rho ρ +imap \stigma ς +imap \sigma σ +imap \tau τ +imap \upsilon υ +imap \phi ϕ +imap \varphi φ +imap \chi χ +imap \psi ψ +imap \omega ω + +imap \Alpha Α +imap \Beta Β +imap \Gamma Γ +imap \Delta Δ +imap \Epsilon Ε +imap \Zeta Ζ +imap \Nu Η +imap \Theta Θ +imap \Iota Ι +imap \Kappa Κ +imap \Lambda Λ +imap \Mu Μ +imap \Nu Ν +imap \Xi Ξ +imap \Omicron Ο +imap \Pi Π +imap \Rho Ρ +imap \Sigma Σ +imap \Tau Τ +imap \Upsilon Υ +imap \Phi Φ +imap \Chi Χ +imap \Psi Ψ +imap \Omega Ω + +" default cornelis mapping +nnoremap l :CornelisLoad +nnoremap r :CornelisRefine +nnoremap d :CornelisMakeCase +nnoremap , :CornelisTypeContext +nnoremap . :CornelisTypeContextInfer +nnoremap n :CornelisSolve +nnoremap a :CornelisAuto +nnoremap gd :CornelisGoToDefinition +nnoremap [/ :CornelisPrevGoal +nnoremap ]/ :CornelisNextGoal +nnoremap :CornelisInc +nnoremap :CornelisDec diff --git a/.config/nvim/ftplugin/markdown.agda.vim b/.config/nvim/ftplugin/markdown.agda.vim new file mode 120000 index 00000000..72fd5ccf --- /dev/null +++ b/.config/nvim/ftplugin/markdown.agda.vim @@ -0,0 +1 @@ +.config/nvim/ftplugin/agda.vim \ No newline at end of file diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 1dcd08f7..a739f392 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -7,6 +7,7 @@ "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "cornelis": { "branch": "master", "commit": "deda7eb399efe94cc49c645da7b6f94780fe0c19" }, "fidget.nvim": { "branch": "main", "commit": "64463022a1f2ff1318ab22a2ea4125ed9313a483" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "gitsigns.nvim": { "branch": "main", "commit": "130beacf8a51f00aede9c31064c749136679a321" }, @@ -21,6 +22,7 @@ "nvim-cmp": { "branch": "main", "commit": "d97d85e01339f01b842e6ec1502f639b080cb0fc" }, "nvim-colorizer.lua": { "branch": "master", "commit": "81e676d3203c9eb6e4c0ccf1eba1679296ef923f" }, "nvim-dap": { "branch": "master", "commit": "818cd8787a77a97703eb1d9090543a374f79a9ac" }, + "nvim-hs.vim": { "branch": "develop", "commit": "d4a6b7278ae6a1fdc64e300c3ebc1e24719af342" }, "nvim-jdtls": { "branch": "master", "commit": "f73731b543f5971e0da9665eb1d7ceffe1fde71f" }, "nvim-lspconfig": { "branch": "master", "commit": "41ceb6bba3a40128b7841f5b7f5a9dae7201e823" }, "nvim-metals": { "branch": "main", "commit": "90dadd67bb1069ce1ba2a4dabf4e45da2807ba80" }, @@ -39,5 +41,6 @@ "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, + "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, "vimtex": { "branch": "master", "commit": "2e1bbabeb2c34bb17d7bc8cfdf8f95b16dd0db0c" } } diff --git a/.config/nvim/lua/_lazy.lua b/.config/nvim/lua/_lazy.lua index 5e428516..c388d328 100644 --- a/.config/nvim/lua/_lazy.lua +++ b/.config/nvim/lua/_lazy.lua @@ -120,6 +120,19 @@ local plugins = { lazy = false, version = "^2", }, + { + "agda/cornelis", + name = "cornelis", + ft = "agda", + init = function() + vim.g.cornelis_use_global_binary = 1 + -- We don't use the default binding for shortcuts (see ftplugin) + -- Also, buffer reload is done in the ftplugin too + vim.g.cornelis_no_agda_input = 1 + end, + dependencies = { "neovimhaskell/nvim-hs.vim", "kana/vim-textobj-user" }, + version = "*", + }, { "nvim-telescope/telescope.nvim", branch = "0.1.x", diff --git a/.config/nvim/plugin/cornelis.vim b/.config/nvim/plugin/cornelis.vim new file mode 100644 index 00000000..27930283 --- /dev/null +++ b/.config/nvim/plugin/cornelis.vim @@ -0,0 +1,17 @@ +" agda related autocommands + +function! CornelisLoadWrapper() + if exists(":CornelisLoad") ==# 2 + CornelisLoad + endif +endfunction + +au BufReadPre *.agda call CornelisLoadWrapper() +au BufReadPre *.lagda* call CornelisLoadWrapper() + +au QuitPre *.agda :CornelisCloseInfoWindows +au QuitPre *.lagda* :CornelisCloseInfoWindows + +" autoreload at file write +au BufWritePost *.agda execute "normal! :CornelisLoad\" +au BufWritePost *.lagda* execute "normal! :CornelisLoad\" diff --git a/.config/nvim/plugin/leap.lua b/.config/nvim/plugin/leap.lua index 14ea952b..d977c684 100644 --- a/.config/nvim/plugin/leap.lua +++ b/.config/nvim/plugin/leap.lua @@ -1,3 +1,3 @@ local leap = require("leap") -vim.keymap.set({ "n", "x", "o" }, "s", function() leap.leap() end) +vim.keymap.set({ "n", "x", "o" }, "s", function() leap.leap { backward = false } end) vim.keymap.set("n", "S", function() leap.leap { backward = true } end) diff --git a/.config/nvim/plugin/lsp.lua b/.config/nvim/plugin/lsp.lua index 087193b5..ab37b57d 100644 --- a/.config/nvim/plugin/lsp.lua +++ b/.config/nvim/plugin/lsp.lua @@ -24,6 +24,8 @@ local servers = { ["nil"] = { formatting = { command = { "nixfmt" } } }, }, }, + + zls = {}, } vim.diagnostic.config { diff --git a/.config/nvim/plugin/telescope.lua b/.config/nvim/plugin/telescope.lua index 5cf24d54..733066de 100644 --- a/.config/nvim/plugin/telescope.lua +++ b/.config/nvim/plugin/telescope.lua @@ -52,6 +52,9 @@ telescope.setup { live_grep = { layout_config = { height = 0.7 }, }, + buffers = { + sort_lastused = true, + }, resume = { initial_mode = "normal", }, diff --git a/default.nix b/default.nix index 729c5d87..c6d15dab 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,6 @@ -{ - sources ? import ./npins, -}: +let + sources = import ./npins; +in { # for repl sessions inherit sources; diff --git a/nix/configurations/hetzner_benchmark.nix b/nix/configurations/hetzner_benchmark.nix index 515bfd3a..af9baca1 100644 --- a/nix/configurations/hetzner_benchmark.nix +++ b/nix/configurations/hetzner_benchmark.nix @@ -40,7 +40,6 @@ in # use lix everywhere and wrap it with nom ../overlays/lix.nix - ../overlays/nix-monitored.nix ]; }; diff --git a/nix/configurations/hetzner_benchmark/nixos/sane-nix.nix b/nix/configurations/hetzner_benchmark/nixos/sane-nix.nix index d73c45e0..54f76994 100644 --- a/nix/configurations/hetzner_benchmark/nixos/sane-nix.nix +++ b/nix/configurations/hetzner_benchmark/nixos/sane-nix.nix @@ -1,9 +1,11 @@ # Protect my system from running out of storage or memory +let + totalStorage = 500; +in { - # 500GB Storage nix.settings = { - min-free = 50 * 1024 * 1024 * 1024; - max-free = 100 * 1024 * 1024 * 1024; + min-free = builtins.ceil (totalStorage * 0.2) * 1024 * 1024 * 1024; + max-free = builtins.ceil (totalStorage * 0.3) * 1024 * 1024 * 1024; }; systemd.services.nix-daemon.serviceConfig = { @@ -11,11 +13,4 @@ MemoryMax = "90%"; OOMScoreAdjust = 500; }; - - # 12 Cores, 64 GB RAM - # split into 4 jobs with 3C/16G - nix.settings = { - cores = 3; - max-jobs = 4; - }; } diff --git a/nix/configurations/hydrogen.nix b/nix/configurations/hydrogen.nix index 2cafb757..7bc9620a 100644 --- a/nix/configurations/hydrogen.nix +++ b/nix/configurations/hydrogen.nix @@ -45,7 +45,6 @@ in # use lix everywhere and wrap it with nom ../overlays/lix.nix - ../overlays/nix-monitored.nix ]; }; diff --git a/nix/configurations/vanadium.nix b/nix/configurations/vanadium.nix index f0163280..a93a753f 100644 --- a/nix/configurations/vanadium.nix +++ b/nix/configurations/vanadium.nix @@ -54,21 +54,16 @@ in ../overlays/wired-notify.nix ../overlays/wallpapers.nix ../overlays/nil.nix - ../overlays/dix.nix - ../overlays/eepy.nix - ../overlays/calibre-no-mime.nix - ../overlays/fcitx5-table-extra-taiwanese.nix ../overlays/ghostty-dev.nix + ../overlays/npins.nix + ../overlays/cornelis.nix - ../overlays/iosevka.nix + ../overlays/iosevka ../packages/overlay.nix ./vanadium/overlay.nix ./vanadium/kernel-overlay.nix - # removed, but I need it for PLFA! - ../overlays/pin-emacs28.nix - # use lix everywhere and wrap it with nom ../overlays/lix.nix ../overlays/nix-monitored.nix @@ -100,6 +95,7 @@ in ./vanadium/nixos/input.nix ./vanadium/nixos/misc.nix + ./vanadium/nixos/remote-builders.nix ./vanadium/nixos/display.nix ./vanadium/nixos/gui.nix @@ -120,6 +116,7 @@ in # ../nixosModules/extra/secure_dns.nix ../nixosModules/extra/zram.nix ../nixosModules/extra/leana.nix + ../nixosModules/extra/lean-nixos.nix # # Extern modules @@ -176,7 +173,6 @@ in ../homeModules/common/fzf.nix ../homeModules/common/git.nix ../homeModules/common/gpg.nix - ../homeModules/common/kitty.nix ../homeModules/common/ghostty.nix ../homeModules/common/leana.nix ../homeModules/common/locale.nix diff --git a/nix/configurations/vanadium/home/dev.nix b/nix/configurations/vanadium/home/dev.nix index e664c20f..dddef0f0 100644 --- a/nix/configurations/vanadium/home/dev.nix +++ b/nix/configurations/vanadium/home/dev.nix @@ -27,10 +27,14 @@ pkgs.taplo # toml pkgs.vscode-langservers-extracted # JSON etc pkgs.yaml-language-server # yaml + pkgs.cornelis # agda # bash pkgs.shfmt pkgs.nodePackages.bash-language-server + + # ghc + pkgs.hs-speedscope ]; programs.git = { @@ -71,6 +75,7 @@ "https://haskell-language-server.cachix.org" "https://helix.cachix.org" "https://cache.iog.io" + "https://ghostty.cachix.org" ]; extra-trusted-public-keys = [ "ghc-nix.cachix.org-1:ziC/I4BPqeA4VbtOFpFpu6D1t6ymFvRWke/lc2+qjcg=" @@ -78,6 +83,7 @@ "haskell-language-server.cachix.org-1:juFfHrwkOxqIOZShtC4YC1uT1bBcq2RSvC7OMKx0Nz8=" "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" + "ghostty.cachix.org-1:QB389yTa6gTyneehvqG58y0WnHjQOqgnA+wBnpWWxns=" ]; }; }; diff --git a/nix/configurations/vanadium/home/firefox.nix b/nix/configurations/vanadium/home/firefox.nix index 6edc85cb..af525054 100644 --- a/nix/configurations/vanadium/home/firefox.nix +++ b/nix/configurations/vanadium/home/firefox.nix @@ -115,6 +115,7 @@ in [ addons.sponsorblock addons.return-youtube-dislikes + addons.shinigami-eyes addons.consent-o-matic ]; }; diff --git a/nix/configurations/vanadium/home/misc.nix b/nix/configurations/vanadium/home/misc.nix index 8337a00b..44492885 100644 --- a/nix/configurations/vanadium/home/misc.nix +++ b/nix/configurations/vanadium/home/misc.nix @@ -17,6 +17,46 @@ monospace = [ "Iosevka" ]; emoji = [ "Noto Color Emoji" ]; }; + + configFile = { + thick-iosevka = { + enable = true; + # https://www.freedesktop.org/software/fontconfig/fontconfig-user.html + # https://gist.github.com/yuttie/adb22a6c07ef8e75d82e48d5484b7ad8 + # https://github.com/N1k3YB/CS2FontChanger_ru/blob/5f1d8189220f42286d773c536ff83a49b2556da2/app.py#L227 + # + # Use the following script to test + # for size in (seq 9 15) + # echo + # echo + # for weight in {regular,medium,bold} + # echo "weight=$weight:size=$size" + # fc-match "mono:weight=$weight:size=$size" + # end + # end | less + text = /* xml */ '' + + + + + Iosevka + + weightbold bold + weightmedium medium + + size15 regular + size10 medium + bold + + + + + + + + ''; + }; + }; }; home.packages = [ pkgs.noto-fonts @@ -26,12 +66,12 @@ pkgs.noto-fonts-color-emoji pkgs.noto-fonts-emoji-blob-bin pkgs.ubuntu-classic - pkgs.iosevka + pkgs.Iosevka ]; home.file = { ".xscreensaver".source = "${./xscreensaver/.xscreensaver}"; - ".wallpaper".source = "${pkgs.wallpapers.packages.knights_of_guinevere.fixing_gwen}"; + ".wallpaper".source = "${pkgs.wallpapers.packages.serial_experiments_lain.lain_windows_error}"; }; xdg.configFile = { "xmonad".source = "${./xmonad}"; diff --git a/nix/configurations/vanadium/home/programs.nix b/nix/configurations/vanadium/home/programs.nix index 46351801..b0b931ab 100644 --- a/nix/configurations/vanadium/home/programs.nix +++ b/nix/configurations/vanadium/home/programs.nix @@ -20,6 +20,7 @@ home.packages = [ pkgs.ghc # my favorite calculator + pkgs.lsr # fast ls with io_uring pkgs.nmap pkgs.stow pkgs.zip @@ -41,13 +42,11 @@ pkgs.macchanger # The file picker is not ergonomic enough, sadly - # pkgs.helix + pkgs.helix # pkgs.nushell pkgs.ruler pkgs.mini-calc - pkgs.eepy - pkgs.zbar # pdf pkgs.poppler-utils # pdfseparate, pdfunite @@ -69,49 +68,32 @@ pkgs.onefetch pkgs.just - # nix tools - # # Alejandra handles inline comments poorly - # # https://github.com/kamadorueda/alejandra/issues/429 - # pkgs.alejandra - pkgs.nixfmt-rfc-style - pkgs.nurl - pkgs.dix - pkgs.niv + pkgs.nixfmt-rfc-style # formatter + pkgs.nurl # fetcher made easy + pkgs.nix-diff # debug cache miss pkgs.npins - pkgs.nix-tree - pkgs.nix-output-monitor - pkgs.nh + pkgs.nix-tree # analyze closure # productivity / media pkgs.evolution pkgs.libreoffice pkgs.calibre - pkgs.foliate # TODO: replace calibre with foliate - # pkgs.rawtherapee pkgs.digikam - pkgs.gimp - pkgs.easyeffects pkgs.nautilus pkgs.sushi # space bar previewer - # pkgs.blender - # pkgs.inkscape - # pkgs.aseprite # pkgs.xournalpp - pkgs.nicotine-plus pkgs.picard # music tagger - pkgs.qbittorrent pkgs.mousai - pkgs.localsend # file share with iOS - pkgs.minder # mindmap tool + pkgs.nicotine-plus + pkgs.qbittorrent pkgs.mkvtoolnix + pkgs.localsend # file share with iOS # social pkgs.iamb pkgs.discord # keep the app for video calls pkgs.signal-desktop - pkgs.tuba # mastodon GUI client pkgs.emoji-picker-rs - pkgs.telegram-desktop # for archlinux china # wm utilities pkgs.xbrightness @@ -133,10 +115,6 @@ enable = true; defaultEditor = true; }; - emacs = { - enable = true; - package = pkgs.unsafe-emacs28; - }; lazygit.enable = true; fish = { enable = true; @@ -175,18 +153,7 @@ mouse-scroll-multiplier = 1; }; }; - kitty = { - enable = false; - font.size = 12; # sweet spot for framework 13 - settings = { - shell = lib.getExe config.programs.fish.package; - # https://github.com/kovidgoyal/kitty/issues/1866 - # https://sw.kovidgoyal.net/kitty/conf/#terminal-bell - linux_bell_theme = "elementary"; - }; - }; - - chromium.enable = true; + # chromium.enable = true; }; services = { diff --git a/nix/configurations/vanadium/home/xmobar.nix b/nix/configurations/vanadium/home/xmobar.nix index 0da89245..13078a66 100644 --- a/nix/configurations/vanadium/home/xmobar.nix +++ b/nix/configurations/vanadium/home/xmobar.nix @@ -18,7 +18,7 @@ lib.makeBinPath [ ghc pkgs.libnotify - pkgs.hrt-time + pkgs.mullvad-status ] }" ''; diff --git a/nix/configurations/vanadium/home/xmobar/xmobar.hs b/nix/configurations/vanadium/home/xmobar/xmobar.hs index f4bab962..76b011e3 100644 --- a/nix/configurations/vanadium/home/xmobar/xmobar.hs +++ b/nix/configurations/vanadium/home/xmobar/xmobar.hs @@ -65,20 +65,7 @@ config = , Run $ Com "tomorrow" - [ "--target", "2025-08-14" - , "--target", "2025-08-21" - , "--target", "2025-08-22" - , "--target", "2025-09-16=snip snip" - , "--target", "2025-10-13=no teef" - , "--target", "2025-10-31=dragon book" - , "--target", "2025-11-19=scalpel" - , "--target", "2025-11-29=à deux" - -- , "--target", "2025-12-15=campus baguette" - -- , "--target", "2025-12-16=dragon book" - , "--target", "2025-12-18=baguette" - , "--target", "2025-12-30=seule" - , "--target", "2026-02-02=monmaster" - , "--target", "2026-02-22=dernier appel" + [ "--target", "2026-02-02=monmaster" ] "" (60 &minute) @@ -102,7 +89,7 @@ config = ] (6 &second) , Run $ Com "powerprofilesctl" ["get"] "" (6 &second) - , Run $ Com "hrt-time" ["days"] "" (60 &minute) + , Run $ Com "mullvad-status" [] "" (6 &second) , Run XMonadLog , Run $ Weather @@ -124,8 +111,9 @@ config = <> alignSep config <> intercalate "|" [ " %LFRN% " + , " %mullvad-status% " , " %battery%, %powerprofilesctl%) " - , " %hereClock% (%tomorrow%, %hrt-time%) " + , " %hereClock% (%tomorrow%) " ] } diff --git a/nix/configurations/vanadium/home/xmonad/lib/XMonad/Layout/SetMasterNTall.hs b/nix/configurations/vanadium/home/xmonad/lib/XMonad/Layout/SetMasterNTall.hs index a08f7742..a09af1d3 100644 --- a/nix/configurations/vanadium/home/xmonad/lib/XMonad/Layout/SetMasterNTall.hs +++ b/nix/configurations/vanadium/home/xmonad/lib/XMonad/Layout/SetMasterNTall.hs @@ -23,8 +23,10 @@ instance LayoutClass SetMasterNTall a where let ws' = W.Workspace t (unSetMasterNTall l) s in (fmap . fmap . fmap) SetMasterNTall . runLayout ws' - handleMessage (SetMasterNTall l@(ResizableTall _n0 d f s)) mess - | Just (SetMasterN n) <- fromMessage mess = pure $ Just $ SetMasterNTall $ ResizableTall n d f s + handleMessage (SetMasterNTall l@(ResizableTall n0 d f s)) mess + | Just (SetMasterN n) <- fromMessage mess = pure $ + if n0 /= n then Just $ SetMasterNTall $ ResizableTall n d f s + else Nothing | otherwise = (fmap . fmap) SetMasterNTall . handleMessage l $ mess description (SetMasterNTall l) = description l diff --git a/nix/configurations/vanadium/home/xmonad/xmonad.hs b/nix/configurations/vanadium/home/xmonad/xmonad.hs index e5c8ad57..32590777 100644 --- a/nix/configurations/vanadium/home/xmonad/xmonad.hs +++ b/nix/configurations/vanadium/home/xmonad/xmonad.hs @@ -3,10 +3,8 @@ import XMonad import XMonad.Actions.CopyWindow -import XMonad.Actions.Navigation2D import XMonad.Actions.Submap import XMonad.Actions.SwapWorkspaces -import XMonad.Actions.Warp import XMonad.Hooks.DynamicLog import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.InsertPosition @@ -33,9 +31,9 @@ import XMonad.Util.NamedScratchpad import XMonad.Util.SpawnOnce import Data.Char.Greek +import qualified Data.Map.Strict as M import Data.Ratio import Data.Semigroup -import qualified Data.Map.Strict as M import System.Posix import Graphics.X11.ExtraTypes.XF86 @@ -48,7 +46,6 @@ main = $ withSB xmobarConfig . docks $ setEwmhActivateHook myActivateHook $ ewmhFullscreen . ewmh - $ withNavigation2DConfig def $ def { modMask = superMask , borderWidth = 5 @@ -80,7 +77,7 @@ myLayout = $ smartSpacingWithEdge 5 $ reflectMsg . reflectHoriz $ SetMasterNTall - $ ResizableTall 1 (1/10) (3/7) [] + $ ResizableTall 1 (1/10) (3/7) [1.2, 1, 1, 1.2] isSioyek :: Query Bool isSioyek = className =? "sioyek" @@ -209,11 +206,21 @@ setMasterNEventHandleHook :: Event -> X All setMasterNEventHandleHook ev = let adjustMasterCount :: X () adjustMasterCount = do - count <- gets $ length . W.integrate' . W.stack . W.workspace . W.current . windowset - if count <= 3 then sendMessage (SetMasterN 1) - else if count <= 5 then sendMessage (SetMasterN 2) - else if count <= 7 then sendMessage (SetMasterN 3) - else pure () + ws <- gets windowset + -- Remove the floating windows in the count + let s :: Maybe (W.Stack Window) + s = W.stack $ W.workspace $ W.current ws + + count :: Int + count = + length + $ filter (flip M.notMember (W.floating ws)) + $ W.integrate' s + + if count > 7 then sendMessage (SetMasterN 4) + else if count > 5 then sendMessage (SetMasterN 3) + else if count > 3 then sendMessage (SetMasterN 2) + else sendMessage (SetMasterN 1) in do case ev of MapRequestEvent{} -> adjustMasterCount @@ -273,9 +280,6 @@ removedKeybinds = ++ [ (superMask , n) | n <- [xK_1 .. xK_9] ] ++ [ (superMask .|. shiftMask, n) | n <- [xK_1 .. xK_9] ] -warpToWindowCenter :: X () -warpToWindowCenter = warpToWindow 0.5 0.5 - keybinds :: [((KeyMask, KeySym), X ())] keybinds = [ @@ -315,39 +319,20 @@ keybinds = , submap $ M.fromList [ ((0, xK_t), withFocused $ windows . W.sink) , ((0, xK_l), withFocused $ windows . flip W.float centeredFloat) + , ((0, xK_c), windows copyToAll) + , ((0, xK_k), killAllOtherCopies) ] ) - - -- Switch between layers - , ((altMask, xK_s), switchLayer ) - - -- We override default focus shifting bindings to warp the cursor to the center of the new window. - -- This is especially useful because mag doesn't work well with focusFollowsMouse. - -- The order is important: focus shift, and then warp the cursor - -- - -- Warp when focus shifts by binding, not by mouse (otherwise it's annoying) - - -- Directional navigation of windows - , ((altMask, xK_l), windowGo R False >> warpToWindowCenter) - , ((altMask, xK_h), windowGo L False >> warpToWindowCenter) - , ((altMask, xK_k), windowGo U False >> warpToWindowCenter) - , ((altMask, xK_j), windowGo D False >> warpToWindowCenter) - - -- Swap adjacent windows - , ((altMask .|. superMask, xK_l), windowSwap R False >> warpToWindowCenter) - , ((altMask .|. superMask, xK_h), windowSwap L False >> warpToWindowCenter) - , ((altMask .|. superMask, xK_k), windowSwap U False >> warpToWindowCenter) - , ((altMask .|. superMask, xK_j), windowSwap D False >> warpToWindowCenter) ] -- Screenshots ++ (let fullscreen = "maim -u | xclip -in -selection clipboard -t image/png" withSelection = "maim -u -s -b 5 -o | xclip -in -selection clipboard -t image/png" toFloat = "maim -u -s -b 5 -o | feh --auto-zoom -" - in [ ((0, xK_Print), spawn fullscreen ) - , ((superMask .|. shiftMask, xK_3 ), spawn fullscreen ) - , ((superMask .|. shiftMask, xK_4 ), spawn withSelection) - , ((superMask .|. shiftMask, xK_5 ), spawn toFloat ) + in [ ((0, xK_Print), unGrab >> spawn fullscreen ) + , ((superMask .|. shiftMask, xK_3 ), unGrab >> spawn fullscreen ) + , ((superMask .|. shiftMask, xK_4 ), unGrab >> spawn withSelection) + , ((superMask .|. shiftMask, xK_5 ), unGrab >> spawn toFloat ) ] ) @@ -366,7 +351,7 @@ keybinds = -- Launcher ++ (let launchFirefox = "zen" - launchDmenu = "dmenu_run -i -fn \"Iosevka-14\" -nb \"#36363a\" -nf \"#e2e2e4\" -sb \"#f7f7f8\" -sf \"#36363a\" -l 10" + launchDmenu = "dmenu_run -i -fn \"Iosevka-18\" -nb \"#36363a\" -nf \"#e2e2e4\" -sb \"#f7f7f8\" -sf \"#36363a\" -l 10" lock = "xscreensaver-command -lock" in [ ((controlMask .|. altMask, xK_m), namedScratchpadAction myScratchpads "cmus" ) , ((controlMask .|. altMask, xK_t), namedScratchpadAction myScratchpads "btop" ) diff --git a/nix/configurations/vanadium/home/zen-browser.nix b/nix/configurations/vanadium/home/zen-browser.nix index beee8d6a..c658d744 100644 --- a/nix/configurations/vanadium/home/zen-browser.nix +++ b/nix/configurations/vanadium/home/zen-browser.nix @@ -115,6 +115,7 @@ in [ addons.sponsorblock addons.return-youtube-dislikes + addons.shinigami-eyes addons.consent-o-matic ]; }; diff --git a/nix/configurations/vanadium/nixos/connectivity.nix b/nix/configurations/vanadium/nixos/connectivity.nix index 28890b7a..9b48c9e3 100644 --- a/nix/configurations/vanadium/nixos/connectivity.nix +++ b/nix/configurations/vanadium/nixos/connectivity.nix @@ -63,6 +63,13 @@ # This is the fascist one, just block it because I can't tell 0.0.0.0 nixos.wiki + # Gotta purify my smoos brain for a while + 0.0.0.0 instagram.com + 0.0.0.0 www.instagram.com + + 0.0.0.0 youtube.com + 0.0.0.0 www.youtube.com + # The "people who you viewed can see you" thing is weird af 0.0.0.0 linkedin.com 0.0.0.0 www.linkedin.com @@ -76,4 +83,19 @@ services.mullvad-vpn.enable = true; hardware.bluetooth.enable = true; + + # Printing and auto-discovery of Wi-Fi printers + services.avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + + services.printing = { + enable = true; + drivers = with pkgs; [ + cups-filters + cups-browsed + ]; + }; } diff --git a/nix/configurations/vanadium/nixos/misc.nix b/nix/configurations/vanadium/nixos/misc.nix index 0f757beb..5b6348c7 100644 --- a/nix/configurations/vanadium/nixos/misc.nix +++ b/nix/configurations/vanadium/nixos/misc.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, pkgs, ... }: { system.stateVersion = "24.11"; @@ -15,6 +15,12 @@ "pcie_aspm=off" ]; + boot.plymouth = { + enable = true; + themePackages = [ pkgs.plymouth-blahaj-theme ]; + theme = "blahaj"; + }; + # Cross building # https://discourse.nixos.org/t/how-do-i-get-my-aarch64-linux-machine-to-build-x86-64-linux-extra-platforms-doesnt-seem-to-work/38106/2?u=leana8959 boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; diff --git a/nix/configurations/vanadium/nixos/remote-builders.nix b/nix/configurations/vanadium/nixos/remote-builders.nix new file mode 100644 index 00000000..b94c066a --- /dev/null +++ b/nix/configurations/vanadium/nixos/remote-builders.nix @@ -0,0 +1,31 @@ +let + supportedFeatures = [ + "nixos-test" + "benchmark" + "big-parallel" + "kvm" + ]; +in +{ pkgs, ... }: +{ + nix.buildMachines = [ + # NOTE: these hosts need to be put in the .ssh/config of root. + # https://wiki.nixos.org/wiki/Distributed_build#Recommended_setup:_multi-user_Nix_local_%E2%80%93%3E_multi-user_Nix_remote + { + hostName = "pancake"; + sshUser = "remotebuild"; + speedFactor = 2; + system = pkgs.stdenv.hostPlatform.system; + maxJobs = 1; + inherit supportedFeatures; + } + { + hostName = "hetzner_benchmark"; + sshUser = "remotebuild"; + speedFactor = 12; + system = pkgs.stdenv.hostPlatform.system; + maxJobs = 3; + inherit supportedFeatures; + } + ]; +} diff --git a/nix/configurations/vanadium/nixos/sane-nix.nix b/nix/configurations/vanadium/nixos/sane-nix.nix index 83088437..bb710e8e 100644 --- a/nix/configurations/vanadium/nixos/sane-nix.nix +++ b/nix/configurations/vanadium/nixos/sane-nix.nix @@ -1,8 +1,11 @@ # Protect my system from running out of storage or memory +let + totalStorage = 930; +in { nix.settings = { - min-free = 50 * 1024 * 1024 * 1024; - max-free = 100 * 1024 * 1024 * 1024; + min-free = builtins.ceil (totalStorage * 0.2) * 1024 * 1024 * 1024; + max-free = builtins.ceil (totalStorage * 0.3) * 1024 * 1024 * 1024; }; systemd.services.nix-daemon.serviceConfig = { @@ -10,11 +13,4 @@ MemoryMax = "90%"; OOMScoreAdjust = 500; }; - - # 16 Cores, 32 GB RAM - # split into 4 jobs with 4C/8G - nix.settings = { - cores = 2; - max-jobs = 4; - }; } diff --git a/nix/configurations/vanadium/overlay.nix b/nix/configurations/vanadium/overlay.nix index 169bf13b..a73ecd0c 100644 --- a/nix/configurations/vanadium/overlay.nix +++ b/nix/configurations/vanadium/overlay.nix @@ -16,6 +16,14 @@ infuse { ./patches/helix/W-as-write.patch ]; + btop.__output.patches.__append = [ + (final.fetchpatch { + name = "btrfs-io-graph"; + url = "https://patch-diff.githubusercontent.com/raw/aristocratos/btop/pull/1285.patch"; + hash = "sha256-za6B1EiOV1JqKMJwrNQo43RKChw+C4mmC8pcoxLLau4="; + }) + ]; + # TODO: # pinned branch of https://github.com/astrand/xclip/tree/xerror # use this until #43 gets resolved properly diff --git a/nix/homeModules/common/firefox.nix b/nix/homeModules/common/firefox.nix index 194206bf..18981f77 100644 --- a/nix/homeModules/common/firefox.nix +++ b/nix/homeModules/common/firefox.nix @@ -53,10 +53,13 @@ in "browser.tabs.loadInBackground" = true; "browser.ctrlTab.sortByRecentlyUsed" = false; "layout.css.devPixelsPerPx" = 1.1; - - # open links in new window - # this works a lot better with xmonad where I have a bunch of windows - "browser.link.open_newwindow" = 2; + "browser.startup.page" = 1; + "browser.link.open_newwindow" = 2; # open in new tab + "browser.translations.automaticallyPopup" = false; + "browser.tabs.closeWindowWithLastTab" = true; + "general.smoothScroll" = false; # makes me dizzy + "accessibility.typeaheadfind" = true; # type to find + "media.videocontrols.picture-in-picture.enable-when-switching-tabs.enabled" = true; # Sponsored crap # Yes diff --git a/nix/homeModules/common/fish/aliasesAbbrs.nix b/nix/homeModules/common/fish/aliasesAbbrs.nix index 330a0159..8affff1d 100644 --- a/nix/homeModules/common/fish/aliasesAbbrs.nix +++ b/nix/homeModules/common/fish/aliasesAbbrs.nix @@ -7,7 +7,7 @@ programs.fish = { shellAbbrs = lib.mkMerge [ (lib.mkIf pkgs.stdenv.isLinux { - "," = "nix-shell -p"; + "," = "nix-shell --command $SHELL -p"; }) ]; @@ -21,10 +21,6 @@ # idiot protection chmod = "chmod --preserve-root"; chown = "chown --preserve-root"; - - # I can't make alias with a space, i.e. `nom shell` - nix-shell = "nix-shell --command fish"; - nom-shell = "nom-shell --command fish"; }) ]; }; diff --git a/nix/homeModules/common/fish/default.nix b/nix/homeModules/common/fish/default.nix index 6a866084..9b5994fa 100644 --- a/nix/homeModules/common/fish/default.nix +++ b/nix/homeModules/common/fish/default.nix @@ -11,10 +11,17 @@ # # Script dependencies # - home.packages = [ pkgs.vivid ]; + home.packages = [ + pkgs.nix-output-monitor # pretty ui for shells + ]; programs = { fd.enable = true; fzf.enable = true; + # fd uses LS_COLORS + vivid = { + enable = true; + activeTheme = "solarized-light"; # similar to milou + }; }; # diff --git a/nix/homeModules/common/fish/functions/ls.fish b/nix/homeModules/common/fish/functions/ls.fish new file mode 100644 index 00000000..785ac319 --- /dev/null +++ b/nix/homeModules/common/fish/functions/ls.fish @@ -0,0 +1,7 @@ +function ls + if type -q lsr + command lsr $argv + else + command ls $argv + end +end diff --git a/nix/homeModules/common/fish/functions/nix-build.fish b/nix/homeModules/common/fish/functions/nix-build.fish index 8b074641..16bc1efc 100644 --- a/nix/homeModules/common/fish/functions/nix-build.fish +++ b/nix/homeModules/common/fish/functions/nix-build.fish @@ -1,7 +1,7 @@ function nix-build if type -q nom-build - nom-build $argv + command nom-build $argv else - nix-build $argv + command nix-build $argv end end diff --git a/nix/homeModules/common/fish/functions/nix-shell.fish b/nix/homeModules/common/fish/functions/nix-shell.fish index b108e9ed..d7ea11bf 100644 --- a/nix/homeModules/common/fish/functions/nix-shell.fish +++ b/nix/homeModules/common/fish/functions/nix-shell.fish @@ -1,7 +1,7 @@ function nix-shell if type -q nom-shell - nom-shell $argv + command nom-shell $argv else - nix-shell $argv + command nix-shell $argv end end diff --git a/nix/homeModules/common/fish/functions/nix.fish b/nix/homeModules/common/fish/functions/nix.fish new file mode 100644 index 00000000..488220e9 --- /dev/null +++ b/nix/homeModules/common/fish/functions/nix.fish @@ -0,0 +1,11 @@ +function nix + if [ $(count $argv) -lt 1 ] + command nix $argv + end + and if [ $argv[1] = "build" -o $argv[1] = "shell" ] && type -q nom + nom $argv + else + command nix $argv + end +end + diff --git a/nix/homeModules/common/fish/shellInit.fish b/nix/homeModules/common/fish/shellInit.fish index 0a1cfd24..c99199ca 100644 --- a/nix/homeModules/common/fish/shellInit.fish +++ b/nix/homeModules/common/fish/shellInit.fish @@ -83,7 +83,4 @@ set -x fzf_fd_opts --hidden --exclude=.git # fzf-fish using patdiff would show incomplete diff, it is a bug # don't do it -# fd uses LS_COLORS -set -x LS_COLORS (vivid -m 24-bit generate solarized-light) # similar to milou - set -g sponge_purge_only_on_exit true diff --git a/nix/homeModules/common/ghostty.nix b/nix/homeModules/common/ghostty.nix index 99caab23..2b0513f4 100644 --- a/nix/homeModules/common/ghostty.nix +++ b/nix/homeModules/common/ghostty.nix @@ -10,7 +10,7 @@ in { config = lib.mkIf cfg.enable { home.packages = [ - pkgs.nerd-fonts.iosevka + pkgs.nerd-fonts.IosevkaTerm ]; programs.ghostty.settings = { @@ -21,13 +21,15 @@ in resize-overlay = "never"; # Fonts - font-family = "Iosevka NFM"; + font-family = "IosevkaTerm NFM"; adjust-cursor-thickness = 2; keybind = [ "ctrl+shift+==increase_font_size:1" "ctrl+-=decrease_font_size:1" ]; + mouse-hide-while-typing = true; + # Theme background = "#fdf6e3"; foreground = "#073642"; diff --git a/nix/homeModules/common/git.nix b/nix/homeModules/common/git.nix index 9074ce48..920de2a8 100644 --- a/nix/homeModules/common/git.nix +++ b/nix/homeModules/common/git.nix @@ -5,6 +5,9 @@ }: { # git plugins + programs.git = { + lfs.enable = true; + }; programs.patdiff = { enable = lib.mkDefault true; enableGitIntegration = lib.mkDefault true; @@ -17,7 +20,11 @@ in lib.mkIf patdiffCfg.enable { settings = { - git.paging.externalDiffCommand = "${lib.getExe' patdiffCfg.package "patdiff-git-wrapper"}"; + git.paging = [ + { + externalDiffCommand = "${lib.getExe' patdiffCfg.package "patdiff-git-wrapper"}"; + } + ]; }; }; diff --git a/nix/homeModules/common/gpg.nix b/nix/homeModules/common/gpg.nix index 916db466..2d969411 100644 --- a/nix/homeModules/common/gpg.nix +++ b/nix/homeModules/common/gpg.nix @@ -5,13 +5,17 @@ gpg-agent.pinentry.package = pkgs.pinentry-tty; }; + # Fun video btw + # https://media.ccc.de/v/39c3-to-sign-or-not-to-sign-practical-vulnerabilities-i programs.gpg.publicKeys = let fromUrl = { url, hash, - trust ? 5, + # https://security.stackexchange.com/a/69089 + # One lower than ultimate (introducer in the web of trust) is good enough. + trust ? 4, }: { source = pkgs.fetchurl { inherit url hash; }; @@ -27,6 +31,7 @@ { user = "leana8959"; hash = "sha256-Y+v/8bLkyUIe4vjToChQP3ChPxRV/DqI72OTsx6F0oo="; + trust = 5; } { user = "vanilla-extracts"; @@ -36,10 +41,6 @@ user = "jappeace"; hash = "sha256-wJ4hiE7M7dcEMaE8waNZEi+tybpVIsFzoeDJhIIaLhk="; } - { - user = "gautaz"; - hash = "sha256-j0I9l8uKfzKNrc2qveFi5mkRppxL36+BUEqvFPs6vqA="; - } { user = "confusedkernel"; hash = "sha256-9DdtDAcv+2Z0jJMSLAXbp5ne8uHYj5V/lNGi0kKSdv4="; diff --git a/nix/homeModules/common/kitty.nix b/nix/homeModules/common/kitty.nix deleted file mode 100644 index fff484b9..00000000 --- a/nix/homeModules/common/kitty.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: -let - cfg = config.programs.kitty; -in -{ - config = lib.mkIf cfg.enable { - home.packages = [ - pkgs.nerd-fonts.iosevka - ]; - - programs.kitty = { - font.name = "family=\"Iosevka NFM\""; - - settings = rec { - # Make text thicker - text_composition_strategy = lib.mkIf pkgs.stdenv.isLinux "2.8 0"; - - # Don't prompt - confirm_os_window_close = 0; - - # Never underline links - underline_hyperlinks = "never"; - - # No default bindings - clear_all_shortcuts = "no"; - - # cursor - cursor_blink_interval = 1; - cursor_stop_blinking_after = 15; # always blink - - # theme - background = "#fdf6e3"; - foreground = "#073642"; - cursor = "#000000"; - cursor_text_color = "#ffffff"; - selection_foreground = foreground; - selection_background = "#dbcba3"; - color0 = "#073642"; - color8 = "#4d4d4d"; - color1 = "#af005f"; - color9 = "#d33682"; - color2 = "#859900"; - color10 = "#29a350"; - color3 = "#ba9b23"; - color11 = "#d6b429"; - color4 = "#268bd2"; - color12 = "#469edd"; - color5 = "#5f5faf"; - color13 = "#6060d1"; - color6 = "#2aa198"; - color14 = "#4bccc1"; # a platupus? perry the platupus? - color7 = "#a0a1a7"; - color15 = "#eeeadd"; - }; - }; - }; -} diff --git a/nix/homeModules/common/password-store.nix b/nix/homeModules/common/password-store.nix index 04d8c5f9..8b1dcc19 100644 --- a/nix/homeModules/common/password-store.nix +++ b/nix/homeModules/common/password-store.nix @@ -9,6 +9,7 @@ let in { home.packages = lib.mkIf cfg.enable [ + pkgs.zbar pkgs.pwgen pkgs.diceware ]; diff --git a/nix/homeModules/common/starship/starship.toml b/nix/homeModules/common/starship/starship.toml index 88a7587d..a1e10ee1 100644 --- a/nix/homeModules/common/starship/starship.toml +++ b/nix/homeModules/common/starship/starship.toml @@ -108,7 +108,7 @@ style = "blue" #################### Right hand side #################### [cmd_duration] -min_time = 60_000 +min_time = 2_000 show_milliseconds = true style = 'blue' format = '([$duration]($style) )' diff --git a/nix/homeModules/common/wired/default.nix b/nix/homeModules/common/wired/default.nix index 2b3a7d2f..8a657630 100644 --- a/nix/homeModules/common/wired/default.nix +++ b/nix/homeModules/common/wired/default.nix @@ -1,6 +1,6 @@ { pkgs, ... }: { - home.packages = [ pkgs.iosevka ]; + home.packages = [ pkgs.Iosevka ]; services.wired = { config = "${./wired.ron}"; }; diff --git a/nix/homeModules/common/zen-browser.nix b/nix/homeModules/common/zen-browser.nix index 4b2e2fbc..a9cecff2 100644 --- a/nix/homeModules/common/zen-browser.nix +++ b/nix/homeModules/common/zen-browser.nix @@ -1,53 +1,17 @@ { - pkgs, config, lib, ... }: let - inherit (pkgs) nur; - cfg = config.programs.zen-browser; + + firefoxCfg = config.programs.firefox; in { programs.zen-browser = { - # https://mozilla.github.io/policy-templates - # The following have more complex logic, keep them as policies and not profiles - policies = { - RequestedLocales = [ - "fr-FR" # for fuck sake stop showing me translated version of French gov sites - "zh-TW" - "en-US" - ]; + policies = firefoxCfg.policies; - SearchEngines = { - Remove = [ - "Google" - "Bing" - "DuckDuckGo" - "Qwant" - "eBay" - "Perplexity" - ]; - Default = "DuckDuckGo Lite"; - Add = [ - { - Name = "DuckDuckGo Lite"; - URLTemplate = "https://lite.duckduckgo.com/lite/search?q={searchTerms}"; - } - ]; - }; - NoDefaultBookmarks = true; - DisplayMenuBar = "never"; - DisplayBookmarksToolbar = "never"; - DNSOverHTTPS = { - Enabled = false; - }; - }; - - # https://searchfox.org/mozilla-central/source/browser/components/enterprisepolicies/Policies.sys.mjs - # Some policies can be rewritten to profiles configuration - # # "locked" semantic from zen (doesn't seem to be doing anything, attempted for zen-twilight 1.18t) # https://github.com/0xc000022070/zen-browser-flake/tree/main#preferences # @@ -57,91 +21,20 @@ in # - click the buttons # - diff it # diff .zen/default/prefs.js{.bk,} - profiles.default = { - settings = { + profiles.default = lib.mkMerge [ + firefoxCfg.profiles.default + { # Zen specific - "zen.theme.content-element-separation" = 0; # Remove "borders" around window - - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - "browser.tabs.loadInBackground" = true; - "browser.ctrlTab.sortByRecentlyUsed" = false; - "layout.css.devPixelsPerPx" = 1.1; - "browser.startup.page" = 1; - "browser.translations.automaticallyPopup" = false; - "browser.tabs.closeWindowWithLastTab" = true; - "general.smoothScroll" = false; - - # open links in new window - # this works a lot better with xmonad where I have a bunch of windows - "browser.link.open_newwindow" = 2; - - # Sponsored crap - # Yes - "browser.newtabpage.activity-stream.showSearch" = true; - "browser.newtabpage.activity-stream.feeds.topsites" = true; - # No - "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; - "browser.newtabpage.activity-stream.feeds.section.highlights" = false; - "browser.newtabpage.activity-stream.feeds.system.topstories" = false; - "browser.newtabpage.activity-stream.feeds.section.topstories" = false; - "browser.newtabpage.activity-stream.showSponsored" = false; - - # URL - # Yes - "browser.urlbar.suggest.quicksuggest.nonsponsored" = true; - # No - "browser.urlbar.suggest.quicksuggest.sponsored" = false; - - # Pasword manager - "signon.rememberSignons" = false; - "services.passwordSavingEnabled" = false; - "pref.privacy.disable_button.view_passwords" = false; - - # Hardware acceleration - "layers.acceleration.disabled" = false; - - # Screenshot - "screenshots.browser.component.enabled" = true; - - # Recommendations - "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false; - "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false; - "extensions.htmlaboutaddons.recommendations.enabled" = false; # Addons - - # Onboarding - "browser.aboutwelcome.enabled" = false; - - # AI crap - "browser.ml.chat.enabled" = false; - "browser.ml.chat.page" = false; - "browser.ml.chat.shortcuts" = false; - "browser.ml.chat.sidebar" = false; - - # Prevent WebRTC leak - # https://mullvad.net/en/help/webrtc - "media.peerconnection.enabled" = false; - }; - - extensions.packages = - let - addons = nur.repos.rycee.firefox-addons; - in - [ - addons.ublock-origin - addons.privacy-badger - addons.user-agent-string-switcher - - /* - Here's to you who want to remove news feed eradicator because you find it annoying: - It is here to annoy you so it is less likely for you to be on the agency inversion path. - DO NOT REMOVE IT. I repeat, DO NOT REMOVE IT. - - If you think it's annoying, go do some jump rope, sing, live. - */ - addons.news-feed-eradicator # did you read the comment above? - addons.multi-account-containers - ]; - }; + settings = { + "zen.theme.content-element-separation" = 0; # Remove "borders" around window + "zen.tabs.show-newtab-vertical" = false; + "zen.view.compact.toolbar-flash-popup" = true; + "zen.view.show-newtab-button-top" = false; + "zen.view.use-single-toolbar" = false; + "zen.tabs.ctrl-tab.ignore-pending-tabs" = true; # ctrl-tab ignore unloaded tabs + }; + } + ]; }; xdg.mimeApps = diff --git a/nix/networks/wpa_supplicant-compat.nix b/nix/networks/wpa_supplicant-compat.nix index 2f57b267..b8bffae8 100644 --- a/nix/networks/wpa_supplicant-compat.nix +++ b/nix/networks/wpa_supplicant-compat.nix @@ -2,7 +2,7 @@ # This loads the list of networks as a NixOS wpa_supplicant compatible attrset # # View the example config -# less $(nix-build --no-out-link -E '(import {}).wpa_supplicant')/share/doc/wpa_supplicant/wpa_supplicant.conf.example +# less $(nix-build --no-out-link '' -A 'wpa_supplicant')/share/doc/wpa_supplicant/wpa_supplicant.conf.example let sources = import ../../npins; lib = import (sources.nixpkgs + "/lib"); diff --git a/nix/nixosModules/common/system-nixconf.nix b/nix/nixosModules/common/system-nixconf.nix index fdfb8d20..cbce71b6 100644 --- a/nix/nixosModules/common/system-nixconf.nix +++ b/nix/nixosModules/common/system-nixconf.nix @@ -8,6 +8,10 @@ package = lib.mkDefault pkgs.nix; settings = { + # it is impossible to anser in nix-direnv, so we force it to off. + # https://github.com/nix-community/nix-direnv/issues/678 + accept-flake-config = lib.mkForce false; + # Try to have at least 10GB of space by default min-free = lib.mkDefault (5 * 1024 * 1024 * 1024); max-free = lib.mkDefault (10 * 1024 * 1024 * 1024); diff --git a/nix/nixosModules/extra/lean-nixos.nix b/nix/nixosModules/extra/lean-nixos.nix new file mode 100644 index 00000000..b8d4a815 --- /dev/null +++ b/nix/nixosModules/extra/lean-nixos.nix @@ -0,0 +1,14 @@ +# disable unused tools on nixos systems (that I don't use) +{ + system.tools = { + # build a network of virtual machines? never used this. + nixos-build-vms.enable = false; + + # only useful for installer + nixos-generate-config.enable = false; + nixos-install.enable = false; + + # interactively show options, just use the repl instead + nixos-option.enable = false; + }; +} diff --git a/nix/overlays/calibre-no-mime.nix b/nix/overlays/calibre-no-mime.nix deleted file mode 100644 index bfc2d604..00000000 --- a/nix/overlays/calibre-no-mime.nix +++ /dev/null @@ -1,11 +0,0 @@ -# cailbre is obnoxious about opening HTML -final: prev: { - calibre = final.symlinkJoin { - name = "calibre"; - paths = [ prev.calibre ]; - buildInputs = [ final.makeWrapper ]; - postBuild = '' - rm -r $out/share/mime - ''; - }; -} diff --git a/nix/overlays/cornelis.nix b/nix/overlays/cornelis.nix new file mode 100644 index 00000000..3008001b --- /dev/null +++ b/nix/overlays/cornelis.nix @@ -0,0 +1,10 @@ +# The Agda support for Vim +let + sources = import ../../npins; +in + +# If this is updated, we break split on case support for PLFA. +# PLFA uses 2.7.0 +# https://github.com/agda/cornelis/issues/169 +assert sources.cornelis.version == "v2.7.1"; +sources.cornelis.asFlake.overlays.cornelis diff --git a/nix/overlays/dix.nix b/nix/overlays/dix.nix deleted file mode 100644 index ad644e49..00000000 --- a/nix/overlays/dix.nix +++ /dev/null @@ -1,6 +0,0 @@ -let - sources = import ../../npins; -in -final: _: { - dix = sources.dix.asFlake.packages.${final.stdenv.hostPlatform.system}.default; -} diff --git a/nix/overlays/eepy.nix b/nix/overlays/eepy.nix deleted file mode 100644 index 38bc8053..00000000 --- a/nix/overlays/eepy.nix +++ /dev/null @@ -1,6 +0,0 @@ -let - sources = import ../../npins; -in -final: _: { - eepy = sources.eepy.asFlake.packages.${final.stdenv.hostPlatform.system}.default; -} diff --git a/nix/overlays/ghostty-dev.nix b/nix/overlays/ghostty-dev.nix index 599c6542..35a49af8 100644 --- a/nix/overlays/ghostty-dev.nix +++ b/nix/overlays/ghostty-dev.nix @@ -1,7 +1,20 @@ let sources = import ../../npins; in -final: prev: { +final: prev: +let + inherit (final) lib; +in +{ # Dev version of ghostty, "tip" - ghostty = sources.ghostty-dev.asFlake.packages.${final.stdenv.hostPlatform.system}.default; + ghostty = + let + shortRev = lib.substring 0 8 sources.ghostty-dev.revision; + in + # NOTE: + # ghostty-dev internally builds a derivation used as a cache. + # Overriding the pname would cause cache mismatch. + sources.ghostty-dev.asFlake.packages.${final.stdenv.hostPlatform.system}.default.override { + revision = shortRev; + }; } diff --git a/nix/overlays/iosevka.nix b/nix/overlays/iosevka.nix deleted file mode 100644 index a22bf34b..00000000 --- a/nix/overlays/iosevka.nix +++ /dev/null @@ -1,174 +0,0 @@ -final: prev: rec { - nerd-fonts = - let - mkNerdFont = final.callPackage ../lib/mkNerdFont.nix { }; - in - prev.nerd-fonts - // { - iosevka = mkNerdFont { - font = iosevka; - patcherArgs = [ - "--complete" - "--careful" - "--name {/.}-NFM" - "--mono" - ]; - }; - }; - - iosevka = prev.iosevka.override { - set = ""; - - # Guide: https://github.com/be5invis/Iosevka/blob/main/doc/custom-build.md - privateBuildPlan = { - family = "Iosevka"; - serifs = "sans"; - spacing = "normal"; - - # Otherwise kitty behaves funny with ligature - # noLigation = true; - exportGlyphNames = true; - - variants.design = { - ampersand = "et-tailed"; - capital-q = "crossing"; - capital-z = "straight-serifless-with-crossbar"; - cent = "open"; - dollar = "open"; - lig-double-arrow-bar = "with-notch"; - lig-equal-chain = "with-notch"; - lig-hyphen-chain = "with-notch"; - lig-plus-chain = "with-notch"; - lig-single-arrow-bar = "with-notch"; - lower-lambda = "tailed-turn"; - number-sign = "slanted"; - percent = "rings-continuous-slash-also-connected"; - seven = "straight-serifless-crossbar"; - }; - variants.italic = { - v = "cursive-serifless"; - w = "cursive-serifless"; - }; - - weights = { - # Build 580, but indicate 400 in output - Regular.shape = 580; - Regular.menu = 400; - Regular.css = 400; - Bold.shape = 700; - Bold.menu = 700; - Bold.css = 700; - }; - - widths = { - Normal.shape = 500; - Normal.menu = 5; - Normal.css = "normal"; - Extended.shape = 600; - Extended.menu = 7; - Extended.css = "expanded"; - }; - - slopes = { - Upright.angle = 0; - Upright.css = "normal"; - Upright.menu = "upright"; - Upright.shape = "upright"; - Italic.angle = 9.4; - Italic.shape = "italic"; - Italic.menu = "italic"; - Italic.css = "italic"; - }; - - # The ligatures are defined based on Haskell and Nix usages. - # - # Follow: for more details - ligations.enables = [ - "arrow-l" # Left-pointing arrows - # "arrow-l-hyphen" # Left-pointing arrows with hyphen-minus (-) being the rod - # "arrow-l-equal" # Left-pointing arrows with equal sign (=) being the rod - # "arrow-l-wave" # Left-pointing arrows with tilde (~) being the rod - - "arrow-r" # Right-pointing arrows - # "arrow-r-hyphen" # Right-pointing arrows with hyphen-minus (-) being the rod - # "arrow-r-equal" # Right-pointing arrows with equal sign (=) being the rod - # "arrow-r-wave" # Right-pointing arrows with tilde (~) being the rod - - "arrow-lr" # Dual-pointing arrows - # "arrow-lr-hyphen" # Dual-pointing arrows with hyphen-minus (-) being the rod - # "arrow-lr-equal" # Dual-pointing arrows with equal sign (=) being the rod - # "arrow-lr-wave" # Dual-pointing arrows with tilde (~) being the rod - - "counter-arrow-l" # Left-pointing counter-arrows - # "counter-arrow-l-hyphen" # Left-pointing counter-arrows with hyphen-minus (-) being the rod - # "counter-arrow-l-equal" # Left-pointing counter-arrows with equal sign (=) being the rod - # "counter-arrow-l-wave" # Left-pointing counter-arrows with tilde (~) being the rod - - "counter-arrow-r" # Right-pointing counter-arrows - # "counter-arrow-r-hyphen" # Right-pointing counter-arrows with hyphen-minus (-) being the rod - # "counter-arrow-r-equal" # Right-pointing counter-arrows with equal sign (=) being the rod - # "counter-arrow-r-wave" # Right-pointing counter-arrows with tilde (~) being the rod - - # "eqeqeq" # Enable special ligation for === with triple lines - "eqeq" # Enable ligation for == and === - "lteq" # Enable ligation for <= as less-than-or-equal sign - # "eqlt" # Enable ligation for =< as less-than-or-equal sign - "gteq" # Enable ligation for >= as greater-than-or-equal sign - # "lteq-separate" # Display <= as separate shape - # "eqlt-separate" # Display =< as separate shape - # "gteq-separate" # Display >= as separate shape - - # "exeqeqeq" # Enable special ligation for !=== with triple lines - # "exeqeq" # Enable special ligation for !== with triple lines - # "eqexeq" # Enable special ligation for =!= with triple lines - # "eqexeq-dl" # Enable special ligation for =!= with double lines - # "exeq" # Enable ligation for != and !== - # "tildeeq" # Enable ligation for ~= as inequality - # "eqslasheq" # Enable special triple-line ligation for =/= as inequality - "slasheq" # Enable ligation for /= and =/= as inequality - "trig" # Enable ligation for <|, |> , <||, and other bar-and-angle-bracket symbols - # "ltgt-ne" # Enable ligation for <> as inequality - "ltgt-diamond" # Enable ligation for <> as diamond - # "ltgt-diamond-tag" # Enable ligation for <> as diamond-shaped empty HTML/XML tag - # "ltgt-slash-tag" # Enable ligation for and - # "brst" # Center asterisk in (* and *) - "slash-asterisk" # Shift asterisk in /* and */ - "kern-dotty" # Move connecting dotty punctuations closer, like for ::, :: # and ... - # "kern-bars" # Move consecutive bars closer, like for ||, ||| and // - "center-ops" # Vertically align some of the operators (like *) to the center position it is before or after a "center" operator (like +) - - # These put -. to the same height - # "center-op-trigger-plus-minus-l" # Plus (+) and Minus (-) will trigger other operator characters at left to be centered - # "center-op-trigger-plus-minus-r" # Plus (+) and Minus (-) will trigger other operator characters at right to be centered - - # These put *= to the same height - # "center-op-trigger-equal-l" # Equal (=) will trigger other operator characters at left to be centered - # "center-op-trigger-equal-r" # Equal (=) will trigger other operator characters at right to be centered - - "center-op-trigger-bar-l" # Bars (|) will trigger other operator characters at left to be centered - "center-op-trigger-bar-r" # Bars (|) will trigger other operator characters at right to be centered - "center-op-trigger-angle-inside" # Less (<) and Greater (>) will trigger other operator characters at inside to be centered - "center-op-trigger-angle-outside" # Less (<) and Greater (>) will trigger other operator characters at outside to be centered - # "center-op-influence-dot" # Treat dot (.) as operator and perform chained centering - "center-op-influence-colon" # Treat colon (:) as operator and perform chained centering - "tilde-tilde" # Make 2 or more contiguous ASCII tildes (like ~~, ~~~ and ~~~~) connected as a wave line - # "tilde-tilde-tilde" # Make 3 or more contiguous ASCII tildes (like ~~~ and ~~~~) connected as a wave line - # "minus-minus" # Make 2 or more contiguous hyphen-minuses (like --, --- and ----) connected as a straight solid line - # "minus-minus-minus" # Make 3 or more contiguous hyphen-minuses (like --- and ----) connected as a straight solid line - # "plus-plus" # Make 2 or more contiguous plus signs (like ++, +++ and ++++) connected. - # "plus-plus-plus" # Make 3 or more contiguous plus signs (like +++ and ++++) connected. - # "underscore-underscore" # Make 2 or more contiguous underscores (like __, ___ and ____) connected - # "underscore-underscore-underscore" # Make 3 or more contiguous underscores (like ___ and ____) connected - # "hash-hash" # Make 2 or more contiguous hash signs (number signs) (like ##, ### and ####) connected - # "hash-hash-hash" # Make 3 or more contiguous hash signs (number signs) (like ## and ###) connected - # "logic" # Enable ligation for /\ and \/ - # "llgg" # Enable ligation for <<, >> and other angle-bracket chaining - # "llggeq" # Enable ligation for <<=, >>= as shift operator - # "html-comment" # Enable ligation for