From 022ee4d701878c185785ce72dd436639dd687199 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Mon, 30 Oct 2023 14:50:40 +0100 Subject: kibana7: drop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Depends on EOL software and no maintenance has been attempted to change this after a ping (https://github.com/NixOS/nixpkgs/issues/259178) Feel free to adopt and re-introduce if you care about this software. This will probably seriously hamper ELK usability in nixpkgs, but as it receives no maintenance… --- nixos/modules/module-list.nix | 1 - nixos/modules/services/search/kibana.nix | 213 ------------------------------- nixos/tests/elk.nix | 14 -- 3 files changed, 228 deletions(-) delete mode 100644 nixos/modules/services/search/kibana.nix (limited to 'nixos') diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 00da6399295..2e5b1ce90af 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1147,7 +1147,6 @@ ./services/search/elasticsearch-curator.nix ./services/search/elasticsearch.nix ./services/search/hound.nix - ./services/search/kibana.nix ./services/search/meilisearch.nix ./services/search/opensearch.nix ./services/search/qdrant.nix diff --git a/nixos/modules/services/search/kibana.nix b/nixos/modules/services/search/kibana.nix deleted file mode 100644 index a5e132d5c38..00000000000 --- a/nixos/modules/services/search/kibana.nix +++ /dev/null @@ -1,213 +0,0 @@ -{ config, lib, options, pkgs, ... }: - -with lib; - -let - cfg = config.services.kibana; - opt = options.services.kibana; - - ge7 = builtins.compareVersions cfg.package.version "7" >= 0; - lt6_6 = builtins.compareVersions cfg.package.version "6.6" < 0; - - cfgFile = pkgs.writeText "kibana.json" (builtins.toJSON ( - (filterAttrsRecursive (n: v: v != null && v != []) ({ - server.host = cfg.listenAddress; - server.port = cfg.port; - server.ssl.certificate = cfg.cert; - server.ssl.key = cfg.key; - - kibana.index = cfg.index; - kibana.defaultAppId = cfg.defaultAppId; - - elasticsearch.url = cfg.elasticsearch.url; - elasticsearch.hosts = cfg.elasticsearch.hosts; - elasticsearch.username = cfg.elasticsearch.username; - elasticsearch.password = cfg.elasticsearch.password; - - elasticsearch.ssl.certificate = cfg.elasticsearch.cert; - elasticsearch.ssl.key = cfg.elasticsearch.key; - elasticsearch.ssl.certificateAuthorities = cfg.elasticsearch.certificateAuthorities; - } // cfg.extraConf) - ))); - -in { - options.services.kibana = { - enable = mkEnableOption (lib.mdDoc "kibana service"); - - listenAddress = mkOption { - description = lib.mdDoc "Kibana listening host"; - default = "127.0.0.1"; - type = types.str; - }; - - port = mkOption { - description = lib.mdDoc "Kibana listening port"; - default = 5601; - type = types.port; - }; - - cert = mkOption { - description = lib.mdDoc "Kibana ssl certificate."; - default = null; - type = types.nullOr types.path; - }; - - key = mkOption { - description = lib.mdDoc "Kibana ssl key."; - default = null; - type = types.nullOr types.path; - }; - - index = mkOption { - description = lib.mdDoc "Elasticsearch index to use for saving kibana config."; - default = ".kibana"; - type = types.str; - }; - - defaultAppId = mkOption { - description = lib.mdDoc "Elasticsearch default application id."; - default = "discover"; - type = types.str; - }; - - elasticsearch = { - url = mkOption { - description = lib.mdDoc '' - Elasticsearch url. - - Defaults to `"http://localhost:9200"`. - - Don't set this when using Kibana >= 7.0.0 because it will result in a - configuration error. Use {option}`services.kibana.elasticsearch.hosts` - instead. - ''; - default = null; - type = types.nullOr types.str; - }; - - hosts = mkOption { - description = lib.mdDoc '' - The URLs of the Elasticsearch instances to use for all your queries. - All nodes listed here must be on the same cluster. - - Defaults to `[ "http://localhost:9200" ]`. - - This option is only valid when using kibana >= 6.6. - ''; - default = null; - type = types.nullOr (types.listOf types.str); - }; - - username = mkOption { - description = lib.mdDoc "Username for elasticsearch basic auth."; - default = null; - type = types.nullOr types.str; - }; - - password = mkOption { - description = lib.mdDoc "Password for elasticsearch basic auth."; - default = null; - type = types.nullOr types.str; - }; - - ca = mkOption { - description = lib.mdDoc '' - CA file to auth against elasticsearch. - - It's recommended to use the {option}`certificateAuthorities` option - when using kibana-5.4 or newer. - ''; - default = null; - type = types.nullOr types.path; - }; - - certificateAuthorities = mkOption { - description = lib.mdDoc '' - CA files to auth against elasticsearch. - - Please use the {option}`ca` option when using kibana \< 5.4 - because those old versions don't support setting multiple CA's. - - This defaults to the singleton list [ca] when the {option}`ca` option is defined. - ''; - default = lib.optional (cfg.elasticsearch.ca != null) ca; - defaultText = literalExpression '' - lib.optional (config.${opt.elasticsearch.ca} != null) ca - ''; - type = types.listOf types.path; - }; - - cert = mkOption { - description = lib.mdDoc "Certificate file to auth against elasticsearch."; - default = null; - type = types.nullOr types.path; - }; - - key = mkOption { - description = lib.mdDoc "Key file to auth against elasticsearch."; - default = null; - type = types.nullOr types.path; - }; - }; - - package = mkOption { - description = lib.mdDoc "Kibana package to use"; - default = pkgs.kibana; - defaultText = literalExpression "pkgs.kibana"; - type = types.package; - }; - - dataDir = mkOption { - description = lib.mdDoc "Kibana data directory"; - default = "/var/lib/kibana"; - type = types.path; - }; - - extraConf = mkOption { - description = lib.mdDoc "Kibana extra configuration"; - default = {}; - type = types.attrs; - }; - }; - - config = mkIf (cfg.enable) { - assertions = [ - { - assertion = ge7 -> cfg.elasticsearch.url == null; - message = - "The option services.kibana.elasticsearch.url has been removed when using kibana >= 7.0.0. " + - "Please use option services.kibana.elasticsearch.hosts instead."; - } - { - assertion = lt6_6 -> cfg.elasticsearch.hosts == null; - message = - "The option services.kibana.elasticsearch.hosts is only valid for kibana >= 6.6."; - } - ]; - systemd.services.kibana = { - description = "Kibana Service"; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" "elasticsearch.service" ]; - environment = { BABEL_CACHE_PATH = "${cfg.dataDir}/.babelcache.json"; }; - serviceConfig = { - ExecStart = - "${cfg.package}/bin/kibana" + - " --config ${cfgFile}" + - " --path.data ${cfg.dataDir}"; - User = "kibana"; - WorkingDirectory = cfg.dataDir; - }; - }; - - environment.systemPackages = [ cfg.package ]; - - users.users.kibana = { - isSystemUser = true; - description = "Kibana service user"; - home = cfg.dataDir; - createHome = true; - group = "kibana"; - }; - users.groups.kibana = {}; - }; -} diff --git a/nixos/tests/elk.nix b/nixos/tests/elk.nix index 0122bc44036..900ea632010 100644 --- a/nixos/tests/elk.nix +++ b/nixos/tests/elk.nix @@ -119,11 +119,6 @@ let package = elk.elasticsearch; }; - kibana = { - enable = true; - package = elk.kibana; - }; - elasticsearch-curator = { enable = true; actionYAML = '' @@ -217,13 +212,6 @@ let one.wait_until_succeeds("cat /tmp/logstash.out | grep flowers") one.wait_until_succeeds("cat /tmp/logstash.out | grep -v dragons") - with subtest("Kibana is healthy"): - one.wait_for_unit("kibana.service") - one.wait_until_succeeds( - "curl --silent --show-error --fail-with-body 'http://localhost:5601/api/status'" - + " | jq -es 'if . == [] then null else .[] | .status.overall.state == \"green\" end'" - ) - with subtest("Metricbeat is running"): one.wait_for_unit("metricbeat.service") @@ -274,7 +262,6 @@ in { # name = "elk-7"; # elasticsearch = pkgs.elasticsearch7-oss; # logstash = pkgs.logstash7-oss; - # kibana = pkgs.kibana7-oss; # filebeat = pkgs.filebeat7; # metricbeat = pkgs.metricbeat7; # }; @@ -282,7 +269,6 @@ in { ELK-7 = mkElkTest "elk-7" { elasticsearch = pkgs.elasticsearch7; logstash = pkgs.logstash7; - kibana = pkgs.kibana7; filebeat = pkgs.filebeat7; metricbeat = pkgs.metricbeat7; }; -- cgit 1.4.1 From 72911a99d34a4d290671728d40016ba5254f72fe Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Wed, 8 Nov 2023 16:38:01 +0100 Subject: code-server: drop Depends on Node.js 16 and cannot be trivially upgraded to Node.js 18. --- nixos/modules/module-list.nix | 1 - nixos/modules/services/web-apps/code-server.nix | 259 ---------------- nixos/tests/all-tests.nix | 1 - nixos/tests/code-server.nix | 22 -- pkgs/servers/code-server/build-vscode-nogit.patch | 20 -- pkgs/servers/code-server/default.nix | 327 --------------------- pkgs/servers/code-server/playwright.patch | 10 - .../servers/code-server/remove-node-download.patch | 28 -- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 7 - 10 files changed, 1 insertion(+), 675 deletions(-) delete mode 100644 nixos/modules/services/web-apps/code-server.nix delete mode 100644 nixos/tests/code-server.nix delete mode 100644 pkgs/servers/code-server/build-vscode-nogit.patch delete mode 100644 pkgs/servers/code-server/default.nix delete mode 100644 pkgs/servers/code-server/playwright.patch delete mode 100644 pkgs/servers/code-server/remove-node-download.patch (limited to 'nixos') diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 2e5b1ce90af..d02c5b593b3 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1240,7 +1240,6 @@ ./services/web-apps/changedetection-io.nix ./services/web-apps/chatgpt-retrieval-plugin.nix ./services/web-apps/cloudlog.nix - ./services/web-apps/code-server.nix ./services/web-apps/convos.nix ./services/web-apps/dex.nix ./services/web-apps/discourse.nix diff --git a/nixos/modules/services/web-apps/code-server.nix b/nixos/modules/services/web-apps/code-server.nix deleted file mode 100644 index 11601f6c304..00000000000 --- a/nixos/modules/services/web-apps/code-server.nix +++ /dev/null @@ -1,259 +0,0 @@ -{ config, lib, pkgs, ... }: - -let - cfg = config.services.code-server; - defaultUser = "code-server"; - defaultGroup = defaultUser; -in { - options = { - services.code-server = { - enable = lib.mkEnableOption (lib.mdDoc "code-server"); - - package = lib.mkPackageOptionMD pkgs "code-server" { - example = '' - pkgs.vscode-with-extensions.override { - vscode = pkgs.code-server; - vscodeExtensions = with pkgs.vscode-extensions; [ - bbenoist.nix - dracula-theme.theme-dracula - ]; - } - ''; - }; - - extraPackages = lib.mkOption { - default = [ ]; - description = lib.mdDoc '' - Additional packages to add to the code-server {env}`PATH`. - ''; - example = lib.literalExpression "[ pkgs.go ]"; - type = lib.types.listOf lib.types.package; - }; - - extraEnvironment = lib.mkOption { - type = lib.types.attrsOf lib.types.str; - description = lib.mdDoc '' - Additional environment variables to pass to code-server. - ''; - default = { }; - example = { PKG_CONFIG_PATH = "/run/current-system/sw/lib/pkgconfig"; }; - }; - - extraArguments = lib.mkOption { - default = [ ]; - description = lib.mdDoc '' - Additional arguments to pass to code-server. - ''; - example = lib.literalExpression ''[ "--log=info" ]''; - type = lib.types.listOf lib.types.str; - }; - - host = lib.mkOption { - default = "localhost"; - description = lib.mdDoc '' - The host name or IP address the server should listen to. - ''; - type = lib.types.str; - }; - - port = lib.mkOption { - default = 4444; - description = lib.mdDoc '' - The port the server should listen to. - ''; - type = lib.types.port; - }; - - auth = lib.mkOption { - default = "password"; - description = lib.mdDoc '' - The type of authentication to use. - ''; - type = lib.types.enum [ "none" "password" ]; - }; - - hashedPassword = lib.mkOption { - default = ""; - description = lib.mdDoc '' - Create the password with: `echo -n 'thisismypassword' | npx argon2-cli -e`. - ''; - type = lib.types.str; - }; - - user = lib.mkOption { - default = defaultUser; - example = "yourUser"; - description = lib.mdDoc '' - The user to run code-server as. - By default, a user named `${defaultUser}` will be created. - ''; - type = lib.types.str; - }; - - group = lib.mkOption { - default = defaultGroup; - example = "yourGroup"; - description = lib.mdDoc '' - The group to run code-server under. - By default, a group named `${defaultGroup}` will be created. - ''; - type = lib.types.str; - }; - - extraGroups = lib.mkOption { - default = [ ]; - description = lib.mdDoc '' - An array of additional groups for the `${defaultUser}` user. - ''; - example = [ "docker" ]; - type = lib.types.listOf lib.types.str; - }; - - socket = lib.mkOption { - default = null; - example = "/run/code-server/socket"; - description = lib.mdDoc '' - Path to a socket (bind-addr will be ignored). - ''; - type = lib.types.nullOr lib.types.str; - }; - - socketMode = lib.mkOption { - default = null; - description = lib.mdDoc '' - File mode of the socket. - ''; - type = lib.types.nullOr lib.types.str; - }; - - userDataDir = lib.mkOption { - default = null; - description = lib.mdDoc '' - Path to the user data directory. - ''; - type = lib.types.nullOr lib.types.str; - }; - - extensionsDir = lib.mkOption { - default = null; - description = lib.mdDoc '' - Path to the extensions directory. - ''; - type = lib.types.nullOr lib.types.str; - }; - - proxyDomain = lib.mkOption { - default = null; - example = "code-server.lan"; - description = lib.mdDoc '' - Domain used for proxying ports. - ''; - type = lib.types.nullOr lib.types.str; - }; - - disableTelemetry = lib.mkOption { - default = false; - example = true; - description = lib.mdDoc '' - Disable telemetry. - ''; - type = lib.types.bool; - }; - - disableUpdateCheck = lib.mkOption { - default = false; - example = true; - description = lib.mdDoc '' - Disable update check. - Without this flag, code-server checks every 6 hours against the latest github release and - then notifies you once every week that a new release is available. - ''; - type = lib.types.bool; - }; - - disableFileDownloads = lib.mkOption { - default = false; - example = true; - description = lib.mdDoc '' - Disable file downloads from Code. - ''; - type = lib.types.bool; - }; - - disableWorkspaceTrust = lib.mkOption { - default = false; - example = true; - description = lib.mdDoc '' - Disable Workspace Trust feature. - ''; - type = lib.types.bool; - }; - - disableGettingStartedOverride = lib.mkOption { - default = false; - example = true; - description = lib.mdDoc '' - Disable the coder/coder override in the Help: Getting Started page. - ''; - type = lib.types.bool; - }; - - }; - }; - - config = lib.mkIf cfg.enable { - systemd.services.code-server = { - description = "Code server"; - wantedBy = [ "multi-user.target" ]; - after = [ "network-online.target" ]; - path = cfg.extraPackages; - environment = { - HASHED_PASSWORD = cfg.hashedPassword; - } // cfg.extraEnvironment; - serviceConfig = { - ExecStart = '' - ${lib.getExe cfg.package} \ - --auth=${cfg.auth} \ - --bind-addr=${cfg.host}:${toString cfg.port} \ - '' + lib.optionalString (cfg.socket != null) '' - --socket=${cfg.socket} \ - '' + lib.optionalString (cfg.userDataDir != null) '' - --user-data-dir=${cfg.userDataDir} \ - '' + lib.optionalString (cfg.extensionsDir != null) '' - --extensions-dir=${cfg.extensionsDir} \ - '' + lib.optionalString (cfg.disableTelemetry == true) '' - --disable-telemetry \ - '' + lib.optionalString (cfg.disableUpdateCheck == true) '' - --disable-update-check \ - '' + lib.optionalString (cfg.disableFileDownloads == true) '' - --disable-file-downloads \ - '' + lib.optionalString (cfg.disableWorkspaceTrust == true) '' - --disable-workspace-trust \ - '' + lib.optionalString (cfg.disableGettingStartedOverride == true) '' - --disable-getting-started-override \ - '' + lib.escapeShellArgs cfg.extraArguments; - ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID"; - RuntimeDirectory = cfg.user; - User = cfg.user; - Group = cfg.group; - Restart = "on-failure"; - }; - }; - - users.users."${cfg.user}" = lib.mkMerge [ - (lib.mkIf (cfg.user == defaultUser) { - isNormalUser = true; - description = "code-server user"; - inherit (cfg) group; - }) - { - packages = cfg.extraPackages; - inherit (cfg) extraGroups; - } - ]; - - users.groups."${defaultGroup}" = lib.mkIf (cfg.group == defaultGroup) { }; - }; - - meta.maintainers = [ lib.maintainers.stackshadow ]; -} diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 6c127efa4ce..6a654b00d76 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -192,7 +192,6 @@ in { cntr = handleTestOn ["aarch64-linux" "x86_64-linux"] ./cntr.nix {}; cockpit = handleTest ./cockpit.nix {}; cockroachdb = handleTestOn ["x86_64-linux"] ./cockroachdb.nix {}; - code-server = handleTest ./code-server.nix {}; coder = handleTest ./coder.nix {}; collectd = handleTest ./collectd.nix {}; connman = handleTest ./connman.nix {}; diff --git a/nixos/tests/code-server.nix b/nixos/tests/code-server.nix deleted file mode 100644 index 7d523dfc617..00000000000 --- a/nixos/tests/code-server.nix +++ /dev/null @@ -1,22 +0,0 @@ -import ./make-test-python.nix ({pkgs, lib, ...}: -{ - name = "code-server"; - - nodes = { - machine = {pkgs, ...}: { - services.code-server = { - enable = true; - auth = "none"; - }; - }; - }; - - testScript = '' - start_all() - machine.wait_for_unit("code-server.service") - machine.wait_for_open_port(4444) - machine.succeed("curl -k --fail http://localhost:4444", timeout=10) - ''; - - meta.maintainers = [ lib.maintainers.drupol ]; -}) diff --git a/pkgs/servers/code-server/build-vscode-nogit.patch b/pkgs/servers/code-server/build-vscode-nogit.patch deleted file mode 100644 index ec726c68d43..00000000000 --- a/pkgs/servers/code-server/build-vscode-nogit.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/ci/build/build-vscode.sh b/ci/build/build-vscode.sh -index a72549fb..3aed1ad5 100755 ---- a/ci/build/build-vscode.sh -+++ b/ci/build/build-vscode.sh -@@ -58,7 +58,6 @@ main() { - # telemetry available; telemetry can still be disabled by flag or setting). - # This needs to be done before building as Code will read this file and embed - # it into the client-side code. -- git checkout product.json # Reset in case the script exited early. - cp product.json product.original.json # Since jq has no inline edit. - jq --slurp '.[0] * .[1]' product.original.json <( - cat << EOF -@@ -105,7 +104,6 @@ EOF - # Reset so if you develop after building you will not be stuck with the wrong - # commit (the dev client will use `oss-dev` but the dev server will still use - # product.json which will have `stable-$commit`). -- git checkout product.json - - popd - diff --git a/pkgs/servers/code-server/default.nix b/pkgs/servers/code-server/default.nix deleted file mode 100644 index 0c5cb231085..00000000000 --- a/pkgs/servers/code-server/default.nix +++ /dev/null @@ -1,327 +0,0 @@ -{ lib -, stdenv -, fetchFromGitHub -, buildGoModule -, makeWrapper -, cacert -, moreutils -, jq -, git -, rsync -, pkg-config -, yarn -, python3 -, esbuild -, nodejs -, node-gyp -, libsecret -, xorg -, ripgrep -, AppKit -, Cocoa -, CoreServices -, Security -, cctools -, xcbuild -, quilt -, nixosTests -}: - -let - system = stdenv.hostPlatform.system; - - python = python3; - yarn' = yarn.override { inherit nodejs; }; - defaultYarnOpts = [ ]; - - esbuild' = esbuild.override { - buildGoModule = args: buildGoModule (args // rec { - version = "0.16.17"; - src = fetchFromGitHub { - owner = "evanw"; - repo = "esbuild"; - rev = "v${version}"; - hash = "sha256-8L8h0FaexNsb3Mj6/ohA37nYLFogo5wXkAhGztGUUsQ="; - }; - vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ="; - }); - }; - - # replaces esbuild's download script with a binary from nixpkgs - patchEsbuild = path: version: '' - mkdir -p ${path}/node_modules/esbuild/bin - jq "del(.scripts.postinstall)" ${path}/node_modules/esbuild/package.json | sponge ${path}/node_modules/esbuild/package.json - sed -i 's/${version}/${esbuild'.version}/g' ${path}/node_modules/esbuild/lib/main.js - ln -s -f ${esbuild'}/bin/esbuild ${path}/node_modules/esbuild/bin/esbuild - ''; - - # Comment from @code-asher, the code-server maintainer - # See https://github.com/NixOS/nixpkgs/pull/240001#discussion_r1244303617 - # - # If the commit is missing it will break display languages (Japanese, Spanish, - # etc). For some reason VS Code has a hard dependency on the commit being set - # for that functionality. - # The commit is also used in cache busting. Without the commit you could run - # into issues where the browser is loading old versions of assets from the - # cache. - # Lastly, it can be helpful for the commit to be accurate in bug reports - # especially when they are built outside of our CI as sometimes the version - # numbers can be unreliable (since they are arbitrarily provided). - # - # To compute the commit when upgrading this derivation, do: - # `$ git rev-parse ` where is the git revision of the `src` - # Example: `$ git rev-parse v4.16.1` - commit = "94ef3776ad7bebfb5780dfc9632e04d20d5c9a6c"; -in -stdenv.mkDerivation (finalAttrs: { - pname = "code-server"; - version = "4.16.1"; - - src = fetchFromGitHub { - owner = "coder"; - repo = "code-server"; - rev = "v${finalAttrs.version}"; - fetchSubmodules = true; - hash = "sha256-h4AooHHKV/EfN2S1z7CQKqnYW3uA3sKhSW4senlzjxI="; - }; - - yarnCache = stdenv.mkDerivation { - name = "${finalAttrs.pname}-${finalAttrs.version}-${system}-yarn-cache"; - inherit (finalAttrs) src; - - nativeBuildInputs = [ yarn' git cacert ]; - - buildPhase = '' - runHook preBuild - - export HOME=$PWD - export GIT_SSL_CAINFO="${cacert}/etc/ssl/certs/ca-bundle.crt" - - yarn --cwd "./vendor" install --modules-folder modules --ignore-scripts --frozen-lockfile - - yarn config set yarn-offline-mirror $out - find "$PWD" -name "yarn.lock" -printf "%h\n" | \ - xargs -I {} yarn --cwd {} \ - --frozen-lockfile --ignore-scripts --ignore-platform \ - --ignore-engines --no-progress --non-interactive - - find ./lib/vscode -name "yarn.lock" -printf "%h\n" | \ - xargs -I {} yarn --cwd {} \ - --ignore-scripts --ignore-engines - - runHook postBuild - ''; - - outputHashMode = "recursive"; - outputHashAlgo = "sha256"; - outputHash = "sha256-vkju+oxEYrEXFAnjz/Mf1g0ZhxBALLAaRuWE0swSWwM="; - }; - - nativeBuildInputs = [ - nodejs - yarn' - python - pkg-config - makeWrapper - git - rsync - jq - moreutils - quilt - ]; - - buildInputs = lib.optionals (!stdenv.isDarwin) [ libsecret ] - ++ (with xorg; [ libX11 libxkbfile ]) - ++ lib.optionals stdenv.isDarwin [ - AppKit - Cocoa - CoreServices - Security - cctools - xcbuild - ]; - - patches = [ - # Remove all git calls from the VS Code build script except `git rev-parse - # HEAD` which is replaced in postPatch with the commit. - ./build-vscode-nogit.patch - ]; - - postPatch = '' - export HOME=$PWD - - patchShebangs ./ci - - # inject git commit - substituteInPlace ./ci/build/build-vscode.sh \ - --replace '$(git rev-parse HEAD)' "${commit}" - substituteInPlace ./ci/build/build-release.sh \ - --replace '$(git rev-parse HEAD)' "${commit}" - ''; - - configurePhase = '' - runHook preConfigure - - # run yarn offline by default - echo '--install.offline true' >> .yarnrc - - # set default yarn opts - ${lib.concatMapStrings (option: '' - yarn --offline config set ${option} - '') defaultYarnOpts} - - # set offline mirror to yarn cache we created in previous steps - yarn --offline config set yarn-offline-mirror "${finalAttrs.yarnCache}" - - # skip unnecessary electron download - export ELECTRON_SKIP_BINARY_DOWNLOAD=1 - - # set nodedir to prevent node-gyp from downloading headers - # taken from https://nixos.org/manual/nixpkgs/stable/#javascript-tool-specific - mkdir -p $HOME/.node-gyp/${nodejs.version} - echo 9 > $HOME/.node-gyp/${nodejs.version}/installVersion - ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version} - export npm_config_nodedir=${nodejs} - - # use updated node-gyp. fixes the following error on Darwin: - # PermissionError: [Errno 1] Operation not permitted: '/usr/sbin/pkgutil' - export npm_config_node_gyp=${node-gyp}/lib/node_modules/node-gyp/bin/node-gyp.js - - runHook postConfigure - ''; - - buildPhase = '' - runHook preBuild - - # install code-server dependencies - yarn --offline --ignore-scripts - - # apply patches - quilt push -a - - # patch shebangs of everything to allow binary packages to build - patchShebangs . - - export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 - export SKIP_SUBMODULE_DEPS=1 - export NODE_OPTIONS=--openssl-legacy-provider - - # rebuild binary packages now that scripts have been patched - echo "----- NPM rebuild" - npm rebuild --prefer-offline - - # Replicate ci/dev/postinstall.sh - echo "----- Replicate ci/dev/postinstall.sh" - yarn --cwd "./vendor" install --modules-folder modules --offline --ignore-scripts --frozen-lockfile - - # remove all built-in extensions, as these are 3rd party extensions that - # get downloaded from vscode marketplace - jq --slurp '.[0] * .[1]' "./lib/vscode/product.json" <( - cat << EOF - { - "builtInExtensions": [] - } - EOF - ) | sponge ./lib/vscode/product.json - - # disable automatic updates - sed -i '/update.mode/,/\}/{s/default:.*/default: "none",/g}' \ - lib/vscode/src/vs/platform/update/common/update.config.contribution.ts - - # Patch out remote download of nodejs from build script - patch -p1 -i ${./remove-node-download.patch} - - # Fetch packages for vscode - find ./lib/vscode -name "yarn.lock" -printf "%h\n" | \ - xargs -I {} yarn --cwd {} \ - --frozen-lockfile --ignore-scripts --ignore-engines - - # patch shebangs of everything to allow binary packages to build - patchShebangs . - - ${patchEsbuild "./lib/vscode/build" "0.12.6"} - ${patchEsbuild "./lib/vscode/extensions" "0.11.23"} - '' + lib.optionalString stdenv.isDarwin '' - # use prebuilt binary for @parcel/watcher, which requires macOS SDK 10.13+ - # (see issue #101229) - pushd ./lib/vscode/remote/node_modules/@parcel/watcher - mkdir -p ./build/Release - mv ./prebuilds/darwin-x64/node.napi.glibc.node ./build/Release/watcher.node - jq "del(.scripts) | .gypfile = false" ./package.json | sponge ./package.json - popd - '' + '' - - # put ripgrep binary into bin, so postinstall does not try to download it - find -name ripgrep -type d \ - -execdir mkdir -p {}/bin \; \ - -execdir ln -s ${ripgrep}/bin/rg {}/bin/rg \; - - # run postinstall scripts after patching - find ./lib/vscode \( -path "*/node_modules/*" -or -path "*/extensions/*" \) \ - -and -type f -name "yarn.lock" -printf "%h\n" | \ - xargs -I {} sh -c 'jq -e ".scripts.postinstall" {}/package.json >/dev/null && yarn --cwd {} postinstall --frozen-lockfile --offline || true' - - # build code-server - yarn build - - # build vscode - VERSION=${finalAttrs.version} yarn build:vscode - - # inject version into package.json - jq --slurp '.[0] * .[1]' ./package.json <( - cat << EOF - { - "version": "${finalAttrs.version}" - } - EOF - ) | sponge ./package.json - - # create release - yarn release - - runHook postBuild - ''; - - installPhase = '' - runHook preInstall - - mkdir -p $out/libexec/code-server $out/bin - - # copy release to libexec path - cp -R -T release "$out/libexec/code-server" - - # install only production dependencies - yarn --offline --cwd "$out/libexec/code-server" --production - - # create wrapper - makeWrapper "${nodejs}/bin/node" "$out/bin/code-server" \ - --add-flags "$out/libexec/code-server/out/node/entry.js" - - runHook postInstall - ''; - - passthru = { - prefetchYarnCache = lib.overrideDerivation finalAttrs.yarnCache (d: { - outputHash = lib.fakeSha256; - }); - tests = { - inherit (nixosTests) code-server; - }; - # vscode-with-extensions compatibility - executableName = "code-server"; - longName = "Visual Studio Code Server"; - }; - - meta = { - description = "Run VS Code on a remote server"; - longDescription = '' - code-server is VS Code running on a remote server, accessible through the - browser. - ''; - homepage = "https://github.com/coder/code-server"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ offline henkery code-asher ]; - platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ]; - mainProgram = "code-server"; - }; -}) diff --git a/pkgs/servers/code-server/playwright.patch b/pkgs/servers/code-server/playwright.patch deleted file mode 100644 index 95a74748189..00000000000 --- a/pkgs/servers/code-server/playwright.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ./vendor/modules/code-oss-dev/node_modules/playwright/install.js -+++ ./vendor/modules/code-oss-dev/node_modules/playwright/install.js -@@ -14,6 +14,4 @@ - * limitations under the License. - */ - --const { installDefaultBrowsersForNpmInstall } = require('playwright-core/lib/utils/registry'); -- --installDefaultBrowsersForNpmInstall(); -+process.stdout.write('Browser install disabled by Nix build script\n'); diff --git a/pkgs/servers/code-server/remove-node-download.patch b/pkgs/servers/code-server/remove-node-download.patch deleted file mode 100644 index d19d4a2b5bf..00000000000 --- a/pkgs/servers/code-server/remove-node-download.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- ./lib/vscode/build/gulpfile.reh.js -+++ ./lib/vscode/build/gulpfile.reh.js -@@ -268,9 +268,6 @@ - .pipe(util.stripSourceMappingURL()) - .pipe(jsFilter.restore); - -- const nodePath = `.build/node/v${nodeVersion}/${platform}-${arch}`; -- const node = gulp.src(`${nodePath}/**`, { base: nodePath, dot: true }); -- - let web = []; - if (type === 'reh-web') { - web = [ -@@ -287,7 +284,6 @@ - license, - sources, - deps, -- node, - ...web - ); - -@@ -385,7 +381,6 @@ - const destinationFolderName = `vscode-${type}${dashed(platform)}${dashed(arch)}`; - - const serverTaskCI = task.define(`vscode-${type}${dashed(platform)}${dashed(arch)}${dashed(minified)}-ci`, task.series( -- gulp.task(`node-${platform}-${arch}`), - util.rimraf(path.join(BUILD_ROOT, destinationFolderName)), - packageTask(type, platform, arch, sourceFolderName, destinationFolderName) - )); diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index ef11a126762..22d68425f92 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -152,6 +152,7 @@ mapAliases ({ clasp = clingo; # added 2022-12-22 claws-mail-gtk3 = claws-mail; # Added 2021-07-10 cntk = throw "'cntk' has been removed from nixpkgs, as it was broken and unmaintained"; # Added 2023-10-09 + code-server = throw "'code-server' has been removed from nixpkgs, as it was depending on EOL Node.js and is unmaintained."; # Added 2023-10-30 codimd = hedgedoc; # Added 2020-11-29 inherit (libsForQt5.mauiPackages) communicator; # added 2022-05-17 compton = throw "'compton' has been renamed to/replaced by 'picom'"; # Converted to throw 2023-09-10 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 963f4bfdaa7..e9db1654159 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -36345,13 +36345,6 @@ with pkgs; inherit (nodePackages) node-gyp; }; - code-server = callPackage ../servers/code-server { - nodejs = nodejs_16; - inherit (darwin.apple_sdk.frameworks) AppKit Cocoa CoreServices Security; - inherit (darwin) cctools; - inherit (nodePackages) node-gyp; - }; - vue = callPackage ../applications/misc/vue { }; vuze = callPackage ../applications/networking/p2p/vuze { -- cgit 1.4.1 From 7d0e6984c6f8aac8360e1778d39ea2877278a7b4 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sat, 4 Nov 2023 18:20:16 +0100 Subject: rl-2311: explain how dependent packages were removed due to Node.js drop --- nixos/doc/manual/release-notes/rl-2311.section.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nixos') diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md index 1dbc33f2373..c00f60107fc 100644 --- a/nixos/doc/manual/release-notes/rl-2311.section.md +++ b/nixos/doc/manual/release-notes/rl-2311.section.md @@ -547,6 +547,10 @@ The module update takes care of the new config syntax and the data itself (user ## Nixpkgs internals {#sec-release-23.11-nixpkgs-internals} +- Node.js v14, v16 has been removed as they were end of life. Any dependent packages that contributors were not able to reasonably upgrade were dropped after a month of notice to their maintainers, were **removed**. + - This includes VSCode Server. + - This includes Kibana 7 as the ELK stack is unmaintained in nixpkgs and is marked for slow removal. + - The use of `sourceRoot = "source";`, `sourceRoot = "source/subdir";`, and similar lines in package derivations using the default `unpackPhase` is deprecated as it requires `unpackPhase` to always produce a directory named "source". Use `sourceRoot = src.name`, `sourceRoot = "${src.name}/subdir";`, or `setSourceRoot = "sourceRoot=$(echo */subdir)";` or similar instead. - The `django` alias in the python package set was upgraded to Django 4.x. -- cgit 1.4.1