├── .gitattributes ├── LICENSE ├── README.md ├── default.nix ├── flake.lock ├── flake.nix ├── modules └── vscode-server │ ├── default.nix │ ├── home.nix │ └── module.nix └── pkgs └── auto-fix-vscode-server.nix /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 Matthijs Steen 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Visual Studio Code Server support in NixOS 2 | 3 | Experimental support for VS Code Server in NixOS. The NodeJS by default supplied by VS Code cannot be used within NixOS due to missing hardcoded paths, so it is automatically replaced by a symlink to a compatible version of NodeJS that does work under NixOS. 4 | 5 | ## Installation 6 | 7 | ### NixOS module 8 | 9 | You can add the module to your system in various ways. After the installation 10 | you'll have to manually enable the service for each user (see below). 11 | 12 | #### Install as a tarball 13 | 14 | ```nix 15 | { 16 | imports = [ 17 | (fetchTarball "https://github.com/nix-community/nixos-vscode-server/tarball/master") 18 | ]; 19 | 20 | services.vscode-server.enable = true; 21 | } 22 | ``` 23 | 24 | #### Install as a flake 25 | 26 | ```nix 27 | { 28 | inputs.vscode-server.url = "github:nix-community/nixos-vscode-server"; 29 | 30 | outputs = { self, nixpkgs, vscode-server }: { 31 | nixosConfigurations.yourhostname = nixpkgs.lib.nixosSystem { 32 | modules = [ 33 | vscode-server.nixosModules.default 34 | ({ config, pkgs, ... }: { 35 | services.vscode-server.enable = true; 36 | }) 37 | ]; 38 | }; 39 | }; 40 | } 41 | ``` 42 | 43 | #### Enable the service 44 | 45 | And then enable them for the relevant users: 46 | 47 | ```bash 48 | systemctl --user enable auto-fix-vscode-server.service 49 | ``` 50 | 51 | You will see the following message: 52 | 53 | ``` 54 | The unit files have no installation config (WantedBy=, RequiredBy=, Also=, 55 | Alias= settings in the [Install] section, and DefaultInstance= for template 56 | units). This means they are not meant to be enabled using systemctl. 57 | 58 | Possible reasons for having this kind of units are: 59 | • A unit may be statically enabled by being symlinked from another unit's 60 | .wants/ or .requires/ directory. 61 | • A unit's purpose may be to act as a helper for some other unit which has 62 | a requirement dependency on it. 63 | • A unit may be started when needed via activation (socket, path, timer, 64 | D-Bus, udev, scripted systemctl call, ...). 65 | • In case of template units, the unit is meant to be enabled with some 66 | instance name specified. 67 | ``` 68 | 69 | However you can safely ignore it. The service will start automatically after reboot once enabled, or you can just start it immediately yourself with: 70 | 71 | ```bash 72 | systemctl --user start auto-fix-vscode-server.service 73 | ``` 74 | 75 | Enabling the user service creates a symlink to the Nix store, but the linked store path could be garbage collected at some point. One workaround to this particular issue is creating the following symlink: 76 | ```bash 77 | ln -sfT /run/current-system/etc/systemd/user/auto-fix-vscode-server.service ~/.config/systemd/user/auto-fix-vscode-server.service 78 | ``` 79 | 80 | ### Home Manager 81 | 82 | Put this code into your [home-manager](https://github.com/nix-community/home-manager) configuration i.e. in `~/.config/nixpkgs/home.nix`: 83 | 84 | ```nix 85 | { 86 | imports = [ 87 | "${fetchTarball "https://github.com/msteen/nixos-vscode-server/tarball/master"}/modules/vscode-server/home.nix" 88 | ]; 89 | 90 | services.vscode-server.enable = true; 91 | } 92 | ``` 93 | 94 | ## Usage 95 | 96 | When using VS Code as released by Microsoft without any special needs, just enabling and starting the service should be enough to make things work. If you have some custom build or needs, there are a few options available that might help you out. 97 | 98 | ### `enable` 99 | Whether to enable the service or not. 100 | 101 | ```nix 102 | { 103 | services.vscode-server.enable = true; 104 | } 105 | ``` 106 | 107 | ### `enableFHS` 108 | A FHS ([Filesystem Hierarchy Standard](https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard)) compatible environment can be enabled to make binaries supplied by extensions work in NixOS without having to patch them. Note that this does come with downsides too, such as problematic support for SUID wrappers and terminals potentially behaving differently from a normal SSH connection, which is why it is not enabled by default. 109 | 110 | ```nix 111 | { 112 | services.vscode-server.enableFHS = true; 113 | } 114 | ``` 115 | 116 | ### `nodejsPackage` 117 | By default VS code server will install the version of Node.js it needs, and this service will automatically patch it, but if you want to minimize disk space or want it to use some specific version of Node.js, you can specify which Nix package for Node.js it should use. 118 | 119 | When `enableFHS` is set to `true` it will always require a Nix package for Node.js, but you are not required to set it, as it will default to the latest version used by VS Code. 120 | 121 | Disclaimer: I am not a very active user of this extension and even NixOS (at the moment), so it can happen that the default is out of date. At least by having it as an option you can workaround it until the default get updated. 122 | 123 | ```nix 124 | { 125 | services.vscode-server.nodejsPackage = pkgs.nodejs-16_x; 126 | } 127 | ``` 128 | 129 | ### `extraRuntimeDependencies` 130 | If you have an extension that requires a FHS compatible environment, but their binaries require dependencies that are not already included, you can add them here to make them available to the FHS environment. 131 | 132 | This same list is also used to determine the `RPATH` when automatically patching the ELF binaries. 133 | 134 | ```nix 135 | { 136 | services.vscode-server.extraRuntimeDependencies = pkgs: with pkgs; [ 137 | curl 138 | ]; 139 | } 140 | ``` 141 | 142 | ### `installPath` 143 | The installation path for VS Code server is configurable and the default can differ for alternative builds (e.g. oss and insider), so this option allows you to configure which installation path should be monitered and automatically fixed. 144 | 145 | ```nix 146 | { 147 | services.vscode-server.installPath = "$HOME/.vscode-server-oss"; 148 | } 149 | ``` 150 | 151 | ### `postPatch` 152 | The goal of this project is to make VS Code server work with NixOS, anything more is outside of the scope of the project, but if you want additional things to be done, you can use this hook to run a shell script after the patching is done. 153 | 154 | ```nix 155 | { 156 | services.vscode-server.postPatch = '' 157 | bin=$1 158 | bin_dir=${config.services.vscode-server.installPath}/bin/$bin 159 | # ... 160 | ''; 161 | } 162 | ``` 163 | 164 | ## Troubleshooting 165 | 166 | This is not really an issue with this project per se, but with systemd user services in NixOS in general. After updating it can be necessary to first disable the service again: 167 | 168 | ```bash 169 | systemctl --user disable auto-fix-vscode-server.service 170 | ``` 171 | 172 | This will remove the symlink to the old version. Then you can enable/start it again. 173 | 174 | ### Connecting with SSH timed out 175 | 176 | If the remote SSH session fails to start with this error: 177 | 178 | > Failed to connect to the remote extension host server (Error: Connecting with SSH timed out) 179 | 180 | Try adding this to your VS Code settings json: 181 | ```json 182 | "remote.SSH.useLocalServer": false, 183 | ``` 184 | 185 | Tested on VS Code version 1.63.2, connecting to the NixOS remote from a MacOS host. 186 | 187 | ## Future work 188 | 189 | ### Patching extensions 190 | More work is needed to see if it is possible to also automatically patch binaries in VS Code extensions without using the FHS compatible environment. 191 | 192 | ### WSL support 193 | Some work has been done to get WSL to work out of the box, but it is not working quite yet. 194 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | import ./modules/vscode-server 2 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "flake-utils": { 4 | "inputs": { 5 | "systems": "systems" 6 | }, 7 | "locked": { 8 | "lastModified": 1681202837, 9 | "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", 10 | "owner": "numtide", 11 | "repo": "flake-utils", 12 | "rev": "cfacdce06f30d2b68473a46042957675eebb3401", 13 | "type": "github" 14 | }, 15 | "original": { 16 | "owner": "numtide", 17 | "repo": "flake-utils", 18 | "type": "github" 19 | } 20 | }, 21 | "nixpkgs": { 22 | "locked": { 23 | "lastModified": 1682134069, 24 | "narHash": "sha256-TnI/ZXSmRxQDt2sjRYK/8j8iha4B4zP2cnQCZZ3vp7k=", 25 | "owner": "NixOS", 26 | "repo": "nixpkgs", 27 | "rev": "fd901ef4bf93499374c5af385b2943f5801c0833", 28 | "type": "github" 29 | }, 30 | "original": { 31 | "id": "nixpkgs", 32 | "type": "indirect" 33 | } 34 | }, 35 | "root": { 36 | "inputs": { 37 | "flake-utils": "flake-utils", 38 | "nixpkgs": "nixpkgs" 39 | } 40 | }, 41 | "systems": { 42 | "locked": { 43 | "lastModified": 1681028828, 44 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 45 | "owner": "nix-systems", 46 | "repo": "default", 47 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 48 | "type": "github" 49 | }, 50 | "original": { 51 | "owner": "nix-systems", 52 | "repo": "default", 53 | "type": "github" 54 | } 55 | } 56 | }, 57 | "root": "root", 58 | "version": 7 59 | } 60 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "NixOS VSCode server"; 3 | 4 | inputs = { 5 | flake-utils.url = "github:numtide/flake-utils"; 6 | }; 7 | 8 | outputs = { 9 | self, 10 | nixpkgs, 11 | flake-utils, 12 | }: 13 | { 14 | nixosModule = self.nixosModules.default; # Deprecrated, but perhaps still in use. 15 | nixosModules.default = import ./modules/vscode-server; 16 | nixosModules.home = self.homeModules.default; # Backwards compatiblity. 17 | homeModules.default = import ./modules/vscode-server/home.nix; # Consistent with homeConfigurations. 18 | } 19 | // (let 20 | inherit (flake-utils.lib) defaultSystems eachSystem; 21 | in 22 | eachSystem defaultSystems (system: let 23 | pkgs = nixpkgs.legacyPackages.${system}; 24 | inherit (pkgs.lib) hasSuffix optionalAttrs; 25 | auto-fix-vscode-server = pkgs.callPackage ./pkgs/auto-fix-vscode-server.nix { }; 26 | in 27 | # The package depends on `inotify-tools` which is only available on Linux. 28 | optionalAttrs (hasSuffix "-linux" system) { 29 | packages = { 30 | inherit auto-fix-vscode-server; 31 | default = auto-fix-vscode-server; 32 | }; 33 | checks = { 34 | inherit auto-fix-vscode-server; 35 | }; 36 | })); 37 | } 38 | -------------------------------------------------------------------------------- /modules/vscode-server/default.nix: -------------------------------------------------------------------------------- 1 | import ./module.nix ({ 2 | name, 3 | description, 4 | serviceConfig, 5 | }: { 6 | systemd.user.services.${name} = { 7 | inherit description serviceConfig; 8 | wantedBy = [ "default.target" ]; 9 | }; 10 | }) 11 | -------------------------------------------------------------------------------- /modules/vscode-server/home.nix: -------------------------------------------------------------------------------- 1 | import ./module.nix ({ 2 | name, 3 | description, 4 | serviceConfig, 5 | }: { 6 | systemd.user.services.${name} = { 7 | Unit = { 8 | Description = description; 9 | }; 10 | 11 | Service = serviceConfig; 12 | 13 | Install = { 14 | WantedBy = [ "default.target" ]; 15 | }; 16 | }; 17 | }) 18 | -------------------------------------------------------------------------------- /modules/vscode-server/module.nix: -------------------------------------------------------------------------------- 1 | moduleConfig: { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | options.services.vscode-server = let 8 | inherit (lib) mkEnableOption mkOption; 9 | inherit (lib.types) lines listOf nullOr package str; 10 | in { 11 | enable = mkEnableOption "VS Code Server"; 12 | 13 | enableFHS = mkEnableOption "a FHS compatible environment"; 14 | 15 | nodejsPackage = mkOption { 16 | type = nullOr package; 17 | default = null; 18 | example = pkgs.nodejs_20; 19 | description = '' 20 | Whether to use a specific Node.js rather than the version supplied by VS Code server. 21 | ''; 22 | }; 23 | 24 | extraRuntimeDependencies = mkOption { 25 | type = listOf package; 26 | default = [ ]; 27 | description = '' 28 | A list of extra packages to use as runtime dependencies. 29 | It is used to determine the RPATH to automatically patch ELF binaries with, 30 | or when a FHS compatible environment has been enabled, 31 | to determine its extra target packages. 32 | ''; 33 | }; 34 | 35 | installPath = mkOption { 36 | type = str; 37 | default = "$HOME/.vscode-server"; 38 | example = "$HOME/.vscode-server-oss"; 39 | description = '' 40 | The install path. 41 | ''; 42 | }; 43 | 44 | postPatch = mkOption { 45 | type = lines; 46 | default = ""; 47 | description = '' 48 | Lines of Bash that will be executed after the VS Code server installation has been patched. 49 | This can be used as a hook for custom further patching. 50 | ''; 51 | }; 52 | }; 53 | 54 | config = let 55 | inherit (lib) mkDefault mkIf mkMerge; 56 | cfg = config.services.vscode-server; 57 | auto-fix-vscode-server = 58 | pkgs.callPackage ../../pkgs/auto-fix-vscode-server.nix 59 | (removeAttrs cfg [ "enable" ]); 60 | in 61 | mkIf cfg.enable (mkMerge [ 62 | { 63 | services.vscode-server.nodejsPackage = mkIf cfg.enableFHS (mkDefault pkgs.nodejs_20); 64 | } 65 | (moduleConfig { 66 | name = "auto-fix-vscode-server"; 67 | description = "Automatically fix the VS Code server used by the remote SSH extension"; 68 | serviceConfig = { 69 | # When a monitored directory is deleted, it will stop being monitored. 70 | # Even if it is later recreated it will not restart monitoring it. 71 | # Unfortunately the monitor does not kill itself when it stops monitoring, 72 | # so rather than creating our own restart mechanism, we leverage systemd to do this for us. 73 | Restart = "always"; 74 | RestartSec = 0; 75 | ExecStart = "${auto-fix-vscode-server}/bin/auto-fix-vscode-server"; 76 | }; 77 | }) 78 | ]); 79 | } 80 | -------------------------------------------------------------------------------- /pkgs/auto-fix-vscode-server.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | buildFHSUserEnv ? buildFHSEnv, 4 | buildFHSEnv ? buildFHSUserEnv, 5 | runtimeShell, 6 | writeShellScript, 7 | writeShellApplication, 8 | coreutils, 9 | findutils, 10 | inotify-tools, 11 | patchelf, 12 | stdenv, 13 | curl, 14 | icu, 15 | libunwind, 16 | libuuid, 17 | lttng-ust, 18 | openssl, 19 | zlib, 20 | krb5, 21 | enableFHS ? false, 22 | nodejsPackage ? null, 23 | extraRuntimeDependencies ? [ ], 24 | installPath ? "$HOME/.vscode-server", 25 | postPatch ? "", 26 | }: let 27 | inherit (lib) makeBinPath makeLibraryPath optionalString; 28 | 29 | # Based on: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/applications/editors/vscode/generic.nix 30 | runtimeDependencies = 31 | [ 32 | stdenv.cc.libc 33 | stdenv.cc.cc 34 | 35 | # dotnet 36 | curl 37 | icu 38 | libunwind 39 | libuuid 40 | lttng-ust 41 | openssl 42 | zlib 43 | 44 | # mono 45 | krb5 46 | ] 47 | ++ extraRuntimeDependencies; 48 | 49 | nodejs = nodejsPackage; 50 | nodejsFHS = buildFHSUserEnv { 51 | name = "node"; 52 | targetPkgs = _: runtimeDependencies; 53 | extraBuildCommands = '' 54 | if [[ -d /usr/lib/wsl ]]; then 55 | # Recursively symlink the lib files necessary for WSL 56 | # to properly function under the FHS compatible environment. 57 | # The -s stands for symbolic link. 58 | cp -rsHf /usr/lib/wsl usr/lib/wsl 59 | fi 60 | ''; 61 | runScript = "${nodejs}/bin/node"; 62 | meta = { 63 | description = '' 64 | Wrapped variant of Node.js which launches in an FHS compatible envrionment, 65 | which should allow for easy usage of extensions without Nix-specific modifications. 66 | ''; 67 | }; 68 | }; 69 | 70 | patchELFScript = writeShellApplication { 71 | name = "patchelf-vscode-server"; 72 | runtimeInputs = [ coreutils findutils patchelf ]; 73 | text = '' 74 | bin_dir="$1" 75 | patched_file="$bin_dir/.nixos-patched" 76 | 77 | # NOTE: We don't log here because it won't show up in the output of the user service. 78 | 79 | # Check if the installation is already full patched. 80 | if [[ ! -e $patched_file ]] || (( $(< "$patched_file") )); then 81 | exit 0 82 | fi 83 | 84 | ${optionalString (!enableFHS) '' 85 | INTERP=$(< ${stdenv.cc}/nix-support/dynamic-linker) 86 | RPATH=${makeLibraryPath runtimeDependencies} 87 | 88 | patch_elf () { 89 | local elf=$1 interp 90 | 91 | # Check if binary is patchable, e.g. not a statically-linked or non-ELF binary. 92 | if ! interp=$(patchelf --print-interpreter "$elf" 2>/dev/null); then 93 | return 94 | fi 95 | 96 | # Check if it is not already patched for Nix. 97 | if [[ $interp == "$INTERP" ]]; then 98 | return 99 | fi 100 | 101 | # Patch the binary based on the binary of Node.js, 102 | # which should include all dependencies they might need. 103 | patchelf --set-interpreter "$INTERP" --set-rpath "$RPATH" "$elf" 104 | 105 | # The actual dependencies are probably less than that of Node.js, 106 | # so shrink the RPATH to only keep those that are actually needed. 107 | patchelf --shrink-rpath "$elf" 108 | } 109 | 110 | while read -rd ''' elf; do 111 | patch_elf "$elf" 112 | done < <(find "$bin_dir" -type f -perm -100 -printf '%p\0') 113 | ''} 114 | 115 | # Mark the bin directory as being fully patched. 116 | echo 1 > "$patched_file" 117 | 118 | ${optionalString (postPatch != "") ''${writeShellScript "post-patchelf-vscode-server" postPatch} "$bin"''} 119 | ''; 120 | }; 121 | 122 | autoFixScript = writeShellApplication { 123 | name = "auto-fix-vscode-server"; 124 | runtimeInputs = [ coreutils findutils inotify-tools ]; 125 | text = '' 126 | bins_dir_1=${installPath}/bin 127 | bins_dir_2=${installPath}/cli/servers 128 | 129 | patch_bin () { 130 | local actual_dir="$1" 131 | local patched_file="$actual_dir/.nixos-patched" 132 | 133 | if [[ -e $patched_file ]]; then 134 | return 0 135 | fi 136 | 137 | # Backwards compatibility with previous versions of nixos-vscode-server. 138 | local old_patched_file 139 | old_patched_file="$(basename "$actual_dir")" 140 | if [[ $old_patched_file == "server" ]]; then 141 | old_patched_file="$(basename "$(dirname "$actual_dir")")" 142 | old_patched_file="${installPath}/.''${old_patched_file%%.*}.patched" 143 | else 144 | old_patched_file="${installPath}/.''${old_patched_file%%-*}.patched" 145 | fi 146 | if [[ -e $old_patched_file ]]; then 147 | echo "Migrating old nixos-vscode-server patch marker file to new location in $actual_dir." >&2 148 | cp "$old_patched_file" "$patched_file" 149 | return 0 150 | fi 151 | 152 | echo "Patching Node.js of VS Code server installation in $actual_dir..." >&2 153 | 154 | mv "$actual_dir/node" "$actual_dir/node.patched" 155 | 156 | ${optionalString (enableFHS) '' 157 | ln -sfT ${nodejsFHS}/bin/node "$actual_dir/node" 158 | ''} 159 | 160 | ${optionalString (!enableFHS || postPatch != "") '' 161 | cat < "$actual_dir/node" 162 | #!${runtimeShell} 163 | 164 | # The core utilities are missing in the case of WSL, but required by Node.js. 165 | PATH="\''${PATH:+\''${PATH}:}${makeBinPath [ coreutils ]}" 166 | 167 | # We leave the rest up to the Bash script 168 | # to keep having to deal with 'sh' compatibility to a minimum. 169 | ${patchELFScript}/bin/patchelf-vscode-server \$(dirname "\$0") 170 | 171 | # Let Node.js take over as if this script never existed. 172 | ${ 173 | let nodePath = (if (nodejs != null) 174 | then "${if enableFHS then nodejsFHS else nodejs}/bin/node" 175 | else ''\$(dirname "\$0")/node.patched''); 176 | in ''exec "${nodePath}" "\$@"'' 177 | } 178 | EOF 179 | chmod +x "$actual_dir/node" 180 | ''} 181 | 182 | # Mark the bin directory as being patched. 183 | echo 0 > "$patched_file" 184 | } 185 | 186 | mkdir -p "$bins_dir_1" "$bins_dir_2" 187 | while read -rd ''' bin; do 188 | if [[ $bin == "$bins_dir_2"* ]]; then 189 | bin="$bin/server" 190 | fi 191 | patch_bin "$bin" 192 | done < <(find "$bins_dir_1" "$bins_dir_2" -mindepth 1 -maxdepth 1 -type d -printf '%p\0') 193 | 194 | while IFS=: read -r bins_dir bin event; do 195 | # A new version of the VS Code Server is being created. 196 | if [[ $event == 'CREATE,ISDIR' ]]; then 197 | actual_dir="$bins_dir$bin" 198 | if [[ "$bins_dir" == "$bins_dir_2/" ]]; then 199 | actual_dir="$actual_dir/server" 200 | # Hope that VSCode will not die if the directory exists when it tries to install, otherwise we'll need to 201 | # use a coproc to wait for the directory to be created without entering in a race, then watch for the node 202 | # file to be created (probably while also avoiding a race) 203 | # https://unix.stackexchange.com/a/185370 204 | mkdir -p "$actual_dir" 205 | fi 206 | echo "VS Code server is being installed in $actual_dir..." >&2 207 | # Quickly create a node file, which will be removed when vscode installs its own version 208 | touch "$actual_dir/node" 209 | # Hope we don't race... 210 | inotifywait -qq -e DELETE_SELF "$actual_dir/node" 211 | patch_bin "$actual_dir" 212 | # The monitored directory is deleted, e.g. when "Uninstall VS Code Server from Host" has been run. 213 | elif [[ $event == DELETE_SELF ]]; then 214 | # See the comments above Restart in the service config. 215 | exit 0 216 | fi 217 | done < <(inotifywait -q -m -e CREATE,ISDIR -e DELETE_SELF --format '%w:%f:%e' "$bins_dir_1" "$bins_dir_2") 218 | ''; 219 | }; 220 | in 221 | autoFixScript 222 | --------------------------------------------------------------------------------