Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/wallabag: init #54863

Closed
wants to merge 2 commits into from
Closed

nixos/wallabag: init #54863

wants to merge 2 commits into from

Conversation

Nadrieril
Copy link
Contributor

@Nadrieril Nadrieril commented Jan 29, 2019

Motivation for this change

wallabag is a convenient little service that allows to save links to read them later. It has an android app and a firefox extension.
This PR adds a module that sets up a wallabag instance with nginx and php-fpm. I also added a nixos test.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@immae immae left a comment

Choose a reason for hiding this comment

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

Hi,
Just a note: I didn’t check the effect of the WALLABAG_DATA environment variable, so I may be wrong, but wallabag install expects to be able write to: ./var, ./data (sqlite database) and ./web/assets (for thumbnail images).

Could you check that modifying only WALLABAG_DATA is enough to handle the three locations?

@Nadrieril
Copy link
Contributor Author

I have the service running with this configuration on my server, and so far it seems to work well. I have only tried with postgresql, but sqlite should work since you can override the database location as needed.

@immae
Copy link
Contributor

immae commented Jan 31, 2019

@Nadrieril : how about the assets? It may be unseen if you don’t watch for it. If you want an example, you can try to import https://nvie.com/posts/a-successful-git-branching-model/ in your wallabag. It should show a custom (not wallabag default) thumbnail in the list

@Nadrieril
Copy link
Contributor Author

Oh, well spotted ! The assets get stored correctly under $WALLABAG_DATA, but the nginx config I wrote did not serve them correctly. That's now fixed, thanks.

@immae
Copy link
Contributor

immae commented Feb 1, 2019

Thanks for the confirmation @Nadrieril
May I ask how you learned about this environment variable? I see it nowhere in the documentation, nor does a grep return anything (I suppose there are string concatenation somewhere), so I’m a bit puzzled as to how you found it.

@Nadrieril
Copy link
Contributor Author

Nadrieril commented Feb 1, 2019

Ah yes, it's not from wallabag itself; it was added in the nix package (though not by me):

patches = [ ./wallabag-data.patch ]; # exposes $WALLABAG_DATA
and https://github.com/NixOS/nixpkgs/blob/10dbdd30d1/pkgs/servers/web-apps/wallabag/wallabag-data.patch

@immae
Copy link
Contributor

immae commented Feb 1, 2019

Oh that’s why, thanks a lot!

nixos/modules/services/web-apps/wallabag.nix Show resolved Hide resolved
};

poolConfig = mkOption {
type = types.lines;
Copy link
Member

Choose a reason for hiding this comment

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

This could be turned into an attrset that's automatically turned into lines via something like toKeyValue {} cfg.poolConfig. This could make the merging behavior more pleasant.

'';
};

conf = mkOption {
Copy link
Member

Choose a reason for hiding this comment

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

This might deserve an example, or at least a link to wallabag's docs in the description.

@@ -208,6 +208,7 @@ in
upnp = handleTest ./upnp.nix {};
vault = handleTest ./vault.nix {};
virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {};
wallabag = handleTestOn ["x86_64-linux"] ./wallabag.nix {};
Copy link
Member

Choose a reason for hiding this comment

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

Does wallabag work only on x86_64-linux?

database_port: null
database_name: wallabag
database_user: wallabag
database_password: password
Copy link
Member

Choose a reason for hiding this comment

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

Is there a way to not put the database password in the store? I'm thinking it might make sense to just pass the path to the wallabag config file instead of passing the whole file here, in a manner similar to networking.supplicant.*.configFile.path, for security reasons.

@aanderse
Copy link
Member

aanderse commented Aug 5, 2019

@Nadrieril are you motivated to continue with this PR?

@Nadrieril
Copy link
Contributor Author

@aanderse Not any more, sorry. You're welcome to take over if you're interested

@aanderse
Copy link
Member

aanderse commented Aug 5, 2019

@Nadrieril sorry to hear things didn't work out. I'll close this PR as it isn't being pursued any longer.

@aanderse aanderse closed this Aug 5, 2019
jtojnar added a commit to jtojnar/nixfiles that referenced this pull request Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants