Switches to nix-vscode-extensions

This commit is contained in:
Abhinav Sarkar 2024-09-14 12:15:52 +05:30
parent 4cba2579b4
commit 01dad766bb
5 changed files with 103 additions and 277 deletions

39
flake.lock generated
View File

@ -101,7 +101,9 @@
},
"lix-module": {
"inputs": {
"flake-utils": "flake-utils",
"flake-utils": [
"flake-utils"
],
"flakey-profile": "flakey-profile",
"lix": "lix",
"nixpkgs": [
@ -123,17 +125,16 @@
"monaspace-font": {
"flake": false,
"locked": {
"lastModified": 1699482037,
"narHash": "sha256-Zo56r0QoLwxwGQtcWP5cDlasx000G9BFeGINvvwEpQs=",
"lastModified": 1715284772,
"narHash": "sha256-wdGDv5IO6X4gB1maSdEzh92UXAb+BQauAqKWz+//dwE=",
"owner": "githubnext",
"repo": "monaspace",
"rev": "601eb27f902432999302e0e64db2daacc954f156",
"rev": "ac94165d2a6d5fb60f876c22989e986dcaaf8a87",
"type": "github"
},
"original": {
"owner": "githubnext",
"repo": "monaspace",
"rev": "601eb27f902432999302e0e64db2daacc954f156",
"type": "github"
}
},
@ -157,6 +158,32 @@
"type": "github"
}
},
"nix-vscode-extensions": {
"inputs": {
"flake-compat": [
"flake-compat"
],
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1726277723,
"narHash": "sha256-/Dk8qrBs9XE2kS3bbvKaq+EZTH9lTsSrkxx/MdTQZ4s=",
"owner": "nix-community",
"repo": "nix-vscode-extensions",
"rev": "42c1ec06e709349f11bec2b3c61a75018bd6b9b9",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-vscode-extensions",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1726142289,
@ -177,10 +204,12 @@
"inputs": {
"dm-mono-font": "dm-mono-font",
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"lix-module": "lix-module",
"monaspace-font": "monaspace-font",
"nix-darwin": "nix-darwin",
"nix-vscode-extensions": "nix-vscode-extensions",
"nixpkgs": "nixpkgs"
}
},

View File

@ -11,10 +11,18 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-vscode-extensions = {
url = "github:nix-community/nix-vscode-extensions";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-compat.follows = "flake-compat";
inputs.flake-utils.follows = "flake-utils";
};
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.90.0.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
@ -24,7 +32,7 @@
flake = false;
};
monaspace-font = {
url = "github:githubnext/monaspace?rev=601eb27f902432999302e0e64db2daacc954f156";
url = "github:githubnext/monaspace";
flake = false;
};
};

View File

@ -30,11 +30,7 @@ _switch: _build
# switch to latest home-manager generation
switch: (_run "_switch") && _report-changes
_update-vscode-extensions:
$NIXPKGS_PATH/pkgs/applications/editors/vscode/extensions/update_installed_exts.sh > \
{{ root_dir }}/programs/vscode/extensions.nix
_update: && _update-vscode-extensions _switch _brew-update _report-changes
_update: && _switch _brew-update _report-changes
nix flake update --commit-lock-file --flake {{ root_dir }}
_brew-update:

View File

