diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2023-03-18 12:01:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-18 12:01:30 +0000 |
commit | a912b830519d782a31b9a529d784d63f1edb8e8d (patch) | |
tree | 9f9ebe682add4595c10dd7c17d52d9638175686f /nixos | |
parent | c5d119b5866da3eac42c5a4931478dbea0ab88bf (diff) | |
parent | a5f8184fb816a4fd5ae87136838c9981e0d22c67 (diff) |
Merge master into staging-next
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/misc/ids.nix | 4 | ||||
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/search/solr.nix | 110 | ||||
-rw-r--r-- | nixos/tests/all-tests.nix | 1 | ||||
-rw-r--r-- | nixos/tests/netdata.nix | 2 | ||||
-rw-r--r-- | nixos/tests/solr.nix | 56 | ||||
-rw-r--r-- | nixos/tests/xfce.nix | 2 |
7 files changed, 4 insertions, 172 deletions
diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index 17ea04cb4ecb5..bed50b81604da 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -338,7 +338,7 @@ in lidarr = 306; slurm = 307; kapacitor = 308; - solr = 309; + # solr = 309; removed 2023-03-16 alerta = 310; minetest = 311; rss2email = 312; @@ -648,7 +648,7 @@ in lidarr = 306; slurm = 307; kapacitor = 308; - solr = 309; + # solr = 309; removed 2023-03-16 alerta = 310; minetest = 311; rss2email = 312; diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index e5fc544d4eebb..22b949ad19896 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -1061,7 +1061,6 @@ ./services/search/meilisearch.nix ./services/search/opensearch.nix ./services/search/qdrant.nix - ./services/search/solr.nix ./services/security/aesmd.nix ./services/security/certmgr.nix ./services/security/cfssl.nix diff --git a/nixos/modules/services/search/solr.nix b/nixos/modules/services/search/solr.nix deleted file mode 100644 index 05592e9fa247d..0000000000000 --- a/nixos/modules/services/search/solr.nix +++ /dev/null @@ -1,110 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - - cfg = config.services.solr; - -in - -{ - options = { - services.solr = { - enable = mkEnableOption (lib.mdDoc "Solr"); - - package = mkOption { - type = types.package; - default = pkgs.solr; - defaultText = literalExpression "pkgs.solr"; - description = lib.mdDoc "Which Solr package to use."; - }; - - port = mkOption { - type = types.port; - default = 8983; - description = lib.mdDoc "Port on which Solr is ran."; - }; - - stateDir = mkOption { - type = types.path; - default = "/var/lib/solr"; - description = lib.mdDoc "The solr home directory containing config, data, and logging files."; - }; - - extraJavaOptions = mkOption { - type = types.listOf types.str; - default = []; - description = lib.mdDoc "Extra command line options given to the java process running Solr."; - }; - - user = mkOption { - type = types.str; - default = "solr"; - description = lib.mdDoc "User under which Solr is ran."; - }; - - group = mkOption { - type = types.str; - default = "solr"; - description = lib.mdDoc "Group under which Solr is ran."; - }; - }; - }; - - config = mkIf cfg.enable { - - environment.systemPackages = [ cfg.package ]; - - systemd.services.solr = { - after = [ "network.target" "remote-fs.target" "nss-lookup.target" "systemd-journald-dev-log.socket" ]; - wantedBy = [ "multi-user.target" ]; - - environment = { - SOLR_HOME = "${cfg.stateDir}/data"; - LOG4J_PROPS = "${cfg.stateDir}/log4j2.xml"; - SOLR_LOGS_DIR = "${cfg.stateDir}/logs"; - SOLR_PORT = "${toString cfg.port}"; - }; - path = with pkgs; [ - gawk - procps - ]; - preStart = '' - mkdir -p "${cfg.stateDir}/data"; - mkdir -p "${cfg.stateDir}/logs"; - - if ! test -e "${cfg.stateDir}/data/solr.xml"; then - install -D -m0640 ${cfg.package}/server/solr/solr.xml "${cfg.stateDir}/data/solr.xml" - install -D -m0640 ${cfg.package}/server/solr/zoo.cfg "${cfg.stateDir}/data/zoo.cfg" - fi - - if ! test -e "${cfg.stateDir}/log4j2.xml"; then - install -D -m0640 ${cfg.package}/server/resources/log4j2.xml "${cfg.stateDir}/log4j2.xml" - fi - ''; - - serviceConfig = { - User = cfg.user; - Group = cfg.group; - ExecStart="${cfg.package}/bin/solr start -f -a \"${concatStringsSep " " cfg.extraJavaOptions}\""; - ExecStop="${cfg.package}/bin/solr stop"; - }; - }; - - users.users = optionalAttrs (cfg.user == "solr") { - solr = { - group = cfg.group; - home = cfg.stateDir; - createHome = true; - uid = config.ids.uids.solr; - }; - }; - - users.groups = optionalAttrs (cfg.group == "solr") { - solr.gid = config.ids.gids.solr; - }; - - }; - -} diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 97be13f3bed0b..8386219f73d83 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -624,7 +624,6 @@ in { soapui = handleTest ./soapui.nix {}; sogo = handleTest ./sogo.nix {}; solanum = handleTest ./solanum.nix {}; - solr = handleTest ./solr.nix {}; sonarr = handleTest ./sonarr.nix {}; sourcehut = handleTest ./sourcehut.nix {}; spacecookie = handleTest ./spacecookie.nix {}; diff --git a/nixos/tests/netdata.nix b/nixos/tests/netdata.nix index 0f26630da9d4b..aea67c29d0d4b 100644 --- a/nixos/tests/netdata.nix +++ b/nixos/tests/netdata.nix @@ -3,7 +3,7 @@ import ./make-test-python.nix ({ pkgs, ...} : { name = "netdata"; meta = with pkgs.lib.maintainers; { - maintainers = [ cransom ]; + maintainers = [ cransom raitobezarius ]; }; nodes = { diff --git a/nixos/tests/solr.nix b/nixos/tests/solr.nix deleted file mode 100644 index 33afe9d788f78..0000000000000 --- a/nixos/tests/solr.nix +++ /dev/null @@ -1,56 +0,0 @@ -import ./make-test-python.nix ({ pkgs, ... }: - -{ - name = "solr"; - meta.maintainers = [ pkgs.lib.maintainers.aanderse ]; - - nodes.machine = - { config, pkgs, ... }: - { - # Ensure the virtual machine has enough memory for Solr to avoid the following error: - # - # OpenJDK 64-Bit Server VM warning: - # INFO: os::commit_memory(0x00000000e8000000, 402653184, 0) - # failed; error='Cannot allocate memory' (errno=12) - # - # There is insufficient memory for the Java Runtime Environment to continue. - # Native memory allocation (mmap) failed to map 402653184 bytes for committing reserved memory. - virtualisation.memorySize = 2000; - - services.solr.enable = true; - }; - - testScript = '' - start_all() - - machine.wait_for_unit("solr.service") - machine.wait_for_open_port(8983) - machine.succeed("curl --fail http://localhost:8983/solr/") - - # adapted from pkgs.solr/examples/films/README.txt - machine.succeed("sudo -u solr solr create -c films") - assert '"status":0' in machine.succeed( - """ - curl http://localhost:8983/solr/films/schema -X POST -H 'Content-type:application/json' --data-binary '{ - "add-field" : { - "name":"name", - "type":"text_general", - "multiValued":false, - "stored":true - }, - "add-field" : { - "name":"initial_release_date", - "type":"pdate", - "stored":true - } - }' - """ - ) - machine.succeed( - "sudo -u solr post -c films ${pkgs.solr}/example/films/films.json" - ) - assert '"name":"Batman Begins"' in machine.succeed( - "curl http://localhost:8983/solr/films/query?q=name:batman" - ) - ''; -}) diff --git a/nixos/tests/xfce.nix b/nixos/tests/xfce.nix index 31f00f77c40d4..3758ccbccf425 100644 --- a/nixos/tests/xfce.nix +++ b/nixos/tests/xfce.nix @@ -26,7 +26,7 @@ import ./make-test-python.nix ({ pkgs, ...} : { }; testScript = { nodes, ... }: let - user = nodes.machine.config.users.users.alice; + user = nodes.machine.users.users.alice; in '' machine.wait_for_x() machine.wait_for_file("${user.home}/.Xauthority") |