better rust-analyzer

This commit is contained in:
Vivian 2023-12-20 14:01:11 +01:00
parent ee4936465c
commit d033cb48e6
5 changed files with 26 additions and 18 deletions

26
flake.lock generated
View file

@ -656,11 +656,11 @@
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_4"
}, },
"locked": { "locked": {
"lastModified": 1702990449, "lastModified": 1702994344,
"narHash": "sha256-IU5ERslQmh3x0CWmBCq69kAJrmOAo+iRWXRGOFI4J1s=", "narHash": "sha256-aJPjexHm6bLo+ky1Rw9nDStgXBYuxuWPmo5DSdjj23s=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "47ce78481c94dfcd98848353b1a9b8eaa876fb80", "rev": "db96c4a4ebc05c8e4f1b427074fc5fe61c026998",
"revCount": 11, "revCount": 8,
"type": "git", "type": "git",
"url": "https://git.0x76.dev/v/gnome-autounlock-keyring.git" "url": "https://git.0x76.dev/v/gnome-autounlock-keyring.git"
}, },
@ -692,11 +692,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1702937117, "lastModified": 1703026685,
"narHash": "sha256-4GjkL2D01bDg00UZN/SeGrnBZrDVOFeZTbQx6U702Vc=", "narHash": "sha256-AkualfMbc40HkDR2AZc6u71pcap50wDQOXFCY1ULDUA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "e8aaced73ebaf6bfa8e3c6ab0a19cb184bc4d798", "rev": "efc177c15f2a8bb063aeb250fe3c7c21e1de265e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1125,11 +1125,11 @@
}, },
"nixpkgs_5": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1702830618, "lastModified": 1703013332,
"narHash": "sha256-lvhwIvRwhOLgzbRuYkqHy4M5cQHYs4ktL6/hyuBS6II=", "narHash": "sha256-+tFNwMvlXLbJZXiMHqYq77z/RfmpfpiI3yjL6o/Zo9M=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "91a00709aebb3602f172a0bf47ba1ef013e34835", "rev": "54aac082a4d9bb5bbc5c4e899603abfb76a3f6d6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1239,11 +1239,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1702986248, "lastModified": 1703076631,
"narHash": "sha256-fcKATgZsuj89KGeqy/a+DaP66kcm5SPJ0OvciJ444nQ=", "narHash": "sha256-4QnntZP+6xaCkKGvSg57mRN3RtCzdR2i67C7R3AXld8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "8f5265940d1c9f28cb55db6e1152e5dc2cc1a684", "rev": "1367f14eadcb8a4fa6d15f773ff05f9dbd6065eb",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -14,6 +14,9 @@ in {
[build] [build]
rustc-wrapper = "${pkgs.sccache}/bin/sccache" rustc-wrapper = "${pkgs.sccache}/bin/sccache"
[profile.rust-analyzer]
inherits = "dev"
''; '';
}; };

View file

@ -16,14 +16,16 @@ in {
"'DejaVuSansMono Nerd Font', 'monospace', monospace"; "'DejaVuSansMono Nerd Font', 'monospace', monospace";
"keyboard.dispatch" = "keyCode"; "keyboard.dispatch" = "keyCode";
"rust-analyzer.server.path" = "${pkgs.rust-analyzer}/bin/rust-analyzer"; "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"; "terminal.integrated.defaultProfile.linux" = "zsh";
"nix.enableLanguageServer" = true; # Enable LSP. "nix.enableLanguageServer" = true; # Enable LSP.
"nix.serverPath" = "${pkgs.nil}/bin/nil"; "nix.serverPath" = "${pkgs.nil}/bin/nil";
"[nix]" = { "editor.defaultFormatter" = "brettm12345.nixfmt-vscode"; }; "[nix]" = { "editor.defaultFormatter" = "brettm12345.nixfmt-vscode"; };
"[python]" = { "editor.formatOnType" = true; }; "[python]" = { "editor.formatOnType" = true; };
"rust-analyzer.checkOnSave.command" = "clippy";
"debug.allowBreakpointsEverywhere" = true; "debug.allowBreakpointsEverywhere" = true;
"C_Cpp.clang_format_fallbackStyle" = "{ BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 0}"; "C_Cpp.clang_format_fallbackStyle" =
"{ BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 0}";
"crates.compatibleDecorator" = ""; "crates.compatibleDecorator" = "";
"crates.errorDecorator" = ""; "crates.errorDecorator" = "";
"crates.incompatibleDecorator" = "🛇"; "crates.incompatibleDecorator" = "🛇";

View file

@ -1,7 +1,11 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, inputs, ... }:
with lib; with lib;
let cfg = config.services.v.gnome; let cfg = config.services.v.gnome;
in { in {
imports = [
inputs.gnome-autounlock-keyring.nixosModules.default
];
options.services.v.gnome = { options.services.v.gnome = {
enable = mkEnableOption "v.gnome"; enable = mkEnableOption "v.gnome";
hm = mkOption { hm = mkOption {

View file

@ -18,7 +18,6 @@ let
"vm" = [ ./common/generic-vm.nix ]; "vm" = [ ./common/generic-vm.nix ];
"local" = [ "local" = [
lanzaboote.nixosModules.lanzaboote lanzaboote.nixosModules.lanzaboote
gnome-autounlock-keyring.nixosModules.default
./common/desktop ./common/desktop
]; ];
}; };