Merge pull request #190695 from Mic92/gollum

nixos/gollum: add package option
This commit is contained in:
Jörg Thalheim 2022-09-10 18:27:29 +02:00 committed by GitHub
commit 67db9b4ad1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 2 deletions

View file

@ -87,6 +87,14 @@ in
description = lib.mdDoc "Specifies the path of the repository directory. If it does not exist, Gollum will create it on startup.";
};
package = mkOption {
type = types.package;
default = pkgs.gollum;
defaultText = literalExpression "pkgs.gollum";
description = lib.mdDoc ''
The package used in the service
'';
};
};
config = mkIf cfg.enable {
@ -120,7 +128,7 @@ in
Group = config.users.groups.gollum.name;
WorkingDirectory = cfg.stateDir;
ExecStart = ''
${pkgs.gollum}/bin/gollum \
${cfg.package}/bin/gollum \
--port ${toString cfg.port} \
--host ${cfg.address} \
--config ${pkgs.writeText "gollum-config.rb" cfg.extraConfig} \

View file

@ -189,6 +189,7 @@ in {
gobgpd = handleTest ./gobgpd.nix {};
gocd-agent = handleTest ./gocd-agent.nix {};
gocd-server = handleTest ./gocd-server.nix {};
gollum = handleTest ./gollum.nix {};
google-oslogin = handleTest ./google-oslogin {};
gotify-server = handleTest ./gotify-server.nix {};
grafana = handleTest ./grafana.nix {};

14
nixos/tests/gollum.nix Normal file
View file

@ -0,0 +1,14 @@
import ./make-test-python.nix ({ pkgs, ... }: {
name = "gollum";
nodes = {
webserver = { pkgs, lib, ... }: {
services.gollum.enable = true;
};
};
testScript = { nodes, ... }: ''
webserver.wait_for_unit("gollum")
webserver.wait_for_open_port(${toString nodes.webserver.config.services.gollum.port})
'';
})

View file

@ -1,4 +1,4 @@
{ lib, bundlerApp, bundlerUpdateScript, ruby, makeWrapper, git, docutils }:
{ lib, bundlerApp, bundlerUpdateScript, ruby, makeWrapper, git, docutils, nixosTests }:
bundlerApp rec {
pname = "gollum";
@ -10,6 +10,7 @@ bundlerApp rec {
nativeBuildInputs = [ makeWrapper ];
passthru.updateScript = bundlerUpdateScript "gollum";
passthru.tests.gollum = nixosTests.gollum;
meta = with lib; {
description = "A simple, Git-powered wiki with a sweet API and local frontend";