aboutsummaryrefslogtreecommitdiff
path: root/snowfall/modules/home/apps/vscode/default.nix
blob: bf4b5da1f8af81105bc3ed478f6b8389304769e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{ options, config, lib, pkgs, namespace, ... }:

with lib; with lib.${namespace}; let
  cfg = config.${namespace}.apps.vscode;
in {
  options.${namespace}.apps.vscode = with types; {
    enable = mkEnableOption "vscode";
  };

  config = mkIf cfg.enable {
    programs.vscode = {
      enable = true;
      package = pkgs.vscodium;

      extensions = with pkgs.vscode-extensions; [
        jdinhlife.gruvbox
        vscode-icons-team.vscode-icons

        jnoortheen.nix-ide
        golang.go
        ziglang.vscode-zig
      ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
        {
          name = "shader";
          publisher = "slevesque";
          version = "1.1.5";
          sha256 = "sha256-Pf37FeQMNlv74f7LMz9+CKscF6UjTZ7ZpcaZFKtX2ZM=";
        }
        {
          name = "yuck";
          publisher = "eww-yuck";
          version = "0.0.3";
          sha256 = "sha256-DITgLedaO0Ifrttu+ZXkiaVA7Ua5RXc4jXQHPYLqrcM=";
        }
      ];

      userSettings = {
        "workbench.colorTheme" = "Gruvbox Dark Medium";
        "workbench.iconTheme" = "vscode-icons";
        "window.titleBarStyle" = "custom";
        "editor.fontFamily" = "monospace";

        "git.confirmSync" = false;

        "vsicons.dontShowNewVersionMessage" = true;

        "files.associations" = {
          "*.vsh" = "glsl";
          "*.fsh" = "glsl";
          "*.gsh" = "glsl";
        };

        # Zig
        "zig.initialSetupDone" = true;
        "zig.path" = "";
        "zig.formattingProvider" = "off";

        "zig.zls.path" = "";
        "zig.zls.enableAutofix" = false;
        "zig.zls.enableInlayHints" = false;
      };
    };

    xdg.desktopEntries.nixeditor = {
      name = "NixOS Config";
      genericName = "Edit in VSCode";
      icon = "nix-snowflake";
      exec = "${pkgs.vscodium}/bin/codium /etc/nixos";
    };

    home.shellAliases = {
      "c" = "codium .";
    };
  };
}