diff --git a/devenv.lock b/devenv.lock index 459ff89..11b13c1 100644 --- a/devenv.lock +++ b/devenv.lock @@ -17,6 +17,27 @@ "type": "github" } }, + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1716704729, + "owner": "nix-community", + "repo": "fenix", + "rev": "aaa27b4cf3729b6562cd4dd65ba24eeda3731002", + "treeHash": "0e081193f8806dc1d70eff224cc18dba1b039b71", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -56,17 +77,17 @@ }, "nixpkgs": { "locked": { - "lastModified": 1716715802, - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e2dd4e18cc1c7314e24154331bae07df76eb582f", - "treeHash": "52be98f562d6c56c7dceffc946d3b96f29a1b95b", + "lastModified": 1713361204, + "owner": "cachix", + "repo": "devenv-nixpkgs", + "rev": "285676e87ad9f0ca23d8714a6ab61e7e027020c6", + "treeHash": "50354b35a3e0277d4a83a0a88fa0b0866b5f392f", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", + "owner": "cachix", + "ref": "rolling", + "repo": "devenv-nixpkgs", "type": "github" } }, @@ -112,9 +133,27 @@ "root": { "inputs": { "devenv": "devenv", + "fenix": "fenix", "nixpkgs": "nixpkgs", "pre-commit-hooks": "pre-commit-hooks" } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1716714715, + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "71a816a90facb6546a0a06010da17598e11812f7", + "treeHash": "a60ed07e9e6ed952ddc28e275ac107758dd20262", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } } }, "root": "root", diff --git a/devenv.nix b/devenv.nix index f32b9c2..6a61d04 100644 --- a/devenv.nix +++ b/devenv.nix @@ -6,5 +6,17 @@ deadnix.enable = true; }; - packages = with pkgs; [alejandra deadnix nil]; + packages = with pkgs; [alejandra deadnix nil zsh]; + + languages.rust = { + enable = true; + # https://devenv.sh/reference/options/#languagesrustchannel + channel = "nightly"; + + components = ["rustc" "cargo" "clippy" "rustfmt" "rust-analyzer"]; + }; + + scripts = { + update-vscode-extensions.exec = "zsh ./scripts/get-vscodium-version/main.sh"; + }; } diff --git a/devenv.yaml b/devenv.yaml index c7cb5ce..b8fc639 100644 --- a/devenv.yaml +++ b/devenv.yaml @@ -1,3 +1,6 @@ inputs: - nixpkgs: - url: github:NixOS/nixpkgs/nixpkgs-unstable + fenix: + url: github:nix-community/fenix + inputs: + nixpkgs: + follows: nixpkgs \ No newline at end of file diff --git a/home/applications/vscode/default.nix b/home/applications/vscode/default.nix index df53e2e..472e38e 100644 --- a/home/applications/vscode/default.nix +++ b/home/applications/vscode/default.nix @@ -1,9 +1,13 @@ { - inputs, - system, pkgs, + lib, ... -}: { +}: let + plugins = (import ./extensions.lock) { + pkgs = pkgs; + lib = lib; + }; +in { imports = [ ./javascript.nix ./markdown.nix @@ -15,53 +19,53 @@ package = pkgs.vscodium; enableUpdateCheck = false; enableExtensionUpdateCheck = false; - extensions = with inputs.nix-vscode-extensions.extensions.${system}; [ + extensions = with plugins; [ # General extensions ## Code Completion - vscode-marketplace-release.github.copilot - vscode-marketplace-release.github.copilot-chat + github.copilot + github.copilot-chat ## Development Environment - vscode-marketplace.ms-toolsai.jupyter - vscode-marketplace.ms-vscode-remote.remote-containers + ms-toolsai.jupyter + ms-vscode-remote.remote-containers ## Error Checking - vscode-marketplace.usernamehw.errorlens + usernamehw.errorlens ## Export and Visualisation - vscode-marketplace.ibm.output-colorizer - vscode-marketplace.nobuhito.printcode - vscode-marketplace.pnp.polacode + ibm.output-colorizer + nobuhito.printcode + pnp.polacode ## Git - vscode-marketplace.lamartire.git-indicators - vscode-marketplace.mhutchie.git-graph + lamartire.git-indicators + mhutchie.git-graph ## Miscelaneous - vscode-marketplace.britesnow.vscode-toggle-quotes - vscode-marketplace.mrmlnc.vscode-duplicate - vscode-marketplace.qcz.text-power-tools + britesnow.vscode-toggle-quotes + mrmlnc.vscode-duplicate + qcz.text-power-tools # Language extensions ## CSV - vscode-marketplace.mechatroner.rainbow-csv + mechatroner.rainbow-csv ## Python - vscode-marketplace.ms-python.python + ms-python.python ## Rust language extensions - vscode-marketplace.rust-lang.rust-analyzer - vscode-marketplace.serayuzgur.crates - vscode-marketplace.tamasfe.even-better-toml - vscode-marketplace.vadimcn.vscode-lldb + rust-lang.rust-analyzer + serayuzgur.crates + tamasfe.even-better-toml + vadimcn.vscode-lldb ## SVG - vscode-marketplace.jock.svg + jock.svg ## Tex - vscode-marketplace.james-yu.latex-workshop + james-yu.latex-workshop ]; userSettings = { "editor.linkedEditing" = true; diff --git a/home/applications/vscode/extensions.lock b/home/applications/vscode/extensions.lock new file mode 100644 index 0000000..66dee67 --- /dev/null +++ b/home/applications/vscode/extensions.lock @@ -0,0 +1,270 @@ +{ pkgs, lib }: + +let + inherit (pkgs.stdenv) isDarwin isLinux isi686 isx86_64 isAarch32 isAarch64; + vscode-utils = pkgs.vscode-utils; + merge = lib.attrsets.recursiveUpdate; +in +merge + (merge + (merge + (merge + { + "vadimcn"."vscode-lldb" = (vscode-utils.buildVscodeExtension { + name = "vadimcn.vscode-lldb"; + vscodeExtPublisher = "vadimcn"; + vscodeExtName = "vscode-lldb"; + src = (pkgs.fetchurl { + url = "https://github.com/vadimcn/codelldb/releases/download/v1.10.0/codelldb-x86_64-linux.vsix"; + sha256 = "1jhjs2na8cjhd4yqib1vij33094sgf6lsxg9i13f2x0rh4czyayi"; + name = "vadimcn.vscode-lldb.zip"; + }).outPath; + vscodeExtUniqueId = "vadimcn.vscode-lldb"; + version = "1.10.0"; + }); + "ms-python"."python" = vscode-utils.extensionFromVscodeMarketplace { + name = "python"; + publisher = "ms-python"; + version = "2024.5.11021008"; + sha256 = "11mnnbdl7cqr18s2cvv2132rrq1f5zslnihp5i2jpa2awjak8wjj"; + }; + "esbenp"."prettier-vscode" = vscode-utils.extensionFromVscodeMarketplace { + name = "prettier-vscode"; + publisher = "esbenp"; + version = "10.4.0"; + sha256 = "1iy7i0yxnhizz40llnc1dk9q8kk98rz6ki830sq7zj3ak9qp9vzk"; + }; + "ms-vscode-remote"."remote-containers" = vscode-utils.extensionFromVscodeMarketplace { + name = "remote-containers"; + publisher = "ms-vscode-remote"; + version = "0.366.0"; + sha256 = "0mk4fc0vr4igl1lbvdrqgfs6qfbkyqkki2rbix8vmqq97jp3zmqj"; + }; + "github"."copilot" = vscode-utils.extensionFromVscodeMarketplace { + name = "copilot"; + publisher = "github"; + version = "1.195.897"; + sha256 = "0kk7z5aw234dgknasx3z48xgqg9facx8rxzcbywwl0jd0snq52gr"; + }; + "github"."copilot-chat" = vscode-utils.extensionFromVscodeMarketplace { + name = "copilot-chat"; + publisher = "github"; + version = "0.14.2024032901"; + sha256 = "11148fibdhl86gaqswvk4rd8dqhxm430ng4qwl7lr3xrcch7p8zv"; + }; + "yzhang"."markdown-all-in-one" = vscode-utils.extensionFromVscodeMarketplace { + name = "markdown-all-in-one"; + publisher = "yzhang"; + version = "3.6.2"; + sha256 = "1n9d3qh7vypcsfygfr5rif9krhykbmbcgf41mcjwgjrf899f11h4"; + }; + "mhutchie"."git-graph" = vscode-utils.extensionFromVscodeMarketplace { + name = "git-graph"; + publisher = "mhutchie"; + version = "1.30.0"; + sha256 = "000zhgzijf3h6abhv4p3cz99ykj6489wfn81j0s691prr8q9lxxh"; + }; + "christian-kohler"."npm-intellisense" = vscode-utils.extensionFromVscodeMarketplace { + name = "npm-intellisense"; + publisher = "christian-kohler"; + version = "1.4.5"; + sha256 = "1av0iwym6j5l2a522ikyjkrsyp4q3sws1d7y9brm3gdgghd8aawn"; + }; + "mechatroner"."rainbow-csv" = vscode-utils.extensionFromVscodeMarketplace { + name = "rainbow-csv"; + publisher = "mechatroner"; + version = "3.12.0"; + sha256 = "1i453fdwjcbhn0zl8h8hmcbzf18m7r30v6qbnhlsxqfs6arxlwd6"; + }; + "davidanson"."vscode-markdownlint" = vscode-utils.extensionFromVscodeMarketplace { + name = "vscode-markdownlint"; + publisher = "davidanson"; + version = "0.55.0"; + sha256 = "00rx55aapb7w6wazc3kyl8gzvfyr5d0flrwgxfz1pffw2dywfmxj"; + }; + "usernamehw"."errorlens" = vscode-utils.extensionFromVscodeMarketplace { + name = "errorlens"; + publisher = "usernamehw"; + version = "3.17.0"; + sha256 = "12fjvhfx837wv07qf1xh18y5fd220zz10i541jzjnsm4ig6h0h8k"; + }; + "james-yu"."latex-workshop" = vscode-utils.extensionFromVscodeMarketplace { + name = "latex-workshop"; + publisher = "james-yu"; + version = "9.20.1"; + sha256 = "084m2wh8qf871bskjnbkinqpx2nj5r74g5rnwibvc7qzgr1r8fx5"; + }; + "mgmcdermott"."vscode-language-babel" = vscode-utils.extensionFromVscodeMarketplace { + name = "vscode-language-babel"; + publisher = "mgmcdermott"; + version = "0.0.40"; + sha256 = "18pr0jg62ddb23b6pfq5fxr9mff2ylhw46apcd5616km0122swr5"; + }; + "tamasfe"."even-better-toml" = vscode-utils.extensionFromVscodeMarketplace { + name = "even-better-toml"; + publisher = "tamasfe"; + version = "0.19.2"; + sha256 = "0q9z98i446cc8bw1h1mvrddn3dnpnm2gwmzwv2s3fxdni2ggma14"; + }; + "svelte"."svelte-vscode" = vscode-utils.extensionFromVscodeMarketplace { + name = "svelte-vscode"; + publisher = "svelte"; + version = "108.4.1"; + sha256 = "1yfwg9f1npyd8avmjvwimrnr34p9xp1d3cjxdh95ymjgdrlpgig8"; + }; + "jock"."svg" = vscode-utils.extensionFromVscodeMarketplace { + name = "svg"; + publisher = "jock"; + version = "1.5.3"; + sha256 = "0315qgc824acyrl146wwph5c8blpmqvbjg7njqavly0g9jk2p5ib"; + }; + "pnp"."polacode" = vscode-utils.extensionFromVscodeMarketplace { + name = "polacode"; + publisher = "pnp"; + version = "0.3.4"; + sha256 = "0l9cm4jrjjrgrsqc0n0awi0xbgyk4sp08pddw5bnfnrsxwhs0kmv"; + }; + "serayuzgur"."crates" = vscode-utils.extensionFromVscodeMarketplace { + name = "crates"; + publisher = "serayuzgur"; + version = "0.6.6"; + sha256 = "1w9vpr0c1aj6m61dmfwwnix2nvna4xmv6iscsam7hbhci3a0fyhx"; + }; + "ibm"."output-colorizer" = vscode-utils.extensionFromVscodeMarketplace { + name = "output-colorizer"; + publisher = "ibm"; + version = "0.1.2"; + sha256 = "0i9kpnlk3naycc7k8gmcxas3s06d67wxr3nnyv5hxmsnsx5sfvb7"; + }; + "mrmlnc"."vscode-duplicate" = vscode-utils.extensionFromVscodeMarketplace { + name = "vscode-duplicate"; + publisher = "mrmlnc"; + version = "1.2.1"; + sha256 = "1iz9nh19xw3d2c2h0c46dy4ps4gxchaa7spjjgckkc6cg9vxy3cq"; + }; + "bpruitt-goddard"."mermaid-markdown-syntax-highlighting" = vscode-utils.extensionFromVscodeMarketplace { + name = "mermaid-markdown-syntax-highlighting"; + publisher = "bpruitt-goddard"; + version = "1.6.4"; + sha256 = "1fc18r99dk0ywfv15xnsjhikld9sgbv8m8pgbir6y6x8g4ilqb6f"; + }; + "nobuhito"."printcode" = vscode-utils.extensionFromVscodeMarketplace { + name = "printcode"; + publisher = "nobuhito"; + version = "3.0.0"; + sha256 = "0nms3fd401mimg9ansnqadnmg77f3n3xh98bpcqxhln4562rmv9b"; + }; + "yatki"."vscode-surround" = vscode-utils.extensionFromVscodeMarketplace { + name = "vscode-surround"; + publisher = "yatki"; + version = "1.5.0"; + sha256 = "1jk6z4qxbmvq8pz3nl6pfnyqnx6awby523m5k6q9g0433swpm0g0"; + }; + "britesnow"."vscode-toggle-quotes" = vscode-utils.extensionFromVscodeMarketplace { + name = "vscode-toggle-quotes"; + publisher = "britesnow"; + version = "0.3.6"; + sha256 = "1fys7a2g7g2qdwg7r8hv728pya8a3jiq8r6vkh0g0y5qdn9wqz8y"; + }; + "tauri-apps"."tauri-vscode" = vscode-utils.extensionFromVscodeMarketplace { + name = "tauri-vscode"; + publisher = "tauri-apps"; + version = "0.2.6"; + sha256 = "03nfyiac562kpndy90j7vc49njmf81rhdyhjk9bxz0llx4ap3lrv"; + }; + "liamhammett"."inline-parameters" = vscode-utils.extensionFromVscodeMarketplace { + name = "inline-parameters"; + publisher = "liamhammett"; + version = "0.2.1"; + sha256 = "02fv46pnjsp79jm88zd6m60b99vl29q4x7dlbmjzzsr68czr85p8"; + }; + "qcz"."text-power-tools" = vscode-utils.extensionFromVscodeMarketplace { + name = "text-power-tools"; + publisher = "qcz"; + version = "1.47.1"; + sha256 = "13ab30w7kcivz6b2hydqxzd4glxqa1frcyrgj2j133x75nnxchwy"; + }; + "lamartire"."git-indicators" = vscode-utils.extensionFromVscodeMarketplace { + name = "git-indicators"; + publisher = "lamartire"; + version = "2.1.2"; + sha256 = "13bayq2nl3q0rzwq9bqc5jw13l71aq8laxi32bcab4xnw3pcamky"; + }; + "jnoortheen"."nix-ide" = vscode-utils.extensionFromVscodeMarketplace { + name = "nix-ide"; + publisher = "jnoortheen"; + version = "0.3.1"; + sha256 = "1cpfckh6zg8byi6x1llkdls24w9b0fvxx4qybi9zfcy5gc60r6nk"; + }; + "kamadorueda"."alejandra" = vscode-utils.extensionFromVscodeMarketplace { + name = "alejandra"; + publisher = "kamadorueda"; + version = "1.0.0"; + sha256 = "1ncjzhrc27c3cwl2cblfjvfg23hdajasx8zkbnwx5wk6m2649s88"; + }; + } + (lib.attrsets.optionalAttrs (isLinux && (isi686 || isx86_64)) { + "ms-toolsai"."jupyter" = vscode-utils.extensionFromVscodeMarketplace { + name = "jupyter"; + publisher = "ms-toolsai"; + version = "2024.4.2024041101"; + sha256 = "1r9jbhl12pn0xydv3q1vwfyvvcly4w5jkn6qa9ll0pv05larix97"; + arch = "linux-x64"; + }; + "rust-lang"."rust-analyzer" = vscode-utils.extensionFromVscodeMarketplace { + name = "rust-analyzer"; + publisher = "rust-lang"; + version = "0.4.1974"; + sha256 = "0li8qbqdaz9aqckvdgsq2kbhs50aaxbqbvixc1cipgiribn7wcz4"; + arch = "linux-x64"; + }; + })) + (lib.attrsets.optionalAttrs (isLinux && (isAarch32 || isAarch64)) { + "ms-toolsai"."jupyter" = vscode-utils.extensionFromVscodeMarketplace { + name = "jupyter"; + publisher = "ms-toolsai"; + version = "2024.4.2024041101"; + sha256 = "1qq7n9phnfz6dxlfcwvz70bv4470bi9zxpyn58my9p35f2mjl0b0"; + arch = "linux-arm64"; + }; + "rust-lang"."rust-analyzer" = vscode-utils.extensionFromVscodeMarketplace { + name = "rust-analyzer"; + publisher = "rust-lang"; + version = "0.4.1974"; + sha256 = "102cb169f8a25rqsnys8775vh7rzq6kbna6csvsfykyp7fbp2clr"; + arch = "linux-arm64"; + }; + })) + (lib.attrsets.optionalAttrs (isDarwin && (isi686 || isx86_64)) { + "ms-toolsai"."jupyter" = vscode-utils.extensionFromVscodeMarketplace { + name = "jupyter"; + publisher = "ms-toolsai"; + version = "2024.4.2024041101"; + sha256 = "1fvarldc3rx2qy5f9y4gxh55wrjg9ppxjks0mjfp2h6sf7r1xrwk"; + arch = "darwin-x64"; + }; + "rust-lang"."rust-analyzer" = vscode-utils.extensionFromVscodeMarketplace { + name = "rust-analyzer"; + publisher = "rust-lang"; + version = "0.4.1974"; + sha256 = "0qkwa9hzi92d6h018b3w7d8cxz6dpl5n8r3p5qmqk9527w93x10b"; + arch = "darwin-x64"; + }; + })) + (lib.attrsets.optionalAttrs (isDarwin && (isAarch32 || isAarch64)) { + "ms-toolsai"."jupyter" = vscode-utils.extensionFromVscodeMarketplace { + name = "jupyter"; + publisher = "ms-toolsai"; + version = "2024.4.2024041101"; + sha256 = "1cxlp3q57dc5li1kkx82n27bv5bcvfl4gmksyrsxkxvig7z9jski"; + arch = "darwin-arm64"; + }; + "rust-lang"."rust-analyzer" = vscode-utils.extensionFromVscodeMarketplace { + name = "rust-analyzer"; + publisher = "rust-lang"; + version = "0.4.1974"; + sha256 = "0j4m1mylj9s7wnzi129g00si2758qq4s4865k29lxrzpya0fy7jl"; + arch = "darwin-arm64"; + }; + }) + diff --git a/home/applications/vscode/extensions.toml b/home/applications/vscode/extensions.toml new file mode 100644 index 0000000..c139175 --- /dev/null +++ b/home/applications/vscode/extensions.toml @@ -0,0 +1,133 @@ +vscode_version = "1.88.1" + +[[extensions]] +publisher_name = "github" +extension_name = "copilot" + +[[extensions]] +publisher_name = "github" +extension_name = "copilot-chat" + +[[extensions]] +publisher_name = "ms-toolsai" +extension_name = "jupyter" + +[[extensions]] +publisher_name = "ms-vscode-remote" +extension_name = "remote-containers" + +[[extensions]] +publisher_name = "usernamehw" +extension_name = "errorlens" + +[[extensions]] +publisher_name = "ibm" +extension_name = "output-colorizer" + +[[extensions]] +publisher_name = "nobuhito" +extension_name = "printcode" + +[[extensions]] +publisher_name = "pnp" +extension_name = "polacode" + +[[extensions]] +publisher_name = "lamartire" +extension_name = "git-indicators" + +[[extensions]] +publisher_name = "mhutchie" +extension_name = "git-graph" + +[[extensions]] +publisher_name = "britesnow" +extension_name = "vscode-toggle-quotes" + +[[extensions]] +publisher_name = "mrmlnc" +extension_name = "vscode-duplicate" + +[[extensions]] +publisher_name = "qcz" +extension_name = "text-power-tools" + +[[extensions]] +publisher_name = "mechatroner" +extension_name = "rainbow-csv" + +[[extensions]] +publisher_name = "ms-python" +extension_name = "python" + +[[extensions]] +publisher_name = "rust-lang" +extension_name = "rust-analyzer" + +[[extensions]] +publisher_name = "serayuzgur" +extension_name = "crates" + +[[extensions]] +publisher_name = "tamasfe" +extension_name = "even-better-toml" + +[[extensions]] +publisher_name = "vadimcn" +extension_name = "vscode-lldb" + +[[extensions]] +publisher_name = "jock" +extension_name = "svg" + +[[extensions]] +publisher_name = "james-yu" +extension_name = "latex-workshop" + +[[extensions]] +publisher_name = "christian-kohler" +extension_name = "npm-intellisense" + +[[extensions]] +publisher_name = "esbenp" +extension_name = "prettier-vscode" + +[[extensions]] +publisher_name = "liamhammett" +extension_name = "inline-parameters" + +[[extensions]] +publisher_name = "mgmcdermott" +extension_name = "vscode-language-babel" + +[[extensions]] +publisher_name = "yatki" +extension_name = "vscode-surround" + +[[extensions]] +publisher_name = "svelte" +extension_name = "svelte-vscode" + +[[extensions]] +publisher_name = "tauri-apps" +extension_name = "tauri-vscode" + +[[extensions]] +publisher_name = "bpruitt-goddard" +extension_name = "mermaid-markdown-syntax-highlighting" + +[[extensions]] +publisher_name = "davidanson" +extension_name = "vscode-markdownlint" + +[[extensions]] +publisher_name = "yzhang" +extension_name = "markdown-all-in-one" + +[[extensions]] +publisher_name = "jnoortheen" +extension_name = "nix-ide" + +[[extensions]] +publisher_name = "kamadorueda" +extension_name = "alejandra" \ No newline at end of file diff --git a/home/applications/vscode/javascript.nix b/home/applications/vscode/javascript.nix index 782bb76..7ae77a6 100644 --- a/home/applications/vscode/javascript.nix +++ b/home/applications/vscode/javascript.nix @@ -1,22 +1,27 @@ { - inputs, - system, + pkgs, + lib, ... -}: { +}: let + plugins = (import ./extensions.lock) { + pkgs = pkgs; + lib = lib; + }; +in { programs.vscode = { - extensions = with inputs.nix-vscode-extensions.extensions.${system}; [ + extensions = with plugins; [ # General - vscode-marketplace.christian-kohler.npm-intellisense - vscode-marketplace.esbenp.prettier-vscode - vscode-marketplace.liamhammett.inline-parameters - vscode-marketplace.mgmcdermott.vscode-language-babel - vscode-marketplace.yatki.vscode-surround + christian-kohler.npm-intellisense + esbenp.prettier-vscode + liamhammett.inline-parameters + mgmcdermott.vscode-language-babel + yatki.vscode-surround # Svelte - vscode-marketplace.svelte.svelte-vscode + svelte.svelte-vscode # Tauri - vscode-marketplace.tauri-apps.tauri-vscode + tauri-apps.tauri-vscode ]; userSettings = { "[javascript]"."editor.defaultFormatter" = "esbenp.prettier-vscode"; diff --git a/home/applications/vscode/markdown.nix b/home/applications/vscode/markdown.nix index 2fd9df6..cbabc78 100644 --- a/home/applications/vscode/markdown.nix +++ b/home/applications/vscode/markdown.nix @@ -1,14 +1,19 @@ { - inputs, - system, + pkgs, + lib, ... -}: { +}: let + plugins = (import ./extensions.lock) { + pkgs = pkgs; + lib = lib; + }; +in { programs.vscode = { - extensions = with inputs.nix-vscode-extensions.extensions.${system}; [ + extensions = with plugins; [ # General - vscode-marketplace.bpruitt-goddard.mermaid-markdown-syntax-highlighting - vscode-marketplace.davidanson.vscode-markdownlint - vscode-marketplace.yzhang.markdown-all-in-one + bpruitt-goddard.mermaid-markdown-syntax-highlighting + davidanson.vscode-markdownlint + yzhang.markdown-all-in-one ]; userSettings = { "github.copilot.enable" = { diff --git a/home/applications/vscode/nix.nix b/home/applications/vscode/nix.nix index fcb6c0f..b17f5fc 100644 --- a/home/applications/vscode/nix.nix +++ b/home/applications/vscode/nix.nix @@ -1,9 +1,13 @@ { - inputs, - system, pkgs, + lib, ... -}: { +}: let + plugins = (import ./extensions.lock) { + pkgs = pkgs; + lib = lib; + }; +in { home.packages = with pkgs; [ nil alejandra @@ -11,9 +15,9 @@ ]; programs.vscode = { - extensions = with inputs.nix-vscode-extensions.extensions.${system}; [ - vscode-marketplace.jnoortheen.nix-ide - vscode-marketplace.kamadorueda.alejandra + extensions = with plugins; [ + jnoortheen.nix-ide + kamadorueda.alejandra ]; userSettings = { "nix.enableLanguageServer" = true; diff --git a/scripts/get-vscodium-version/main.sh b/scripts/get-vscodium-version/main.sh new file mode 100644 index 0000000..c76b067 --- /dev/null +++ b/scripts/get-vscodium-version/main.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +echo "Updating vscode version in ./home/applications/vscode/extensions.toml" +sed -i "s/^vscode_version = .*/vscode_version = \"$(echo ":lf .#" | nix repl <<< "inputs.nixpkgs.legacyPackages.x86_64-linux.pkgs.vscodium.version" | grep -oP '(?<=")[0-9]+\.[0-9]+\.[0-9]+' | grep -v '^$')\"/" ./home/applications/vscode/extensions.toml + + + +echo "Updating extension versions in ./home/applications/vscode/extensions.toml" +cargo run --manifest-path ./scripts/nix4vscode/Cargo.toml -- ./home/applications/vscode/extensions.toml > ./home/applications/vscode/extensions.lock \ No newline at end of file