diff --git a/nix/configurations/vanadium.nix b/nix/configurations/vanadium.nix index a91971bc..344c1f77 100644 --- a/nix/configurations/vanadium.nix +++ b/nix/configurations/vanadium.nix @@ -54,6 +54,7 @@ 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 @@ -176,6 +177,7 @@ 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/programs.nix b/nix/configurations/vanadium/home/programs.nix index 818e1cda..46351801 100644 --- a/nix/configurations/vanadium/home/programs.nix +++ b/nix/configurations/vanadium/home/programs.nix @@ -69,27 +69,41 @@ pkgs.onefetch pkgs.just - pkgs.nixfmt-rfc-style # formatter - pkgs.nurl # fetcher made easy - pkgs.nix-diff # debug cache miss + # 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.npins - pkgs.nix-tree # analyze closure + pkgs.nix-tree + pkgs.nix-output-monitor + pkgs.nh # productivity / media pkgs.evolution pkgs.libreoffice - pkgs.minder # mindmap tool 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.picard # music tagger - pkgs.mousai pkgs.nicotine-plus + pkgs.picard # music tagger pkgs.qbittorrent - pkgs.mkvtoolnix + pkgs.mousai pkgs.localsend # file share with iOS + pkgs.minder # mindmap tool + pkgs.mkvtoolnix # social pkgs.iamb @@ -161,6 +175,17 @@ 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; }; diff --git a/nix/configurations/vanadium/home/xmobar.nix b/nix/configurations/vanadium/home/xmobar.nix index 13078a66..0da89245 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.mullvad-status + pkgs.hrt-time ] }" ''; diff --git a/nix/configurations/vanadium/home/xmobar/xmobar.hs b/nix/configurations/vanadium/home/xmobar/xmobar.hs index 76b011e3..f4bab962 100644 --- a/nix/configurations/vanadium/home/xmobar/xmobar.hs +++ b/nix/configurations/vanadium/home/xmobar/xmobar.hs @@ -65,7 +65,20 @@ config = , Run $ Com "tomorrow" - [ "--target", "2026-02-02=monmaster" + [ "--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" ] "" (60 &minute) @@ -89,7 +102,7 @@ config = ] (6 &second) , Run $ Com "powerprofilesctl" ["get"] "" (6 &second) - , Run $ Com "mullvad-status" [] "" (6 &second) + , Run $ Com "hrt-time" ["days"] "" (60 &minute) , Run XMonadLog , Run $ Weather @@ -111,9 +124,8 @@ config = <> alignSep config <> intercalate "|" [ " %LFRN% " - , " %mullvad-status% " , " %battery%, %powerprofilesctl%) " - , " %hereClock% (%tomorrow%) " + , " %hereClock% (%tomorrow%, %hrt-time%) " ] } diff --git a/nix/configurations/vanadium/home/xmonad/xmonad.hs b/nix/configurations/vanadium/home/xmonad/xmonad.hs index a49abdff..0ea59e18 100644 --- a/nix/configurations/vanadium/home/xmonad/xmonad.hs +++ b/nix/configurations/vanadium/home/xmonad/xmonad.hs @@ -3,8 +3,10 @@ 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 @@ -46,6 +48,7 @@ main = $ withSB xmobarConfig . docks $ setEwmhActivateHook myActivateHook $ ewmhFullscreen . ewmh + $ withNavigation2DConfig def $ def { modMask = superMask , borderWidth = 5 @@ -280,6 +283,9 @@ 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 = [ @@ -319,20 +325,39 @@ 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), unGrab >> spawn fullscreen ) - , ((superMask .|. shiftMask, xK_3 ), unGrab >> spawn fullscreen ) - , ((superMask .|. shiftMask, xK_4 ), unGrab >> spawn withSelection) - , ((superMask .|. shiftMask, xK_5 ), unGrab >> spawn toFloat ) + in [ ((0, xK_Print), spawn fullscreen ) + , ((superMask .|. shiftMask, xK_3 ), spawn fullscreen ) + , ((superMask .|. shiftMask, xK_4 ), spawn withSelection) + , ((superMask .|. shiftMask, xK_5 ), spawn toFloat ) ] ) diff --git a/nix/homeModules/common/fish/default.nix b/nix/homeModules/common/fish/default.nix index dbb6e438..6a866084 100644 --- a/nix/homeModules/common/fish/default.nix +++ b/nix/homeModules/common/fish/default.nix @@ -11,10 +11,7 @@ # # Script dependencies # - home.packages = [ - pkgs.vivid - pkgs.nix-output-monitor # pretty ui for shells - ]; + home.packages = [ pkgs.vivid ]; programs = { fd.enable = true; fzf.enable = true; diff --git a/nix/homeModules/common/kitty.nix b/nix/homeModules/common/kitty.nix new file mode 100644 index 00000000..fff484b9 --- /dev/null +++ b/nix/homeModules/common/kitty.nix @@ -0,0 +1,62 @@ +{ + 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/overlays/dix.nix b/nix/overlays/dix.nix new file mode 100644 index 00000000..ad644e49 --- /dev/null +++ b/nix/overlays/dix.nix @@ -0,0 +1,6 @@ +let + sources = import ../../npins; +in +final: _: { + dix = sources.dix.asFlake.packages.${final.stdenv.hostPlatform.system}.default; +} diff --git a/nix/packages/by-name/mullvad-status/mullvad-status.sh b/nix/packages/by-name/mullvad-status/mullvad-status.sh deleted file mode 100644 index 17873d5b..00000000 --- a/nix/packages/by-name/mullvad-status/mullvad-status.sh +++ /dev/null @@ -1,40 +0,0 @@ -if ! type mullvad >/dev/null; then - echo -n "Mullvad unavailable" - exit 1 -fi - -MULLVAD_STATUS="$(mullvad status -j)" - -function xmobarColor { - fg="$1" - x="$2" - echo -n "$x" -} - -case "$(echo "$MULLVAD_STATUS" | jq -r ".state")" in -connected) - function has-feature { - echo "$MULLVAD_STATUS" | jq --exit-status ".details.feature_indicators|contains([\"$1\"])" >/dev/null - } - if has-feature "LockdownMode"; then - xmobarColor "green" "Mullvad On " - else - xmobarColor "orange" "Mullvad On" - fi - - COUNTRY="$(echo "$MULLVAD_STATUS" | jq -r '.details.location.country')" - CITY="$(echo "$MULLVAD_STATUS" | jq -r '.details.location.city')" - - echo -n " ($COUNTRY,$CITY)" - ;; -disconnected) - function is-locked-down { - echo "$MULLVAD_STATUS" | jq --exit-status ".details.locked_down" >/dev/null - } - if is-locked-down "LockdownMode"; then - xmobarColor "red" "Mullvad Off " - else - xmobarColor "orange" "Mullvad Off" - fi - ;; -esac diff --git a/nix/packages/by-name/mullvad-status/package.nix b/nix/packages/by-name/mullvad-status/package.nix deleted file mode 100644 index 4841f3aa..00000000 --- a/nix/packages/by-name/mullvad-status/package.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - writeShellApplication, - jq, - mullvad, -}: - -writeShellApplication { - name = "mullvad-status"; - runtimeInputs = [ - mullvad - jq - ]; - text = builtins.readFile ./mullvad-status.sh; -} diff --git a/nix/packages/by-name/tokei/package.nix b/nix/packages/by-name/tokei/package.nix new file mode 100644 index 00000000..77399046 --- /dev/null +++ b/nix/packages/by-name/tokei/package.nix @@ -0,0 +1,39 @@ +{ + lib, + stdenv, + fetchFromGitHub, + rustPlatform, + libiconv, + darwin, + zlib, +}: +rustPlatform.buildRustPackage ( + finalAttrs: + let + cargoToml = fromTOML (builtins.readFile (finalAttrs.src + "/Cargo.toml")); + cargoLock = finalAttrs.src + "/Cargo.lock"; + in + { + pname = "tokei"; + version = cargoToml.package.version; + + src = fetchFromGitHub { + owner = "XAMPPRocky"; + repo = "tokei"; + rev = "v13.0.0-alpha.9"; + hash = "sha256-OSIJYSUwc8SvszEOMgt+d/ljCW2jtBkPw6buof4JpUc="; + }; + + cargoLock.lockFile = cargoLock; + + buildInputs = lib.optionals stdenv.isDarwin [ + libiconv + darwin.Security + ]; + + checkInputs = lib.optionals stdenv.isDarwin [ zlib ]; + + # enable all output formats + buildFeatures = [ "all" ]; + } +) diff --git a/npins/sources.json b/npins/sources.json index ce30894b..47811a38 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -32,6 +32,22 @@ "url": "https://api.github.com/repos/nix-community/disko/tarball/v1.11.0", "hash": "13brimg7z7k9y36n4jc1pssqyw94nd8qvgfjv53z66lv4xkhin92" }, + "dix": { + "type": "GitRelease", + "repository": { + "type": "GitHub", + "owner": "bloxx12", + "repo": "dix" + }, + "pre_releases": false, + "version_upper_bound": null, + "release_prefix": null, + "submodules": false, + "version": "v1.3.0", + "revision": "ba315562f8c4a957dc9c058d75a43419e3307f63", + "url": "https://api.github.com/repos/bloxx12/dix/tarball/v1.3.0", + "hash": "00gr8b6i9xis9kmbblvnafjpaa2hk18bs0i3pxisyzibp928bv2z" + }, "eepy": { "type": "Git", "repository": { @@ -84,9 +100,9 @@ }, "branch": "main", "submodules": false, - "revision": "17da13840dc71ba36b0deb2c0e85097840630ad5", - "url": "https://github.com/ghostty-org/ghostty/archive/17da13840dc71ba36b0deb2c0e85097840630ad5.tar.gz", - "hash": "1ifa8fiqgc4pc7dyzh31d5g0wrawxvrpnz7lcf2qxjfjv5jq0k63" + "revision": "45abfa91905a5dafdddb711dd9402d45947cdfbb", + "url": "https://github.com/ghostty-org/ghostty/archive/45abfa91905a5dafdddb711dd9402d45947cdfbb.tar.gz", + "hash": "1pmfsxd65yva3ij2v20xb5r1hf3mx6lqr593nivnvsi345jnfh1y" }, "hategroup-dnsbl": { "type": "Git", @@ -111,9 +127,9 @@ }, "branch": "release-25.11", "submodules": false, - "revision": "82fb7dedaad83e5e279127a38ef410bcfac6d77c", - "url": "https://github.com/nix-community/home-manager/archive/82fb7dedaad83e5e279127a38ef410bcfac6d77c.tar.gz", - "hash": "1rj0cazl5kjcfn4433fj31293yx421wbawryp5q3bq3fsmhkkr9h" + "revision": "6bd04da47cfb48dfd15eabf08364b78ad894f5b2", + "url": "https://github.com/nix-community/home-manager/archive/6bd04da47cfb48dfd15eabf08364b78ad894f5b2.tar.gz", + "hash": "1wvysqiybcyf2hzvvpja2522fqhk45554j0b07h3s7zhzc2056ia" }, "infuse": { "type": "GitRelease", @@ -181,9 +197,9 @@ }, "branch": "nixos-25.11-small", "submodules": false, - "revision": "ff8a91eb93e8abfceed1957330b54e54e99c747a", - "url": "https://github.com/nixos/nixpkgs/archive/ff8a91eb93e8abfceed1957330b54e54e99c747a.tar.gz", - "hash": "0j0410wjpkxix1sxfr3fpd60iqvjrkgydiis7rqr4g44y042dfns" + "revision": "a35a20f6d3d51b6b42b68a6879701f7d87381896", + "url": "https://github.com/nixos/nixpkgs/archive/a35a20f6d3d51b6b42b68a6879701f7d87381896.tar.gz", + "hash": "00781d4nhmqzvxph2lpsj3kika3v8y0nigfadr6y8lvzxrcppkfj" }, "nur": { "type": "Git", @@ -194,9 +210,9 @@ }, "branch": "main", "submodules": false, - "revision": "9aa5514ef92b980580f90029447ecc732851e2a9", - "url": "https://github.com/nix-community/nur/archive/9aa5514ef92b980580f90029447ecc732851e2a9.tar.gz", - "hash": "1dx6r4nz2dmv6lq34aig2pcgb74m00kq7ma60fm34jih67ldpcs0" + "revision": "68e3e935ba29960813ab1ecf2852a0ecbe8d5946", + "url": "https://github.com/nix-community/nur/archive/68e3e935ba29960813ab1ecf2852a0ecbe8d5946.tar.gz", + "hash": "02pmkhd6ram43qnmirh3z46w1l31rmm16mhkx36jaxhpnzlwgr2i" }, "pin-emacs28": { "type": "Git", @@ -333,9 +349,9 @@ }, "branch": "mistress", "submodules": false, - "revision": "861a5942932820291eba572cbe251866895e3655", - "url": "https://git.confusedcompiler.org/leana8959/wallpapers/archive/861a5942932820291eba572cbe251866895e3655.tar.gz", - "hash": "0p0q8v510zracsmymws88iv9qgxqyhiwlfcmln5p6yc8a7ra6p8y" + "revision": "ee12113e53e1b9b80638b6963a5b7075c3b81e93", + "url": "https://git.confusedcompiler.org/leana8959/wallpapers/archive/ee12113e53e1b9b80638b6963a5b7075c3b81e93.tar.gz", + "hash": "1pv17pvc60jkr8y7j8g3q0wmy5qgsjxsq1gv23yb3gf52g4z98sk" }, "wired-notify": { "type": "Git", @@ -359,9 +375,9 @@ }, "branch": "main", "submodules": false, - "revision": "5c9624f3d0176727284678aebf677770dd1375b2", - "url": "https://github.com/0xc000022070/zen-browser-flake/archive/5c9624f3d0176727284678aebf677770dd1375b2.tar.gz", - "hash": "1highzr36j8crd77y6331ggfm66n78075vj1rqhbbbxfq6aazkz8" + "revision": "350c729b261e6f5529460140a5f0943dd4c5e156", + "url": "https://github.com/0xc000022070/zen-browser-flake/archive/350c729b261e6f5529460140a5f0943dd4c5e156.tar.gz", + "hash": "1fbx200712rdz3b8c4acrz0ib8fd636bvsiyv4m31xqpfqpj3kza" } }, "version": 5