From 6c80ca150176749ac74d5b2ff4ecfe5eaa0b44e5 Mon Sep 17 00:00:00 2001 From: winston Date: Mon, 19 Jun 2023 23:49:03 +0200 Subject: [PATCH] feat(vscode): use `nix-community/nix-vscode-extensions` --- flake.lock | 54 ++++++++++++++++++++++++++++---------------- flake.nix | 21 +++++++++++++---- home/apps/vscode.nix | 4 ++-- machines/lib.nix | 1 + 4 files changed, 55 insertions(+), 25 deletions(-) diff --git a/flake.lock b/flake.lock index 8631d18..b8caebc 100644 --- a/flake.lock +++ b/flake.lock @@ -22,7 +22,7 @@ }, "crane": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "flake-utils": "flake-utils_2", "nixpkgs": [ "nekowinston-nur", @@ -97,22 +97,6 @@ "type": "github" } }, - "flake-compat_3": { - "flake": false, - "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -245,6 +229,32 @@ "type": "github" } }, + "nix-vscode-extensions": { + "inputs": { + "flake-compat": [ + "flake-compat" + ], + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1687137792, + "narHash": "sha256-9QRiBKZSV3t7hBjB3crmiAa2Iv5gYn2Vv+WYsBWyzX4=", + "owner": "nix-community", + "repo": "nix-vscode-extensions", + "rev": "3a01e46709256197c29c285a8231948e5dfc04a5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-vscode-extensions", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1687103638, @@ -312,7 +322,9 @@ }, "pre-commit-hooks": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": [ + "flake-compat" + ], "flake-utils": [ "flake-utils" ], @@ -342,11 +354,13 @@ "inputs": { "caarlos0-nur": "caarlos0-nur", "darwin": "darwin", + "flake-compat": "flake-compat", "flake-parts": "flake-parts", "flake-utils": "flake-utils", "home-manager": "home-manager", "nekowinston-nur": "nekowinston-nur", "nix-index-database": "nix-index-database", + "nix-vscode-extensions": "nix-vscode-extensions", "nixpkgs": "nixpkgs_2", "nur": "nur", "pre-commit-hooks": "pre-commit-hooks", @@ -406,7 +420,9 @@ }, "swayfx": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": [ + "flake-compat" + ], "nixpkgs": [ "nixpkgs" ] diff --git a/flake.nix b/flake.nix index efe1551..2861254 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,12 @@ nekowinston-nur.url = "github:nekowinston/nur"; caarlos0-nur.url = "github:caarlos0/nur"; caarlos0-nur.inputs.nixpkgs.follows = "nixpkgs"; + nix-vscode-extensions = { + url = "github:nix-community/nix-vscode-extensions"; + inputs.flake-compat.follows = "flake-compat"; + inputs.flake-utils.follows = "flake-utils"; + inputs.nixpkgs.follows = "nixpkgs"; + }; sops.url = "github:Mic92/sops-nix"; sops.inputs.nixpkgs.follows = "nixpkgs"; @@ -20,12 +26,19 @@ nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; swayfx.url = "github:willpower3309/swayfx"; + swayfx.inputs.flake-compat.follows = "flake-compat"; swayfx.inputs.nixpkgs.follows = "nixpkgs"; - pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; - pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs"; - pre-commit-hooks.inputs.flake-utils.follows = "flake-utils"; - pre-commit-hooks.inputs.nixpkgs-stable.follows = "nixpkgs"; + pre-commit-hooks = { + url = "github:cachix/pre-commit-hooks.nix"; + inputs.flake-compat.follows = "flake-compat"; + inputs.flake-utils.follows = "flake-utils"; + inputs.nixpkgs-stable.follows = "nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + flake-compat.url = "github:edolstra/flake-compat"; + flake-compat.flake = false; flake-utils.url = "github:numtide/flake-utils"; flake-parts.url = "github:hercules-ci/flake-parts"; }; diff --git a/home/apps/vscode.nix b/home/apps/vscode.nix index c8daeb1..abe8629 100644 --- a/home/apps/vscode.nix +++ b/home/apps/vscode.nix @@ -9,13 +9,13 @@ in { programs.vscode = { enable = true; package = pkgs.vscode; - extensions = with pkgs.vscode-extensions; [ + extensions = with pkgs.vscode-extensions.vscode-marketplace; [ jnoortheen.nix-ide - matklad.rust-analyzer mkhl.direnv ms-kubernetes-tools.vscode-kubernetes-tools pkief.material-icon-theme redhat.vscode-yaml + rust-lang.rust-analyzer tamasfe.even-better-toml valentjn.vscode-ltex vscodevim.vim diff --git a/machines/lib.nix b/machines/lib.nix index 152f6ed..f50978c 100644 --- a/machines/lib.nix +++ b/machines/lib.nix @@ -9,6 +9,7 @@ }; }; sway-unwrapped = inputs.swayfx.packages.${prev.system}.default; + vscode-extensions = inputs.nix-vscode-extensions.extensions.${prev.system}; }; hmCommonConfig = {username}: ({ config,