add vscode-server #301

Merged
DarkKirb merged 1 commit from add-vscode-server into main 2023-12-07 18:57:40 +00:00
3 changed files with 34 additions and 16 deletions

View file

@ -2,6 +2,7 @@
pkgs, pkgs,
nixpkgs, nixpkgs,
lib, lib,
nixos-vscode-server,
... ...
}: let }: let
x86_64-linux-pkgs = import nixpkgs { x86_64-linux-pkgs = import nixpkgs {
@ -9,25 +10,13 @@
config.allowUnfree = true; config.allowUnfree = true;
}; };
in { in {
home.activation.vscode-server = lib.hm.dag.entryAfter ["write-boundary"] '' imports = [
if test -f ~/.vscode-server; then "${nixos-vscode-server}/modules/vscode-server/home.nix"
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
'';
programs.vscode = { programs.vscode = {
enable = true; enable = true;
extensions = with x86_64-linux-pkgs.vscode-extensions; [ extensions = with x86_64-linux-pkgs.vscode-extensions; [
]; ];
}; };
services.vscode-server.enable = true;
} }

View file

@ -606,6 +606,29 @@
"type": "github" "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": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1670461440, "lastModified": 1670461440,
@ -689,6 +712,7 @@
"nix-neovim": "nix-neovim", "nix-neovim": "nix-neovim",
"nix-packages": "nix-packages", "nix-packages": "nix-packages",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixos-vscode-server": "nixos-vscode-server",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nur": "nur", "nur": "nur",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",

View file

@ -94,6 +94,11 @@ rec {
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixos-hardware.url = "github:NixOS/nixos-hardware"; 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"; nixpkgs.url = "github:NixOS/nixpkgs";
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
sops-nix = { sops-nix = {