From 6b4ac7dc11280444cea4846ad90899603ebb233d Mon Sep 17 00:00:00 2001 From: Leona Maroni Date: Thu, 17 Oct 2024 18:59:11 +0200 Subject: [PATCH 1/2] youtrack_2022_3: drop --- pkgs/by-name/yo/youtrack_2022_3/package.nix | 32 --------------------- pkgs/top-level/aliases.nix | 1 + 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 pkgs/by-name/yo/youtrack_2022_3/package.nix diff --git a/pkgs/by-name/yo/youtrack_2022_3/package.nix b/pkgs/by-name/yo/youtrack_2022_3/package.nix deleted file mode 100644 index 5e1ab1a754f5..000000000000 --- a/pkgs/by-name/yo/youtrack_2022_3/package.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ lib, stdenv, fetchurl, makeWrapper, jdk17, gawk }: - -stdenv.mkDerivation (finalAttrs: { - pname = "youtrack"; - version = "2022.3.65371"; - - jar = fetchurl { - url = "https://download.jetbrains.com/charisma/youtrack-${finalAttrs.version}.jar"; - hash = "sha256-NQKWmKEq5ljUXd64zY27Nj8TU+uLdA37chbFVdmwjNs="; - }; - - nativeBuildInputs = [ makeWrapper ]; - - dontUnpack = true; - - installPhase = '' - runHook preInstall - makeWrapper ${jdk17}/bin/java $out/bin/youtrack \ - --add-flags "\$YOUTRACK_JVM_OPTS -jar $jar" \ - --prefix PATH : "${lib.makeBinPath [ gawk ]}" \ - --set JRE_HOME ${jdk17} - runHook postInstall - ''; - - meta = { - description = "Issue tracking and project management tool for developers"; - maintainers = lib.teams.serokell.members ++ [ lib.maintainers.leona ]; - sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; - # https://www.jetbrains.com/youtrack/buy/license.html - license = lib.licenses.unfree; - }; -}) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 16bc4f059475..8425541915f8 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1775,6 +1775,7 @@ mapAliases { yafaray-core = libyafaray; # Added 2022-09-23 yarn2nix-moretea-openssl_1_1 = throw "'yarn2nix-moretea-openssl_1_1' has been removed."; # Added 2023-02-04 yi = throw "'yi' has been removed, as it was broken and unmaintained"; # added 2024-05-09 + youtrack_2022_3 = throw "'youtrack_2022_3' has been removed as it was deprecated. Please update to the 'youtrack' package."; # Added 2024-10-17 yrd = throw "'yrd' has been removed, as it was broken and unmaintained"; # added 2024-05-27 yubikey-manager4 = throw "yubikey-manager4 has been removed, since it is no longer required by yubikey-manager-qt. Please update to yubikey-manager."; # Added 2024-01-14 yuzu-ea = throw "yuzu-ea has been removed from nixpkgs, as it has been taken down upstream"; # Added 2024-03-04 From dc14253a18e616b0eb1350080661544fd63338d5 Mon Sep 17 00:00:00 2001 From: Leona Maroni Date: Thu, 17 Oct 2024 18:59:49 +0200 Subject: [PATCH 2/2] nixos/youtrack: drop support for YouTrack 2022.3 --- nixos/modules/services/web-apps/youtrack.nix | 152 +++++-------------- 1 file changed, 39 insertions(+), 113 deletions(-) diff --git a/nixos/modules/services/web-apps/youtrack.nix b/nixos/modules/services/web-apps/youtrack.nix index ff48a978b734..e80cdda68087 100644 --- a/nixos/modules/services/web-apps/youtrack.nix +++ b/nixos/modules/services/web-apps/youtrack.nix @@ -9,6 +9,8 @@ in (lib.mkRenamedOptionModule [ "services" "youtrack" "port" ] [ "services" "youtrack" "environmentalParameters" "listen-port" ]) (lib.mkRemovedOptionModule [ "services" "youtrack" "maxMemory" ] "Please instead use `services.youtrack.generalParameters`.") (lib.mkRemovedOptionModule [ "services" "youtrack" "maxMetaspaceSize" ] "Please instead use `services.youtrack.generalParameters`.") + (lib.mkRemovedOptionModule [ "services" "youtrack" "extraParams" ] "Please migrate to `services.youtrack.generalParameters`.") + (lib.mkRemovedOptionModule [ "services" "youtrack" "jvmOpts" ] "Please migrate to `services.youtrack.generalParameters`.") ]; options.services.youtrack = { @@ -22,33 +24,15 @@ in type = lib.types.str; }; - extraParams = lib.mkOption { - default = {}; - description = '' - Extra parameters to pass to youtrack. - Use to configure YouTrack 2022.x, deprecated with YouTrack 2023.x. Use `services.youtrack.generalParameters`. - https://www.jetbrains.com/help/youtrack/standalone/YouTrack-Java-Start-Parameters.html - for more information. - ''; - example = lib.literalExpression '' - { - "jetbrains.youtrack.overrideRootPassword" = "tortuga"; - } - ''; - type = lib.types.attrsOf lib.types.str; - visible = false; - }; - package = lib.mkOption { description = '' Package to use. ''; type = lib.types.package; - default = null; - relatedPackages = [ "youtrack_2022_3" "youtrack" ]; + default = pkgs.youtrack; + defaultText = lib.literalExpression "pkgs.youtrack"; }; - statePath = lib.mkOption { description = '' Path were the YouTrack state is stored. @@ -67,19 +51,6 @@ in type = lib.types.nullOr lib.types.str; }; - jvmOpts = lib.mkOption { - description = '' - Extra options to pass to the JVM. - Only has a use with YouTrack 2022.x, deprecated with YouTrack 2023.x. Use `serivces.youtrack.generalParameters`. - See https://www.jetbrains.com/help/youtrack/standalone/Configure-JVM-Options.html - for more information. - ''; - type = lib.types.separatedString " "; - example = "--J-XX:MetaspaceSize=250m"; - default = ""; - visible = false; - }; - autoUpgrade = lib.mkOption { type = lib.types.bool; default = true; @@ -90,7 +61,6 @@ in type = with lib.types; listOf str; description = '' General configuration parameters and other JVM options. - Only has an effect for YouTrack 2023.x. See https://www.jetbrains.com/help/youtrack/server/2023.3/youtrack-java-start-parameters.html#general-parameters for more information. ''; @@ -121,7 +91,6 @@ in }; description = '' Environmental configuration parameters, set imperatively. The values doesn't get removed, when removed in Nix. - Only has an effect for YouTrack 2023.x. See https://www.jetbrains.com/help/youtrack/server/2023.3/youtrack-java-start-parameters.html#environmental-parameters for more information. ''; @@ -135,90 +104,47 @@ in }; config = lib.mkIf cfg.enable { - warnings = lib.optional (lib.versions.major cfg.package.version <= "2022") - "YouTrack 2022.x is deprecated. See https://nixos.org/manual/nixos/unstable/index.html#module-services-youtrack for details on how to upgrade." - ++ lib.optional (cfg.extraParams != {} && (lib.versions.major cfg.package.version >= "2023")) - "'services.youtrack.extraParams' is deprecated and has no effect on YouTrack 2023.x and newer. Please migrate to 'services.youtrack.generalParameters'" - ++ lib.optional (cfg.jvmOpts != "" && (lib.versions.major cfg.package.version >= "2023")) - "'services.youtrack.jvmOpts' is deprecated and has no effect on YouTrack 2023.x and newer. Please migrate to 'services.youtrack.generalParameters'"; - - # XXX: Drop all version feature switches at the point when we consider YT 2022.3 as outdated. - services.youtrack.package = lib.mkDefault ( - if lib.versionAtLeast config.system.stateVersion "24.11" then pkgs.youtrack - else pkgs.youtrack_2022_3 - ); - - services.youtrack.generalParameters = lib.optional (lib.versions.major cfg.package.version >= "2023") - "-Ddisable.configuration.wizard.on.upgrade=${lib.boolToString cfg.autoUpgrade}" - ++ (lib.mapAttrsToList (k: v: "-D${k}=${v}") cfg.extraParams); + services.youtrack.generalParameters = [ "-Ddisable.configuration.wizard.on.upgrade=${lib.boolToString cfg.autoUpgrade}" ]; systemd.services.youtrack = let - service_jar = let - mergeAttrList = lib.foldl' lib.mergeAttrs {}; - stdParams = mergeAttrList [ - (lib.optionalAttrs (cfg.environmentalParameters ? base-url && cfg.environmentalParameters.base-url != null) { - "jetbrains.youtrack.baseUrl" = cfg.environmentalParameters.base-url; - }) - { - "java.aws.headless" = "true"; - "jetbrains.youtrack.disableBrowser" = "true"; - } - ]; - extraAttr = lib.concatStringsSep " " (lib.mapAttrsToList (k: v: "-D${k}=${v}") (stdParams // cfg.extraParams)); - in { - environment.HOME = cfg.statePath; - environment.YOUTRACK_JVM_OPTS = "${extraAttr}"; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - path = with pkgs; [ unixtools.hostname ]; - serviceConfig = { + jvmoptions = pkgs.writeTextFile { + name = "youtrack.jvmoptions"; + text = (lib.concatStringsSep "\n" cfg.generalParameters); + }; + + package = cfg.package.override { + statePath = cfg.statePath; + }; + in { + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + path = with pkgs; [ unixtools.hostname ]; + preStart = '' + # This detects old (i.e. <= 2022.3) installations that were not migrated yet + # and migrates them to the new state directory style + if [[ -d ${cfg.statePath}/teamsysdata ]] && [[ ! -d ${cfg.statePath}/2022_3 ]] + then + mkdir -p ${cfg.statePath}/2022_3 + mv ${cfg.statePath}/teamsysdata ${cfg.statePath}/2022_3 + mv ${cfg.statePath}/.youtrack ${cfg.statePath}/2022_3 + fi + mkdir -p ${cfg.statePath}/{backups,conf,data,logs,temp} + ${pkgs.coreutils}/bin/ln -fs ${jvmoptions} ${cfg.statePath}/conf/youtrack.jvmoptions + ${package}/bin/youtrack configure ${lib.concatStringsSep " " (lib.mapAttrsToList (name: value: "--${name}=${toString value}") cfg.environmentalParameters )} + ''; + serviceConfig = lib.mkMerge [ + { Type = "simple"; User = "youtrack"; Group = "youtrack"; Restart = "on-failure"; - ExecStart = ''${cfg.package}/bin/youtrack ${cfg.jvmOpts} ${cfg.environmentalParameters.listen-address}:${toString cfg.environmentalParameters.listen-port}''; - }; - }; - service_zip = let - jvmoptions = pkgs.writeTextFile { - name = "youtrack.jvmoptions"; - text = (lib.concatStringsSep "\n" cfg.generalParameters); - }; - - package = cfg.package.override { - statePath = cfg.statePath; - }; - in { - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - path = with pkgs; [ unixtools.hostname ]; - preStart = '' - # This detects old (i.e. <= 2022.3) installations that were not migrated yet - # and migrates them to the new state directory style - if [[ -d ${cfg.statePath}/teamsysdata ]] && [[ ! -d ${cfg.statePath}/2022_3 ]] - then - mkdir -p ${cfg.statePath}/2022_3 - mv ${cfg.statePath}/teamsysdata ${cfg.statePath}/2022_3 - mv ${cfg.statePath}/.youtrack ${cfg.statePath}/2022_3 - fi - mkdir -p ${cfg.statePath}/{backups,conf,data,logs,temp} - ${pkgs.coreutils}/bin/ln -fs ${jvmoptions} ${cfg.statePath}/conf/youtrack.jvmoptions - ${package}/bin/youtrack configure ${lib.concatStringsSep " " (lib.mapAttrsToList (name: value: "--${name}=${toString value}") cfg.environmentalParameters )} - ''; - serviceConfig = lib.mkMerge [ - { - Type = "simple"; - User = "youtrack"; - Group = "youtrack"; - Restart = "on-failure"; - ExecStart = "${package}/bin/youtrack run"; - } - (lib.mkIf (cfg.statePath == "/var/lib/youtrack") { - StateDirectory = "youtrack"; - }) - ]; - }; - in if (lib.versions.major cfg.package.version >= "2023") then service_zip else service_jar; + ExecStart = "${package}/bin/youtrack run"; + } + (lib.mkIf (cfg.statePath == "/var/lib/youtrack") { + StateDirectory = "youtrack"; + }) + ]; + }; users.users.youtrack = { description = "Youtrack service user";