Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions modules/shared/nix/config/nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
73 changes: 73 additions & 0 deletions modules/shared/nix/config/nixos/nh-unwrapped-package.nix
Original file line number Diff line number Diff line change
@@ -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
];
};
})
17 changes: 17 additions & 0 deletions nix/templates/parts/envrc
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions nix/templates/rust/envrc
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions users/frontear/home/programs/vscode/extensions.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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=";
Expand Down
12 changes: 11 additions & 1 deletion users/frontear/home/programs/vscode/settings.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
# ============================= VSCode Settings =============================

"editor.accessibilitySupport" = "off";
"editor.cursorBlinking" = "phase";
"editor.cursorSmoothCaretAnimation" = "on";
Expand Down Expand Up @@ -47,7 +49,15 @@
"workbench.secondarySideBar.defaultVisibility" = "hidden"; # stupid LLM chat
"workbench.startupEditor" = "newUntitledFile";

# Extensions
# ============================ VSCode Extensions ============================

"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";
Expand Down
Loading