From 72e83b531a210f592a6bf81b13cca5e0aafbc393 Mon Sep 17 00:00:00 2001 From: Ali Rizvi Date: Wed, 25 Feb 2026 13:22:45 -0500 Subject: [PATCH 1/5] feat: add support for Canadian English to VSCode cSpell The base extension only supports US and UK English; other languages need to be installed as separate extensions. Nixpkgs only has German and French packaged, so I had to pull it myself locally. I think it'd be a good idea for me to submit the other languages up to Nixpkgs at some point in the future. --- users/frontear/home/programs/vscode/extensions.nix | 7 +++++++ users/frontear/home/programs/vscode/settings.nix | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/users/frontear/home/programs/vscode/extensions.nix b/users/frontear/home/programs/vscode/extensions.nix index 8842341..b0b18cd 100644 --- a/users/frontear/home/programs/vscode/extensions.nix +++ b/users/frontear/home/programs/vscode/extensions.nix @@ -391,6 +391,13 @@ publisher = "streetsidesoftware"; version = "4.5.6"; } + { + arch = ""; + hash = "sha256-QSlmYzV7N/k8VhSOPfRqrPHp++6wVqgjnX9kAiyH+jo="; + name = "code-spell-checker-canadian-english"; + publisher = "streetsidesoftware"; + version = "1.1.31"; + } { arch = ""; hash = "sha256-7+Yo6X+t56tnZzepBKEo5hJdgLxiF3+83hSFqpkhVpA="; diff --git a/users/frontear/home/programs/vscode/settings.nix b/users/frontear/home/programs/vscode/settings.nix index 80f53d4..432ac07 100644 --- a/users/frontear/home/programs/vscode/settings.nix +++ b/users/frontear/home/programs/vscode/settings.nix @@ -1,4 +1,6 @@ { + # ============================= VSCode Settings ============================= + "editor.accessibilitySupport" = "off"; "editor.cursorBlinking" = "phase"; "editor.cursorSmoothCaretAnimation" = "on"; @@ -47,7 +49,9 @@ "workbench.secondarySideBar.defaultVisibility" = "hidden"; # stupid LLM chat "workbench.startupEditor" = "newUntitledFile"; - # Extensions + # ============================ VSCode Extensions ============================ + + "cSpell.language" = "en,en-CA"; "nix.enableLanguageServer" = true; "nix.serverPath" = "nixd"; From 1b9a942502300d5f9f8a830b54abd2f08027e5a3 Mon Sep 17 00:00:00 2001 From: Ali Rizvi Date: Wed, 4 Mar 2026 15:02:07 -0500 Subject: [PATCH 2/5] feat: bump flake.lock Everything works completely fine with no changes required. I saw some minor version updates but nothing particularly noteworthy in that regard. --- flake.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index 2e83686..f96dc71 100644 --- a/flake.lock +++ b/flake.lock @@ -135,11 +135,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1769996383, - "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", + "lastModified": 1772408722, + "narHash": "sha256-rHuJtdcOjK7rAHpHphUb1iCvgkU3GpfvicLMwwnfMT0=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", + "rev": "f20dc5d9b8027381c474144ecabc9034d6a839a3", "type": "github" }, "original": { @@ -211,11 +211,11 @@ ] }, "locked": { - "lastModified": 1771683283, - "narHash": "sha256-WxAEkAbo8dP7qiyPM6VN4ZGAxfuBVlNBNPkrqkrXVEc=", + "lastModified": 1772633327, + "narHash": "sha256-jl+DJB2DUx7EbWLRng+6HNWW/1/VQOnf0NsQB4PlA7I=", "owner": "nix-community", "repo": "home-manager", - "rev": "c6ed3eab64d23520bcbb858aa53fe2b533725d4a", + "rev": "5a75730e6f21ee624cbf86f4915c6e7489c74acc", "type": "github" }, "original": { @@ -266,11 +266,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1771474897, - "narHash": "sha256-Uh3suNG2251bfHqTqTbBnDLerFaeNWk3p4NIO/URhuc=", + "lastModified": 1772597558, + "narHash": "sha256-bGnGX7QgcoGcm3P6zBQMwgMfyTyTjCNA/0msN54LEoA=", "owner": "nix-community", "repo": "nixos-facter", - "rev": "13db4bd9a10003ddce9f0165365910e06d3c7991", + "rev": "8cfebfe0c14658abeab21bf0c9cd89d6e9486ba4", "type": "github" }, "original": { @@ -296,11 +296,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1771369470, - "narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=", + "lastModified": 1772542754, + "narHash": "sha256-WGV2hy+VIeQsYXpsLjdr4GvHv5eECMISX1zKLTedhdg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0182a361324364ae3f436a63005877674cf45efb", + "rev": "8c809a146a140c5c8806f13399592dbcb1bb5dc4", "type": "github" }, "original": { @@ -312,11 +312,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1769909678, - "narHash": "sha256-cBEymOf4/o3FD5AZnzC3J9hLbiZ+QDT/KDuyHXVJOpM=", + "lastModified": 1772328832, + "narHash": "sha256-e+/T/pmEkLP6BHhYjx6GmwP5ivonQQn0bJdH9YrRB+Q=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "72716169fe93074c333e8d0173151350670b824c", + "rev": "c185c7a5e5dd8f9add5b2f8ebeff00888b070742", "type": "github" }, "original": { @@ -383,11 +383,11 @@ "tinted-zed": "tinted-zed" }, "locked": { - "lastModified": 1771626923, - "narHash": "sha256-Mn6oeKrY+Sw6kH0jK+hp5QQH4MTcqwBRQL/ScZDNcz8=", + "lastModified": 1772296853, + "narHash": "sha256-pAtzPsgHRKw/2Kv8HgAjSJg450FDldHPWsP3AKG/Xj0=", "owner": "nix-community", "repo": "stylix", - "rev": "b09847414b50c65788936199918272377f70fb91", + "rev": "c4b8e80a1020e09a1f081ad0f98ce804a6e85acf", "type": "github" }, "original": { From 3789360b6c9898894e84f94e6d96534c7349a917 Mon Sep 17 00:00:00 2001 From: Ali Rizvi Date: Thu, 5 Mar 2026 16:11:17 -0500 Subject: [PATCH 3/5] feat: configure Java extension to stop misbehaving The extension seems to get confused when there are too many different `*.java` files lying around, and on occasion isn't able to correctly determine if the project is using Gradle, which causes it to misbehave (example being that it creates `bin` folders with the compiled `.class` files, rather than leaving that to Gradle). Forcing it to be selected manually is a safer, albiet slightly more tedious option. Furthermore, the extension doesn't automatically reload the project when Gradle files change, which is usually something that people would want, hence I'm enabling that by default. --- users/frontear/home/programs/vscode/settings.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/users/frontear/home/programs/vscode/settings.nix b/users/frontear/home/programs/vscode/settings.nix index 432ac07..4c4decd 100644 --- a/users/frontear/home/programs/vscode/settings.nix +++ b/users/frontear/home/programs/vscode/settings.nix @@ -53,6 +53,12 @@ "cSpell.language" = "en,en-CA"; + # Automatically reload gradle project when changed. + "java.configuration.updateBuildConfiguration" = "automatic"; + # Extension gets confused when multiple *.java files exist and misconfigures + # the workspace, so it's better to set it manually. + "java.import.projectSelection" = "manual"; + "nix.enableLanguageServer" = true; "nix.serverPath" = "nixd"; From c01b5b8551410f66b5a14a946be760cd16e30604 Mon Sep 17 00:00:00 2001 From: Ali Rizvi Date: Mon, 9 Mar 2026 15:33:34 -0400 Subject: [PATCH 4/5] fix: rollback nh to avoid specialisation issue In the latest version of nh (version 4.3.0), some changes were done to simplify the process of configuration switching, which broke how specialisations were setup. Currently, if you don't invoke nh with `--no-specialisation`, nh will not attempt to install the specialisation, and will instead only install whatever you're currently booted into. That means, if I run `nh os boot .` from GNOME, then only GNOME is installed, which is obviously a problem. In an effort to avoid the issue entirely, I'm simply rolling back to version 4.2.0. Once the issue has been resolved upstream, I'll bump back to the latest. --- modules/shared/nix/config/nixos/default.nix | 7 ++ .../nix/config/nixos/nh-unwrapped-package.nix | 73 +++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 modules/shared/nix/config/nixos/nh-unwrapped-package.nix diff --git a/modules/shared/nix/config/nixos/default.nix b/modules/shared/nix/config/nixos/default.nix index 38d0679..fe02152 100644 --- a/modules/shared/nix/config/nixos/default.nix +++ b/modules/shared/nix/config/nixos/default.nix @@ -28,6 +28,13 @@ in { { # Use github:viperML/nh as our "nix wrapper" program. programs.nh.enable = true; + # TODO: remove when the issue regarding specialisations not being setup + # is fixed upstream. + # + # see: https://github.com/nix-community/nh/issues/586 + programs.nh.package = pkgs.nh.override { + nh-unwrapped = pkgs.callPackage ./nh-unwrapped-package.nix {}; + }; # Set the system Nix package to our custom wrapper, which provides # instant access to all `pkgs` and `lib` attributes. diff --git a/modules/shared/nix/config/nixos/nh-unwrapped-package.nix b/modules/shared/nix/config/nixos/nh-unwrapped-package.nix new file mode 100644 index 0000000..c6e2fa7 --- /dev/null +++ b/modules/shared/nix/config/nixos/nh-unwrapped-package.nix @@ -0,0 +1,73 @@ +# from: https://github.com/NixOS/nixpkgs/blob/3fd978b5845d7475033f46cee2ed400f9300133d/pkgs/by-name/nh/nh-unwrapped/package.nix +{ + stdenv, + lib, + rustPlatform, + installShellFiles, + fetchFromGitHub, + fetchpatch, + nix-update-script, + buildPackages, +}: +rustPlatform.buildRustPackage (finalAttrs: { + pname = "nh-unwrapped"; + version = "4.2.0"; # Did you remove the patch below (and this comment)? + + src = fetchFromGitHub { + owner = "nix-community"; + repo = "nh"; + tag = "v${finalAttrs.version}"; + hash = "sha256-6n5SVO8zsdVTD691lri7ZcO4zpqYFU8GIvjI6dbxkA8="; + }; + + patches = [ + (fetchpatch { + url = "https://github.com/nix-community/nh/commit/8bf323483166797a204579a43ed8810113eb128c.patch"; + hash = "sha256-hg0LgDPjiPWR+1DRzqORv6QPlrds7ys4PTDXFw6PUoI="; + }) + ]; + + strictDeps = true; + + nativeBuildInputs = [ + installShellFiles + ]; + + postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ( + let + emulator = stdenv.hostPlatform.emulator buildPackages; + in + '' + mkdir completions + + for shell in bash zsh fish; do + NH_NO_CHECKS=1 ${emulator} $out/bin/nh completions $shell > completions/nh.$shell + done + + installShellCompletion completions/* + + cargo xtask man --out-dir gen + installManPage gen/nh.1 + '' + ); + + cargoHash = "sha256-cxZsePgraYevuYQSi3hTU2EsiDyn1epSIcvGi183fIU="; + + passthru.updateScript = nix-update-script { }; + + env.NH_REV = finalAttrs.src.tag; + + meta = { + changelog = "https://github.com/nix-community/nh/blob/${finalAttrs.version}/CHANGELOG.md"; + description = "Yet another nix cli helper"; + homepage = "https://github.com/nix-community/nh"; + license = lib.licenses.eupl12; + mainProgram = "nh"; + maintainers = with lib.maintainers; [ + NotAShelf + mdaniels5757 + viperML + midischwarz12 + ]; + }; +}) \ No newline at end of file From f2109ecb4e8402b0f85618576772a0c810da35af Mon Sep 17 00:00:00 2001 From: Ali Rizvi Date: Wed, 11 Mar 2026 14:16:07 -0400 Subject: [PATCH 5/5] feat: add placeholder envrc files for templates The reason I am adding these is because they include a very nice snippet (courtesy of a fellow NixOS user) that can sync the revisions of certain flake inputs from the system registry for that localized flake. This de-duplicates the various nixpkgs flake inputs that I have by making them mostly all consistent, but without using the weird semantics of the flake registry in the flake inputs directly. --- nix/templates/parts/envrc | 17 +++++++++++++++++ nix/templates/rust/envrc | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 nix/templates/parts/envrc create mode 100644 nix/templates/rust/envrc diff --git a/nix/templates/parts/envrc b/nix/templates/parts/envrc new file mode 100644 index 0000000..c9e8796 --- /dev/null +++ b/nix/templates/parts/envrc @@ -0,0 +1,17 @@ +# If an existing lock file isn't found, one is created which attempts to sync +# the revisions of `flake-parts` and `nixpkgs` for this local flake with the +# revisions found in the system registry. +# +# Thank you @waffle8946 for this snippet. +# see: https://discourse.nixos.org/t/using-the-global-registry-to-create-the-initial-flake-lock/76098/2 +if [ ! -f $PWD/flake.lock ]; then + FLAKE_PARTS_REF=$(nix flake metadata flake-parts --json | nix run nixpkgs#jq -- -r ".locked.rev") + NIXPKGS_REF=$(nix flake metadata nixpkgs --json | nix run nixpkgs#jq -- -r ".locked.rev") + + nix flake update \ + --override-input flake-parts github:hercules-ci/flake-parts/$FLAKE_PARTS_REF \ + --override-input nixpkgs github:NixOS/nixpkgs/$NIXPKGS_REF +fi + +watch_dir nix +use flake \ No newline at end of file diff --git a/nix/templates/rust/envrc b/nix/templates/rust/envrc new file mode 100644 index 0000000..cc0f50c --- /dev/null +++ b/nix/templates/rust/envrc @@ -0,0 +1,19 @@ +# If an existing lock file isn't found, one is created which attempts to sync +# the revisions of `flake-parts` and `nixpkgs` for this local flake with the +# revisions found in the system registry. +# +# Thank you @waffle8946 for this snippet. +# see: https://discourse.nixos.org/t/using-the-global-registry-to-create-the-initial-flake-lock/76098/2 +if [ ! -f $PWD/flake.lock ]; then + FLAKE_PARTS_REF=$(nix flake metadata flake-parts --json | nix run nixpkgs#jq -- -r ".locked.rev") + NIXPKGS_REF=$(nix flake metadata nixpkgs --json | nix run nixpkgs#jq -- -r ".locked.rev") + + nix flake update \ + --override-input flake-parts github:hercules-ci/flake-parts/$FLAKE_PARTS_REF \ + --override-input nixpkgs github:NixOS/nixpkgs/$NIXPKGS_REF +fi + +export CARGO_HOME="$(direnv_layout_dir)/cargo" + +watch_dir nix +use flake \ No newline at end of file