From 2db95477f94d539cc4cbc1c82988aa8f963dae60 Mon Sep 17 00:00:00 2001 From: Casey Link Date: Sun, 30 Mar 2025 15:03:21 +0200 Subject: [PATCH] nixos/ocis: default to the newly renamed ocis-bin5 package And we are getting ready for ocis-bin7 to land, where we will need to compare it to the system.stateVersion. --- nixos/modules/services/web-apps/ocis.md | 2 +- nixos/modules/services/web-apps/ocis.nix | 8 +++++++- nixos/tests/ocis.nix | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/web-apps/ocis.md b/nixos/modules/services/web-apps/ocis.md index 9156e927ed2d..9a21ca25f14a 100644 --- a/nixos/modules/services/web-apps/ocis.md +++ b/nixos/modules/services/web-apps/ocis.md @@ -37,7 +37,7 @@ However to make this configuration work you will need generate a configuration. You can do this with: ```console -$ nix-shell -p ocis-bin +$ nix-shell -p ocis_5-bin $ mkdir scratch/ $ cd scratch/ $ ocis init --config-path . --admin-password "changeme" diff --git a/nixos/modules/services/web-apps/ocis.nix b/nixos/modules/services/web-apps/ocis.nix index 0266eb6ad29c..bc17dabade7f 100644 --- a/nixos/modules/services/web-apps/ocis.nix +++ b/nixos/modules/services/web-apps/ocis.nix @@ -16,7 +16,11 @@ in services.ocis = { enable = lib.mkEnableOption "ownCloud Infinite Scale"; - package = lib.mkPackageOption pkgs "ocis-bin" { }; + package = lib.mkOption { + type = types.package; + description = "Which package to use for the ownCloud Infinite Scale instance."; + relatedPackages = [ "ocis_5-bin" ]; + }; configDir = lib.mkOption { type = types.nullOr types.path; @@ -137,6 +141,8 @@ in }; config = lib.mkIf cfg.enable { + services.ocis.package = lib.mkDefault pkgs.ocis_5-bin; + users.users.${defaultUser} = lib.mkIf (cfg.user == defaultUser) { group = cfg.group; home = cfg.stateDir; diff --git a/nixos/tests/ocis.nix b/nixos/tests/ocis.nix index 35461e246749..a529b4385663 100644 --- a/nixos/tests/ocis.nix +++ b/nixos/tests/ocis.nix @@ -205,7 +205,7 @@ import ./make-test-python.nix ( machine.sleep(5) with subtest("ocis bin works"): - machine.succeed("${lib.getExe pkgs.ocis-bin} version") + machine.succeed("${lib.getExe pkgs.ocis_5-bin} version") with subtest("use the web interface to log in with a demo user"): machine.succeed("PYTHONUNBUFFERED=1 systemd-cat -t test-runner test-runner ${demoUser} ${demoPassword}")