@ -1,55 +1,62 @@
{ config, pkgs, ... }:
{ inputs, config, pkgs, ... }:
let
marketplaceExtensions = [
"cs128/cs128-clang-tidy"
"dawhite/mustache"
"donjayamanne/githistory"
"ivandemchenko/roc-lang-unofficial"
"kirozen/wordcounter"
"pedrorgirardi/vscode-cljfmt"
"viablelab/capitaliz"
"ms-python/python"
];
lib = pkgs.lib;
extension =
(inputs.nix-vscode-extensions.extensions.${pkgs.system}.forVSCodeVersion
pkgs.vscode.version);
marketplace-prerelease = extension.vscode-marketplace;
marketplace-release = extension.vscode-marketplace-release;
resolveExtension = ex:
let exParts = lib.strings.splitString "." ex;
in if lib.attrsets.hasAttrByPath exParts marketplace-release then
lib.attrsets.getAttrFromPath exParts marketplace-release
else
lib.attrsets.getAttrFromPath exParts marketplace-prerelease;
in {
programs.vscode = {
enable = true;
mutableExtensionsDir = false;
extensions = with pkgs.vscode-extensions;
[
pkgs.vscode-extensions."13xforever".language-x86-64-assembly
bierner.markdown-mermaid
davidanson.vscode-markdownlint
dotjoshjohnson.xml
esbenp.prettier-vscode
golang.go
haskell.haskell
jdinhlife.gruvbox
jebbs.plantuml
jnoortheen.nix-ide
justusadam.language-haskell
kamikillerto.vscode-colorize
llvm-vs-code-extensions.vscode-clangd
mesonbuild.mesonbuild
mkhl.direnv
ms-python.black-formatter
ms-python.debugpy
ms-python.vscode-pylance
rust-lang.rust-analyzer
skellock.just
streetsidesoftware.code-spell-checker
tamasfe.even-better-toml
timonwong.shellcheck
twxs.cmake
tyriar.sort-lines
vadimcn.vscode-lldb
wmaurer.change-case
zhuangtongfa.material-theme
ziglang.vscode-zig
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace (builtins.filter
({ publisher, name, ... }: builtins.elem (publisher + "/" + name) marketplaceExtensions)
(import ./vscode/extensions.nix).extensions);
extensions = builtins.map resolveExtension [
"13xforever.language-x86-64-assembly"
"bierner.markdown-mermaid"
"cs128.cs128-clang-tidy"
"davidanson.vscode-markdownlint"
"dawhite.mustache"
"donjayamanne.githistory"
"dotjoshjohnson.xml"
"esbenp.prettier-vscode"
"golang.go"
"haskell.haskell"
"ivandemchenko.roc-lang-unofficial"
"jdinhlife.gruvbox"
"jebbs.plantuml"
"jnoortheen.nix-ide"
"justusadam.language-haskell"
"kamikillerto.vscode-colorize"
"kirozen.wordcounter"
"llvm-vs-code-extensions.vscode-clangd"
"mesonbuild.mesonbuild"
"mkhl.direnv"
"ms-python.black-formatter"
"ms-python.debugpy"
"ms-python.python"
"ms-python.vscode-pylance"
"pedrorgirardi.vscode-cljfmt"
"rust-lang.rust-analyzer"
"skellock.just"
"streetsidesoftware.code-spell-checker"
"tamasfe.even-better-toml"
"timonwong.shellcheck"
"twxs.cmake"
"tyriar.sort-lines"
"vadimcn.vscode-lldb"
"viablelab.capitalize"
"wmaurer.change-case"
"zhuangtongfa.material-theme"
"ziglang.vscode-zig"
];
userSettings = {
debug.console.fontSize = 13;
@ -59,7 +66,8 @@ in {
accessibilitySupport = "off";
bracketPairColorization.enabled = true;
folding = false;
fontFamily = "'DM Mono', NanumGothicCoding, Menlo, Monaco, 'Courier New', monospace";
fontFamily =
"'DM Mono', NanumGothicCoding, Menlo, Monaco, 'Courier New', monospace";
fontLigatures = true;
fontSize = 13;
guides = {
@ -107,17 +115,14 @@ in {
plugin.tactics.config.timeout_duration = 5;
};
roc-lang.language-server.exe = "/nix/store/1m7xfjx1b79s39cxl52aq77z22yffs4a-roc-0.0.1/bin/roc_language_server";
roc-lang.language-server.exe =
"/nix/store/1m7xfjx1b79s39cxl52aq77z22yffs4a-roc-0.0.1/bin/roc_language_server";
nix = {
formatterPath = "${pkgs.nixfmt}/bin/nixfmt";
enableLanguageServer = true;
serverPath = "nixd";
serverSettings = {
nixd = {
formatting.command = [ "nixfmt" ];
};
};
serverSettings = { nixd = { formatting.command = [ "nixfmt" ]; }; };
};
oneDarkPro = {
@ -137,7 +142,8 @@ in {
terminal.integrated = {
copyOnSelection = true;
fontFamily = "'DM Mono', NanumGothicCoding, Menlo, Monaco, 'Courier New', monospace";
fontFamily =
"'DM Mono', NanumGothicCoding, Menlo, Monaco, 'Courier New', monospace";
scrollback = 10000;
shell.osx = "${pkgs.fish}/bin/fish";
shellIntegration.enabled = true;

View File

@ -1,213 +0,0 @@
{ extensions = [
{
name = "language-x86-64-assembly";
publisher = "13xforever";
version = "3.1.4";
sha256 = "1kvy9kxgnm6r9973zyk65z5w2a54dh2iclm091gv067pa6dl750l";
}
{
name = "markdown-mermaid";
publisher = "bierner";
version = "1.24.0";
sha256 = "1zdvcjii90680q86ksqmg6bdg0sc7rwbzaamnpxqh8hhk6f8ikw2";
}
{
name = "cs128-clang-tidy";
publisher = "cs128";
version = "0.5.1";
sha256 = "1f2r3k6z33chsfav51j2qsn14lyjz645ffzvi5ic5mhi3v6j48hl";
}
{
name = "vscode-markdownlint";
publisher = "davidanson";
version = "0.56.0";
sha256 = "17cz1nnb94qngnq9mwzc5i78sj27ab945lap4837gn9pxlysjd11";
}
{
name = "mustache";
publisher = "dawhite";
version = "1.1.1";
sha256 = "1j8qn5grg8v3n3v66d8c77slwpdr130xzpv06z1wp2bmxhqsck1y";
}
{
name = "xml";
publisher = "dotjoshjohnson";
version = "2.5.1";
sha256 = "1v4x6yhzny1f8f4jzm4g7vqmqg5bqchyx4n25mkgvw2xp6yls037";
}
{
name = "prettier-vscode";
publisher = "esbenp";
version = "11.0.0";
sha256 = "1fcz8f4jgnf24kblf8m8nwgzd5pxs2gmrv235cpdgmqz38kf9n54";
}
{
name = "go";
publisher = "golang";
version = "0.43.1";
sha256 = "1dib2qp56l7awpr6a7g7lkdmsrv2zhhh5fi5hjqkbvb28rsdl3i7";
}
{
name = "haskell";
publisher = "haskell";
version = "2.5.3";
sha256 = "13s39fvb6kwxklcfsa5xh4z7y8y3y0h6jv39ljrgl24qkwgx8xnw";
}
{
name = "roc-lang-unofficial";
publisher = "ivandemchenko";
version = "1.2.0";
sha256 = "0q9w0sv4988wh4p4vmf45jab614ggkd7qfjphdnlmnqcald7mhwl";
}
{
name = "gruvbox";
publisher = "jdinhlife";
version = "1.19.1";
sha256 = "0vffkmcsgxl6220y1lvvf3fd2xgn0ll3pkq8g7fqxf0kmz5hhkcs";
}
{
name = "plantuml";
publisher = "jebbs";
version = "2.18.1";
sha256 = "0y0fmdb5s6wk7ll7sa4acs6q6wkjjiw04vry5zcrsaq4ypz4v0d3";
}
{
name = "nix-ide";
publisher = "jnoortheen";
version = "0.3.5";
sha256 = "12sg67mn3c8mjayh9d6y8qaky00vrlnwwx58v1f1m4qrbdjqab46";
}
{
name = "language-haskell";
publisher = "justusadam";
version = "3.6.0";
sha256 = "115y86w6n2bi33g1xh6ipz92jz5797d3d00mr4k8dv5fz76d35dd";
}
{
name = "vscode-colorize";
publisher = "kamikillerto";
version = "0.11.1";
sha256 = "1h82b1jz86k2qznprng5066afinkrd7j3738a56idqr3vvvqnbsm";
}
{
name = "wordcounter";
publisher = "kirozen";
version = "2.4.4";
sha256 = "1df6qkvyhw2k1wmy9z3kr56bcljyr8yqdvxd5vjfh579s1k370ch";
}
{
name = "vscode-clangd";
publisher = "llvm-vs-code-extensions";
version = "0.1.29";
sha256 = "1vvrpkwz33ppdsyscwvbzsg3bc1i2amqw5dybs0qsf560l7y7nwm";
}
{
name = "mesonbuild";
publisher = "mesonbuild";
version = "1.26.0";
sha256 = "02p58hvdvz6h61j0prbq91cwz5pv00q2g6pmqkz3gjmzcxkqjwrl";
}
{
name = "direnv";
publisher = "mkhl";
version = "0.17.0";
sha256 = "1n2qdd1rspy6ar03yw7g7zy3yjg9j1xb5xa4v2q12b0y6dymrhgn";
}
{
name = "black-formatter";
publisher = "ms-python";
version = "2024.3.12071014";
sha256 = "1vfchsyza1gm88xrfgis0svmq03qs25cs76h8dkdr2vjhdi5lm6c";
}
{
name = "debugpy";
publisher = "ms-python";
version = "2024.11.2024082901";
sha256 = "0a5c888qpm0q6c7h8g8xc96grl3l340diif6nxd9n57wfim2z8sh";
}
{
name = "python";
publisher = "ms-python";
version = "2024.15.2024091202";
sha256 = "0w2lw6404clwihx0n77dxp2r43f3lk87nqkvlija9wq06w4fg886";
}
{
name = "vscode-pylance";
publisher = "ms-python";
version = "2024.9.100";
sha256 = "004ifi68f2p91kq6h5k9i5r5lrx37v6ck10sbh95wdab86m04qfl";
}
{
name = "vscode-cljfmt";
publisher = "pedrorgirardi";
version = "1.5.0";
sha256 = "1l4v3xs10y4z9fa2nshvqwzmf3a10va37k7yq5pgp8inlg01kff5";
}
{
name = "rust-analyzer";
publisher = "rust-lang";
version = "0.4.2108";
sha256 = "0hjq77qv8jg3fcl8dfgpj6aplq9h66wsflrq3yg6d6mzw8zwwfh0";
}
{
name = "just";
publisher = "skellock";
version = "2.0.0";
sha256 = "1ph869zl757a11f8iq643f79h8gry7650a9i03mlxyxlqmspzshl";
}
{
name = "code-spell-checker";
publisher = "streetsidesoftware";
version = "4.0.13";
sha256 = "0rscnclf3j1f2xxn3db99myw3jl1bxpapx4h5nd6sd85s3n20mpi";
}
{
name = "even-better-toml";
publisher = "tamasfe";
version = "0.19.2";
sha256 = "0q9z98i446cc8bw1h1mvrddn3dnpnm2gwmzwv2s3fxdni2ggma14";
}
{
name = "shellcheck";
publisher = "timonwong";
version = "0.37.1";
sha256 = "0jvi9pzw80ga47p9zy92wy43prci5dj8lfa5syxl5cvchd3848v1";
}
{
name = "cmake";
publisher = "twxs";
version = "0.0.17";
sha256 = "11hzjd0gxkq37689rrr2aszxng5l9fwpgs9nnglq3zhfa1msyn08";
}
{
name = "sort-lines";
publisher = "tyriar";
version = "1.11.0";
sha256 = "0c8y2b64gsfbwjy6yvzkz86vj9vqhsrf50ah0645yybc737hzzig";
}
{
name = "vscode-lldb";
publisher = "vadimcn";
version = "1.10.0";
sha256 = "0s7lwvq7fmd2hms6qlbvq0g17gaf896kqkphdazp3l5h8knay0j4";
}
{
name = "change-case";
publisher = "wmaurer";
version = "1.0.0";
sha256 = "0dxsdahyivx1ghxs6l9b93filfm8vl5q2sa4g21fiklgdnaf7pxl";
}
{
name = "material-theme";
publisher = "zhuangtongfa";
version = "3.17.3";
sha256 = "1ay471r05na6ripcgsirsa7zj16qldwvlb0mb812w4h8n2v6vdgl";
}
{
name = "vscode-zig";
publisher = "ziglang";
version = "0.5.9";
sha256 = "0pa7rn0y31vcllijb1qigmsajvfdvlk2vgmvcyh8jkyh08cci85l";
}
];
}