From 317d8c77449221b11c1d3af30687ba7c88550df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Thu, 7 Dec 2023 19:16:47 +0100 Subject: [PATCH] add vscode-server --- config/programs/vscode/default.nix | 21 +++++---------------- flake.lock | 24 ++++++++++++++++++++++++ flake.nix | 5 +++++ 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/config/programs/vscode/default.nix b/config/programs/vscode/default.nix index 50d99979..6b02a3f8 100644 --- a/config/programs/vscode/default.nix +++ b/config/programs/vscode/default.nix @@ -2,6 +2,7 @@ pkgs, nixpkgs, lib, + nixos-vscode-server, ... }: let x86_64-linux-pkgs = import nixpkgs { @@ -9,25 +10,13 @@ config.allowUnfree = true; }; in { - home.activation.vscode-server = lib.hm.dag.entryAfter ["write-boundary"] '' - if test -f ~/.vscode-server; then - if test -f "~/.vscode/extensions"; then - if ! test -L "~/.vscode-server/extensions"; then - $DRY_RUN_CMD ln -s $VERBOSE_ARG ~/.vscode/extensions ~/.vscode-server/ - fi - fi - if test -f "~/vscode-server/bin"; then - for f in ~/.vscode-server/bin/*/node; do - if ! test -L $f; then - $DRY_RUN_CMD ln -sf $VERBOSE_ARG ${pkgs.nodejs}/bin/node $f - fi - done - fi - fi - ''; + imports = [ + "${nixos-vscode-server}/modules/vscode-server/home.nix" + ]; programs.vscode = { enable = true; extensions = with x86_64-linux-pkgs.vscode-extensions; [ ]; }; + services.vscode-server.enable = true; } diff --git a/flake.lock b/flake.lock index d41a1872..d06ac910 100644 --- a/flake.lock +++ b/flake.lock @@ -606,6 +606,29 @@ "type": "github" } }, + "nixos-vscode-server": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1684517665, + "narHash": "sha256-SaAr66uCQ8CF75jIr23FZjk1+9Kfwm5sQnwV25206Gs=", + "owner": "nix-community", + "repo": "nixos-vscode-server", + "rev": "1e1358493df6529d4c7bc4cc3066f76fd16d4ae6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-vscode-server", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1670461440, @@ -689,6 +712,7 @@ "nix-neovim": "nix-neovim", "nix-packages": "nix-packages", "nixos-hardware": "nixos-hardware", + "nixos-vscode-server": "nixos-vscode-server", "nixpkgs": "nixpkgs_2", "nur": "nur", "sops-nix": "sops-nix", diff --git a/flake.nix b/flake.nix index fd925393..2b4a74cc 100644 --- a/flake.nix +++ b/flake.nix @@ -94,6 +94,11 @@ rec { inputs.nixpkgs.follows = "nixpkgs"; }; nixos-hardware.url = "github:NixOS/nixos-hardware"; + nixos-vscode-server = { + url = "github:nix-community/nixos-vscode-server"; + inputs.flake-utils.follows = "flake-utils"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nixpkgs.url = "github:NixOS/nixpkgs"; nur.url = "github:nix-community/NUR"; sops-nix = {