Fix nixos-vscode-server permanently

This commit is contained in:
Sridhar Ratnakumar 2022-05-18 16:08:39 -04:00
parent 71ea505c7d
commit a0dde18fb2
5 changed files with 23 additions and 55 deletions

33
flake.lock generated
View file

@ -287,20 +287,17 @@
}
},
"nixos-vscode-server": {
"inputs": {
"nixpkgs": "nixpkgs_6"
},
"flake": false,
"locked": {
"lastModified": 1621309617,
"narHash": "sha256-wVraqnUMkDzVRoicKB9hwd16u53lls8gDN2Df6CmoK8=",
"owner": "iosmanthus",
"lastModified": 1648830510,
"narHash": "sha256-U+UGKbZajc2NqDvBL7hCYshAiaXgiBv5rNFIqLl0X7M=",
"owner": "msteen",
"repo": "nixos-vscode-server",
"rev": "b7d30b8afb614ea9da284ca8e9687689ae8fcfbd",
"rev": "d2343b5eb47b811856085f3eff4d899a32b2c136",
"type": "github"
},
"original": {
"owner": "iosmanthus",
"ref": "add-flake",
"owner": "msteen",
"repo": "nixos-vscode-server",
"type": "github"
}
@ -381,22 +378,6 @@
}
},
"nixpkgs_6": {
"locked": {
"lastModified": 1621073999,
"narHash": "sha256-Cp99YreSFedcWovxNmO8g8qFYltQQJPRLfuot6Z7iGE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "83d907fd760d9ee4f49b4b7e4b1c6682f137b573",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_7": {
"locked": {
"lastModified": 1651726670,
"narHash": "sha256-dSGdzB49SEvdOJvrQWfQYkAefewXraHIV08Vz6iDXWQ=",
@ -444,7 +425,7 @@
"nixos-hardware": "nixos-hardware",
"nixos-shell": "nixos-shell",
"nixos-vscode-server": "nixos-vscode-server",
"nixpkgs": "nixpkgs_7",
"nixpkgs": "nixpkgs_6",
"vim-eldar": "vim-eldar",
"zk-nvim": "zk-nvim"
}

View file

@ -11,7 +11,8 @@
nixos-hardware.url = github:NixOS/nixos-hardware/master;
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nixos-vscode-server.url = "github:iosmanthus/nixos-vscode-server/add-flake";
nixos-vscode-server.url = "github:msteen/nixos-vscode-server";
nixos-vscode-server.flake = false;
hercules-ci-agent.url = "github:hercules-ci/hercules-ci-agent/master";
nixos-shell.url = "github:Mic92/nixos-shell";
@ -65,6 +66,7 @@
./home/starship.nix
./home/terminal.nix
./home/direnv.nix
./home/vscode-server.nix
];
programs.bash = {
@ -87,7 +89,6 @@
[
./systems/hetzner/ax101.nix
./nixos/server/harden.nix
./nixos/server/devserver.nix
./nixos/hercules.nix
];
# This is run in qemu only.

8
home/vscode-server.nix Normal file
View file

@ -0,0 +1,8 @@
{ pkgs, inputs, ... }:
{
imports = [
"${inputs.nixos-vscode-server}/modules/vscode-server/home.nix"
];
services.vscode-server.enable = true;
}

View file

@ -1,27 +0,0 @@
# A server for (remote) development purposes.
{ pkgs, inputs, ... }: {
imports = [
inputs.nixos-vscode-server.nixosModules.system
];
environment.systemPackages = [
# https://old.reddit.com/r/NixOS/comments/uoklud/nix_development_container/i8hn64w/?context=2
(pkgs.writeShellApplication {
name = "fix-vscode-server";
text = ''
if [[ -d "$HOME/.vscode-server/bin" ]]; then
for versiondir in "$HOME"/.vscode-server/bin/*; do
echo "!! Fixing $versiondir/node"
ln -sf "${pkgs.nodejs-16_x}/bin/node" "$versiondir/node"
done
fi
'';
})
];
# FIXME: This doesn't seem to work; hence the fix-vscode-server above.
services.auto-fix-vscode-server.enable = true;
# https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc
boot.kernel.sysctl = {
"fs.inotify.max_user_watches" = "524288";
};
}

View file

@ -53,6 +53,11 @@
# available there.
boot.initrd.services.swraid.mdadmConf = config.environment.etc."mdadm.conf".text;
# https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc
boot.kernel.sysctl = {
"fs.inotify.max_user_watches" = "524288";
};
# Network (Hetzner uses static IP assignments, and we don't use DHCP here)
networking.useDHCP = false;