From d033cb48e6f03b637e2e3ceeb47ddb96e197b4b3 Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 20 Dec 2023 14:01:11 +0100 Subject: [PATCH] better rust-analyzer --- flake.lock | 26 +++++++++++++------------- nixos/common/hm-modules/rust.nix | 3 +++ nixos/common/hm-modules/vscode.nix | 8 +++++--- nixos/common/modules/gnome/default.nix | 6 +++++- nixos/util.nix | 1 - 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/flake.lock b/flake.lock index 75456f3..aca1306 100644 --- a/flake.lock +++ b/flake.lock @@ -656,11 +656,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1702990449, - "narHash": "sha256-IU5ERslQmh3x0CWmBCq69kAJrmOAo+iRWXRGOFI4J1s=", + "lastModified": 1702994344, + "narHash": "sha256-aJPjexHm6bLo+ky1Rw9nDStgXBYuxuWPmo5DSdjj23s=", "ref": "refs/heads/main", - "rev": "47ce78481c94dfcd98848353b1a9b8eaa876fb80", - "revCount": 11, + "rev": "db96c4a4ebc05c8e4f1b427074fc5fe61c026998", + "revCount": 8, "type": "git", "url": "https://git.0x76.dev/v/gnome-autounlock-keyring.git" }, @@ -692,11 +692,11 @@ ] }, "locked": { - "lastModified": 1702937117, - "narHash": "sha256-4GjkL2D01bDg00UZN/SeGrnBZrDVOFeZTbQx6U702Vc=", + "lastModified": 1703026685, + "narHash": "sha256-AkualfMbc40HkDR2AZc6u71pcap50wDQOXFCY1ULDUA=", "owner": "nix-community", "repo": "home-manager", - "rev": "e8aaced73ebaf6bfa8e3c6ab0a19cb184bc4d798", + "rev": "efc177c15f2a8bb063aeb250fe3c7c21e1de265e", "type": "github" }, "original": { @@ -1125,11 +1125,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1702830618, - "narHash": "sha256-lvhwIvRwhOLgzbRuYkqHy4M5cQHYs4ktL6/hyuBS6II=", + "lastModified": 1703013332, + "narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "91a00709aebb3602f172a0bf47ba1ef013e34835", + "rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6", "type": "github" }, "original": { @@ -1239,11 +1239,11 @@ }, "nur": { "locked": { - "lastModified": 1702986248, - "narHash": "sha256-fcKATgZsuj89KGeqy/a+DaP66kcm5SPJ0OvciJ444nQ=", + "lastModified": 1703076631, + "narHash": "sha256-4QnntZP+6xaCkKGvSg57mRN3RtCzdR2i67C7R3AXld8=", "owner": "nix-community", "repo": "NUR", - "rev": "8f5265940d1c9f28cb55db6e1152e5dc2cc1a684", + "rev": "1367f14eadcb8a4fa6d15f773ff05f9dbd6065eb", "type": "github" }, "original": { diff --git a/nixos/common/hm-modules/rust.nix b/nixos/common/hm-modules/rust.nix index f1f5679..f489bd3 100644 --- a/nixos/common/hm-modules/rust.nix +++ b/nixos/common/hm-modules/rust.nix @@ -14,6 +14,9 @@ in { [build] rustc-wrapper = "${pkgs.sccache}/bin/sccache" + + [profile.rust-analyzer] + inherits = "dev" ''; }; diff --git a/nixos/common/hm-modules/vscode.nix b/nixos/common/hm-modules/vscode.nix index eabbaba..4e00381 100644 --- a/nixos/common/hm-modules/vscode.nix +++ b/nixos/common/hm-modules/vscode.nix @@ -16,15 +16,17 @@ in { "'DejaVuSansMono Nerd Font', 'monospace', monospace"; "keyboard.dispatch" = "keyCode"; "rust-analyzer.server.path" = "${pkgs.rust-analyzer}/bin/rust-analyzer"; + "rust-analyzer.check.extraArgs" = ["--profile" "rust-analyzer"]; + "rust-analyzer.check.command" = "clippy"; "terminal.integrated.defaultProfile.linux" = "zsh"; "nix.enableLanguageServer" = true; # Enable LSP. "nix.serverPath" = "${pkgs.nil}/bin/nil"; "[nix]" = { "editor.defaultFormatter" = "brettm12345.nixfmt-vscode"; }; "[python]" = { "editor.formatOnType" = true; }; - "rust-analyzer.checkOnSave.command" = "clippy"; "debug.allowBreakpointsEverywhere" = true; - "C_Cpp.clang_format_fallbackStyle" = "{ BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 0}"; - "crates.compatibleDecorator" = "✓"; + "C_Cpp.clang_format_fallbackStyle" = + "{ BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 0}"; + "crates.compatibleDecorator" = "✓"; "crates.errorDecorator" = "✗"; "crates.incompatibleDecorator" = "🛇"; # Don't index unecessary things diff --git a/nixos/common/modules/gnome/default.nix b/nixos/common/modules/gnome/default.nix index 67a6c14..39fb375 100644 --- a/nixos/common/modules/gnome/default.nix +++ b/nixos/common/modules/gnome/default.nix @@ -1,7 +1,11 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, inputs, ... }: with lib; let cfg = config.services.v.gnome; in { + imports = [ + inputs.gnome-autounlock-keyring.nixosModules.default + ]; + options.services.v.gnome = { enable = mkEnableOption "v.gnome"; hm = mkOption { diff --git a/nixos/util.nix b/nixos/util.nix index 067b19b..aacf4bf 100644 --- a/nixos/util.nix +++ b/nixos/util.nix @@ -18,7 +18,6 @@ let "vm" = [ ./common/generic-vm.nix ]; "local" = [ lanzaboote.nixosModules.lanzaboote - gnome-autounlock-keyring.nixosModules.default ./common/desktop ]; };