diff --git a/.config/nvim/syntax/ruler.vim b/.config/nvim/syntax/ruler.vim index 386b7e16..1554d4ef 100644 --- a/.config/nvim/syntax/ruler.vim +++ b/.config/nvim/syntax/ruler.vim @@ -10,15 +10,19 @@ syn match rulerLineComment "--.*$" syn match rulerTripleDot "\.\.\." syn match rulerDate "\d\d\d\d\D\d\d\D\d\d \d\d\D\d\d\D\(\d\d\|__\)" syn match rulerTag "\s\+[a-zA-Z]\+:[^\n]*" -syn match rulerImport "import" +syn keyword rulerImport import +syn keyword rulerType type +syn keyword rulerTimezone timezone -syn region rulerBlockComment start="{-" end="-}" +syn region rulerBlockComment start="{-" end="-}" contains=rulerBlockComment hi def link rulerLineComment Comment hi def link rulerBlockComment Comment hi def link rulerTripleDot Comment hi def link rulerDate Macro hi def link rulerImport Keyword +hi def link rulerType Keyword +hi def link rulerTimezone Keyword hi def link rulerTag @property let b:current_syntax = "ruler" diff --git a/nix/configurations/hetzner_benchmark.nix b/nix/configurations/hetzner_benchmark.nix index 2fddb026..6201e6f1 100644 --- a/nix/configurations/hetzner_benchmark.nix +++ b/nix/configurations/hetzner_benchmark.nix @@ -31,6 +31,9 @@ in # nixpkgs # { + # don't use `nixpkgs.flake.source`, it uses flake so it double fetches + nix.nixPath = [ "nixpkgs=${sources.nixpkgs}" ]; + nixpkgs = { overlays = map import [ ../packages/overlay.nix @@ -39,10 +42,6 @@ in ../overlays/lix.nix ../overlays/nix-monitored.nix ]; - - # Set NIX_PATH and flake registry at the same time - # https://github.com/NixOS/nixpkgs/pull/254405 - flake.source = sources.nixpkgs; }; nix.package = pkgs.nix-monitored; diff --git a/nix/configurations/hydrogen.nix b/nix/configurations/hydrogen.nix index c751ef0a..5a303423 100644 --- a/nix/configurations/hydrogen.nix +++ b/nix/configurations/hydrogen.nix @@ -34,6 +34,9 @@ in # nixpkgs # { + # don't use `nixpkgs.flake.source`, it uses flake so it double fetches + nix.nixPath = [ "nixpkgs=${sources.nixpkgs}" ]; + nixpkgs = { overlays = map import [ ../overlays/agenix.nix @@ -45,10 +48,6 @@ in ../overlays/lix.nix ../overlays/nix-monitored.nix ]; - - # Set NIX_PATH and flake registry at the same time - # https://github.com/NixOS/nixpkgs/pull/254405 - flake.source = sources.nixpkgs; }; nix.package = pkgs.nix-monitored; diff --git a/nix/configurations/vanadium.nix b/nix/configurations/vanadium.nix index 2fba0b2a..f881d389 100644 --- a/nix/configurations/vanadium.nix +++ b/nix/configurations/vanadium.nix @@ -35,6 +35,9 @@ in nix = { distributedBuilds = true; settings.builders-use-substitutes = true; + + # don't use `nixpkgs.flake.source`, it uses flake so it double fetches + nixPath = [ "nixpkgs=${sources.nixpkgs}" ]; }; nixpkgs = { @@ -70,10 +73,6 @@ in ../overlays/lix.nix ../overlays/nix-monitored.nix ]; - - # Set NIX_PATH and flake registry at the same time - # https://github.com/NixOS/nixpkgs/pull/254405 - flake.source = sources.nixpkgs; }; nix.package = pkgs.nix-monitored; diff --git a/nix/configurations/vanadium/home/programs.nix b/nix/configurations/vanadium/home/programs.nix index a2b44af7..f97136e1 100644 --- a/nix/configurations/vanadium/home/programs.nix +++ b/nix/configurations/vanadium/home/programs.nix @@ -85,6 +85,7 @@ pkgs.evolution pkgs.libreoffice pkgs.calibre + pkgs.foliate # TODO: replace calibre with foliate # pkgs.rawtherapee pkgs.digikam pkgs.gimp diff --git a/nix/configurations/vanadium/home/xmobar/xmobar.hs b/nix/configurations/vanadium/home/xmobar/xmobar.hs index 314f4d50..6479154e 100644 --- a/nix/configurations/vanadium/home/xmobar/xmobar.hs +++ b/nix/configurations/vanadium/home/xmobar/xmobar.hs @@ -73,9 +73,10 @@ config = , "--target", "2025-10-31=dragon book" , "--target", "2025-11-19=scalpel" , "--target", "2025-11-29=à deux" - , "--target", "2025-12-16=dragon book" + -- , "--target", "2025-12-15=campus baguette" + -- , "--target", "2025-12-16=dragon book" + , "--target", "2025-12-18=baguette" , "--target", "2025-12-30=seule" - , "--target", "2025-12-15=campus baguette" , "--target", "2026-02-02=monmaster" , "--target", "2026-02-22=dernier appel" ] diff --git a/nix/configurations/vanadium/home/xmonad/xmonad.hs b/nix/configurations/vanadium/home/xmonad/xmonad.hs index bd224647..415a0fc1 100644 --- a/nix/configurations/vanadium/home/xmonad/xmonad.hs +++ b/nix/configurations/vanadium/home/xmonad/xmonad.hs @@ -1,9 +1,11 @@ {-# LANGUAGE NegativeLiterals #-} +{-# OPTIONS_GHC -Wno-missing-signatures #-} -- my layout is getting crazy import XMonad import XMonad.Actions.CopyWindow import XMonad.Actions.Submap import XMonad.Actions.SwapWorkspaces +import XMonad.Actions.Warp import XMonad.Hooks.DynamicLog import XMonad.Hooks.EwmhDesktops import XMonad.Hooks.InsertPosition @@ -13,18 +15,22 @@ import XMonad.Hooks.OnPropertyChange import XMonad.Hooks.RefocusLast import XMonad.Hooks.StatusBar import XMonad.Layout.FocusTracking +import XMonad.Layout.IfMax +import XMonad.Layout.Magnifier hiding (Toggle) +import qualified XMonad.Layout.Magnifier as Mag import XMonad.Layout.NoBorders +import XMonad.Layout.PerWorkspace import XMonad.Layout.Reflect import XMonad.Layout.Reflect.Message import XMonad.Layout.Renamed import XMonad.Layout.ResizableTile import XMonad.Layout.Spacing +import XMonad.Layout.ToggleLayouts import qualified XMonad.StackSet as W import XMonad.Util.EZConfig import XMonad.Util.Hacks import XMonad.Util.NamedScratchpad import XMonad.Util.SpawnOnce -import XMonad.Layout.Magnifier import Data.Char.Greek import Data.Ratio @@ -62,14 +68,28 @@ main = `additionalKeys` keybinds myLayout = - let tallr = renamed [ Replace "Tall" ] - $ smartSpacingWithEdge 5 - $ reflectMsg . reflectHoriz - $ ResizableTall 1 (1/10) (3/7) [] - mag = magnifyxy 1.05 1.3 (NoMaster 3) False - in avoidStruts - $ smartBorders - $ mag tallr ||| focusTracking Full + avoidStruts + $ smartBorders + $ onWorkspace researchWS (toggleLayouts (mag tallr) full) + $ onWorkspace chatWS (toggleLayouts (mag tallr) full) + $ onWorkspace multimediaWS (toggleLayouts (mag tallr) full) + $ toggleLayouts (mag tallr) full + where + mag = magnifierOff + + full = focusTracking Full + + mkTallrN n = + smartSpacingWithEdge 5 + $ reflectMsg . reflectHoriz + $ ResizableTall n (1/10) (3/7) [] + + tallr = + renamed [ Replace "Tall" ] + $ ifMax 3 (mkTallrN 1) + $ ifMax 5 (mkTallrN 2) + $ ifMax 7 (mkTallrN 3) + $ mkTallrN 4 isSioyek :: Query Bool isSioyek = className =? "sioyek" @@ -264,17 +284,13 @@ keybinds = , ((0, xF86XK_AudioPlay), spawn "playerctl play-pause") , ((0, xF86XK_AudioNext), spawn "playerctl next" ) - -- Toggle fullscreen - , ((superMask, xK_Escape), sendMessage NextLayout) - -- Resize windows - , ((superMask, xK_equal ), sendMessage $ IncMasterN 1) - , ((superMask, xK_minus ), sendMessage $ IncMasterN -1) , ((superMask, xK_comma ), sendMessage Shrink ) , ((superMask, xK_period ), sendMessage Expand ) , ((superMask .|. shiftMask, xK_comma ), sendMessage MirrorShrink ) , ((superMask .|. shiftMask, xK_period), sendMessage MirrorExpand ) - , ((superMask , xK_apostrophe), sendMessage Toggle ) + , ((superMask , xK_apostrophe), sendMessage Mag.Toggle ) + , ((superMask , xK_space ), sendMessage ToggleLayout ) -- [D]o sink and lift , ( (superMask, xK_d) @@ -285,6 +301,19 @@ keybinds = ) ] + -- 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) + ++ (let warp = warpToWindow 0.5 0.5 + in [ ((superMask, xK_Tab ), windows W.focusDown >> warp) + , ((superMask .|. shiftMask, xK_Tab ), windows W.focusUp >> warp) + , ((superMask, xK_j ), windows W.focusDown >> warp) + , ((superMask, xK_k ), windows W.focusUp >> warp) + ] + ) + -- 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" @@ -343,12 +372,15 @@ altMask = mod1Mask myWorkspaces :: [WorkspaceId] myWorkspaces = map (:[]) $ take 8 greekLower -multimediaWS :: WorkspaceId -multimediaWS = myWorkspaces !! 6 +researchWS :: WorkspaceId +researchWS = myWorkspaces !! 2 chatWS :: WorkspaceId chatWS = myWorkspaces !! 3 +multimediaWS :: WorkspaceId +multimediaWS = myWorkspaces !! 6 + centeredFloat, smallFloat, fullFloat, buttomRightFloat :: W.RationalRect centeredFloat = W.RationalRect (1%9) (1%9) (7%9) (7%9) smallFloat = W.RationalRect (3%5) (3%5) (2%7) (2%7) diff --git a/nix/configurations/vanadium/nixos/programs.nix b/nix/configurations/vanadium/nixos/programs.nix index 74d4be3e..b3e3ec6d 100644 --- a/nix/configurations/vanadium/nixos/programs.nix +++ b/nix/configurations/vanadium/nixos/programs.nix @@ -78,4 +78,15 @@ ''; }; }; + + services.hoogle = { + enable = true; + packages = + haskellPackages: with haskellPackages; [ + optparse-applicative + megaparsec + tasty-golden + tree-diff + ]; + }; } diff --git a/nix/homeModules/common/zen-browser.nix b/nix/homeModules/common/zen-browser.nix index be5ded5b..4b2e2fbc 100644 --- a/nix/homeModules/common/zen-browser.nix +++ b/nix/homeModules/common/zen-browser.nix @@ -59,6 +59,9 @@ in # diff .zen/default/prefs.js{.bk,} profiles.default = { settings = { + # Zen specific + "zen.theme.content-element-separation" = 0; # Remove "borders" around window + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; "browser.tabs.loadInBackground" = true; "browser.ctrlTab.sortByRecentlyUsed" = false; diff --git a/nix/networks/list.nix b/nix/networks/list.nix index 4ec25b95..30401b42 100644 --- a/nix/networks/list.nix +++ b/nix/networks/list.nix @@ -6,6 +6,7 @@ in [ { ssid = "~"; + bssid = "de:ad:de:ad:d0:d0"; # dead dead dodo priority = preferredPriority; hasPassword = true; } @@ -80,6 +81,13 @@ in hasPassword = true; randomizeMac = true; } + { + ssid = "LouisaCoffee"; + bssid = "fa:92:bf:62:7c:19"; + priority = privatePriority; + hasPassword = true; + randomizeMac = true; + } { ssid = "MetroTaipei x Louisa"; # 大安 priority = privatePriority; diff --git a/nix/networks/wpa_supplicant-compat.nix b/nix/networks/wpa_supplicant-compat.nix index 65f130a0..2f57b267 100644 --- a/nix/networks/wpa_supplicant-compat.nix +++ b/nix/networks/wpa_supplicant-compat.nix @@ -13,6 +13,7 @@ let go = networkArgs@{ ssid, + bssid ? null, # Custom fields wrapping nixpkgs module options hasPassword ? false, scanOnLowSignal ? false, @@ -20,24 +21,31 @@ let ... }: { - ${ssid} = lib.mkMerge [ - (builtins.removeAttrs networkArgs [ - # We keep ssid, because it overrides the attrset name ssid - # "ssid" - "hasPassword" - "scanOnLowSignal" - "randomizeMac" - ]) - (lib.optionalAttrs hasPassword { - pskRaw = "ext:${escapePwdKey ssid}"; - }) - { - extraConfig = '' - ${lib.optionalString scanOnLowSignal "bgscan=\"simple:30:-70:3600\""} - ${lib.optionalString randomizeMac "mac_addr=1"} - ''; - } - ]; + ${ + # We use a unique key here to make sure no "same ssid different bssid" networks collide in key. + # This is ordered, we still show "null" so that it would come after hex characters [a-z0-9]. + # The serialization is based on string order. + "${ssid},${if bssid != null then bssid else "null"}" + } = + lib.mkMerge [ + (builtins.removeAttrs networkArgs [ + "hasPassword" + "scanOnLowSignal" + "randomizeMac" + ]) + (lib.optionalAttrs hasPassword { + pskRaw = "ext:${ + # this implies changing the external password key if you set a bssid! + escapePwdKey (if bssid == null then ssid else "${ssid},${bssid}") + }"; + }) + { + extraConfig = '' + ${lib.optionalString scanOnLowSignal "bgscan=\"simple:30:-70:3600\""} + ${lib.optionalString randomizeMac "mac_addr=1"} + ''; + } + ]; }; in ns: lib.mkMerge (map go ns) diff --git a/nix/packages/by-name/ruler/package.nix b/nix/packages/by-name/ruler/package.nix index 0e7d8aa9..8cd1efb4 100644 --- a/nix/packages/by-name/ruler/package.nix +++ b/nix/packages/by-name/ruler/package.nix @@ -1,3 +1,5 @@ +# Use the following to start a hoogle server for the project +# nix-shell -E 'with import ./. {}; packages.ruler.envFunc{withHoogle = true;}' --run "hoogle server --local" { haskellPackages, haskell, @@ -11,8 +13,8 @@ let domain = "git.confusedcompiler.org"; owner = "leana8959"; repo = "ruler"; - rev = "2556b4985065d093b1db3a14a2c5c37115871c78"; - hash = "sha256-OvNhDpyAbZp+d0rSXLE55BvM5jT3OI8q79D6aVaA2FI="; + rev = "72069c79bd6540fb9a1ee941fa2502edd6853af8"; + hash = "sha256-UQYx1WoWxASnWINtlTE2zMrADBketo/bgo5aud5j8Og="; }) { }; cabalOverrides = o: { diff --git a/nix/secrets/wpa_password.age b/nix/secrets/wpa_password.age index 17fe933a..3a79d0bc 100644 Binary files a/nix/secrets/wpa_password.age and b/nix/secrets/wpa_password.age differ diff --git a/npins/sources.json b/npins/sources.json index d84bc0d3..d02e14f7 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -114,9 +114,9 @@ }, "branch": "release-25.11", "submodules": false, - "revision": "3fdd076e08049a9c7a83149b270440d9787d2df5", - "url": "https://github.com/nix-community/home-manager/archive/3fdd076e08049a9c7a83149b270440d9787d2df5.tar.gz", - "hash": "07k47xnkzha7ilcyak57wrh2ngka2j4f0d95zyyxn8jz8195q2q6" + "revision": "20561be440a11ec57a89715480717baf19fe6343", + "url": "https://github.com/nix-community/home-manager/archive/20561be440a11ec57a89715480717baf19fe6343.tar.gz", + "hash": "1n2l891p04y3xmd0sl5i3553ndgpxkinysg1bf8iiixmxhcm7i9v" }, "infuse": { "type": "GitRelease", @@ -144,9 +144,9 @@ }, "branch": "main", "submodules": false, - "revision": "01e573c9e31ba3be7eaa848ba7dfcbd04260163e", - "url": "https://github.com/oxalica/nil/archive/01e573c9e31ba3be7eaa848ba7dfcbd04260163e.tar.gz", - "hash": "0j8dix0a29lmszpl0gpv9whrhigs9bj4s2is3rsdwqc6gviqsq92" + "revision": "504599f7e555a249d6754698473124018b80d121", + "url": "https://github.com/oxalica/nil/archive/504599f7e555a249d6754698473124018b80d121.tar.gz", + "hash": "1mzx60999jciq2ax1l5ajmks6fb3cmjavn7fsyh4aysvcdgzrj6p" }, "nix-monitored": { "type": "Git", @@ -173,10 +173,10 @@ "version_upper_bound": null, "release_prefix": null, "submodules": false, - "version": "v0.6.3", - "revision": "477021a0f5b2fce11cb73dde9ecce49094f56db0", - "url": "https://api.github.com/repos/utdemir/nix-tree/tarball/v0.6.3", - "hash": "1hzss0sqxhyjp1f8v1p2sqv1636943brwl2x0vn2f851xbb6kgz7" + "version": "v0.8.0", + "revision": "e7ef6623cf944b80e48196d74c6531dd79943652", + "url": "https://api.github.com/repos/utdemir/nix-tree/tarball/v0.8.0", + "hash": "1ag68xnszianrfinm56mf9bhvm0pglvnmlyffjr1pxrkji8d52nc" }, "nixos-hardware": { "type": "Git", @@ -200,9 +200,9 @@ }, "branch": "nixos-25.11-small", "submodules": false, - "revision": "e9f8538978f954bed00f6535b764e7932dbc3eea", - "url": "https://github.com/nixos/nixpkgs/archive/e9f8538978f954bed00f6535b764e7932dbc3eea.tar.gz", - "hash": "07wdninn693v06jz537pn1d257idi7p3dqh1mvygsb2zf6y4hypm" + "revision": "1acf2f172ef3d6e31c9913ccb7ba07b13dadfedc", + "url": "https://github.com/nixos/nixpkgs/archive/1acf2f172ef3d6e31c9913ccb7ba07b13dadfedc.tar.gz", + "hash": "1hhjz7jx0n0i2mxq9d3yvqvlmrwjklq1ljcfzpmnzyfhrixqg9y5" }, "nur": { "type": "Git", @@ -213,9 +213,9 @@ }, "branch": "main", "submodules": false, - "revision": "cdeb308c4faaa430f951e81db2360cebb54feb58", - "url": "https://github.com/nix-community/nur/archive/cdeb308c4faaa430f951e81db2360cebb54feb58.tar.gz", - "hash": "1jjsgmg3maqkrncwc3fn7iqcsi88fjvfzkpchcc1iwih65kr91il" + "revision": "e7844e0f24c76b6137e16ab95c9a7c275acf2fbb", + "url": "https://github.com/nix-community/nur/archive/e7844e0f24c76b6137e16ab95c9a7c275acf2fbb.tar.gz", + "hash": "10bz6b1j2d5z257xv8bjwdr1636f807f2gr24yaswxr55a7wdyk9" }, "pin-emacs28": { "type": "Git", @@ -378,9 +378,9 @@ }, "branch": "main", "submodules": false, - "revision": "8c9284cc227a5c7cd8f1e1fa7a6882b0907187c8", - "url": "https://github.com/0xc000022070/zen-browser-flake/archive/8c9284cc227a5c7cd8f1e1fa7a6882b0907187c8.tar.gz", - "hash": "1k0bxn3c9bsm5543wsijv6r73jb8c1a4pzcwqh7rjpn67n988hj2" + "revision": "1adab25828578301037855c59849e9bbecf8948b", + "url": "https://github.com/0xc000022070/zen-browser-flake/archive/1adab25828578301037855c59849e9bbecf8948b.tar.gz", + "hash": "091sdxgqxcmxh15w9b65bv29fw0cgg0mfpl3d1ymsv1510lq30a6" } }, "version": 5