Skip to content

Conversation

@Joker9944
Copy link
Contributor

Description

Add a new service module: gotify-desktop a Gotify message forward daemon.

Notable things:

  • gotify-desktop does support darwin but I'm not sure how to create the systemd service equivalent for darwin. So I designed the module as linux only.
  • The token option is a bit weird but is in the expected format for the service.
  • Running all tests fails on a unrelated test, but all added tests run successfully.

Checklist

  • Change is backwards compatible.

  • Code formatted with nix fmt or
    nix-shell -p treefmt nixfmt deadnix keep-sorted --run treefmt.

  • Code tested through nix run .#tests -- test-all or
    nix-shell --pure tests -A run.all.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.
    • Generate a news entry. See News
    • Basic tests added. See Tests
  • If this PR adds an exciting new feature or contains a breaking change.

    • Generate a news entry. See News

Comment on lines 4 to 6
gotify-dekstop-str-token = ./gotify-dekstop-str-token.nix;
gotify-dekstop-command-token = ./gotify-dekstop-command-token.nix;
gotify-dekstop-extra-config = ./gotify-dekstop-extra-config.nix;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be helpful to have tests that verify settings not included when not configured.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment bellow.

(lib.hm.assertions.assertPlatform "services.gotify-desktop" pkgs lib.platforms.linux)
];

xdg.configFile."gotify-desktop/config.toml".source = configToml;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally prefer checking if anything has been configured, at all before creating a file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The url and token settings are required, so I elected to give them their own module option. They are added to the user set optional settings. Meaning settings is guaranteed to be set with a valid module definition.

The original implementation was subpar so this wasn't obvious. I changed the implementation be more nixy.

@Joker9944 Joker9944 force-pushed the gotify-desktop branch 2 times, most recently from 802bd6d to 3cf5447 Compare December 3, 2025 10:50
Co-authored-by: Austin Horstman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants