Conversation
| type = lib.types.nullOr ( | ||
| lib.types.enum [ | ||
| "ERROR" | ||
| "NOTICE" | ||
| "INFO" | ||
| "DEBUG" | ||
| ] | ||
| ); |
There was a problem hiding this comment.
No need for nullOr:
| type = lib.types.nullOr ( | |
| lib.types.enum [ | |
| "ERROR" | |
| "NOTICE" | |
| "INFO" | |
| "DEBUG" | |
| ] | |
| ); | |
| type = lib.types.enum [ | |
| null | |
| "ERROR" | |
| "NOTICE" | |
| "INFO" | |
| "DEBUG" | |
| ]; |
| Set the log-level. | ||
| See: https://rclone.org/docs/#logging |
There was a problem hiding this comment.
| Set the log-level. | |
| See: https://rclone.org/docs/#logging | |
| Set the log level. See <https://rclone.org/docs/#logging> for more. |
| The protocol to serve this path using. | ||
| See: https://rclone.org/commands/rclone_serve |
There was a problem hiding this comment.
| The protocol to serve this path using. | |
| See: https://rclone.org/commands/rclone_serve | |
| The protocol to use when serve this path. | |
| See <https://rclone.org/commands/rclone_serve> for more. |
| example = "http"; | ||
| }; | ||
|
|
||
| autoServe = lib.mkEnableOption "automatic serving" // { |
There was a problem hiding this comment.
I believe autoStart is a more common nomenclature.
| autoServe = lib.mkEnableOption "automatic serving" // { | |
| autoStart = lib.mkEnableOption "automatic serving" // { |
There was a problem hiding this comment.
Also the description is pretty unclear. Should be expanded a bit to make it clear it will cause the service to start on login.
| ); | ||
|
|
||
| serveServices = lib.listToAttrs ( | ||
| lib.concatMap |
There was a problem hiding this comment.
This code is completely unclear and definitely needs to be refactored into some more understandable form.
| @@ -0,0 +1,81 @@ | |||
| { pkgs, lib, ... }: | |||
There was a problem hiding this comment.
While it is very nice you added an integration test I would suggest to also add a unit test that verifies that the expected service files are created. Since integration tests are not typically run in CI we would otherwise easily miss regressions.
|
Thanks for the contribution, I've added some comments. |
Description
Adds support for rclone serve in a similar way to the mounts.
I pretty much copied the mounts and modified it slightly since both commands are pretty similar, mountpoint is just replaced with the protocol to serve on.
The unit tests I was unable to get running, even on master. Possibly related to #8114? I did add some however.
I tested this manually with an HTTP serve on my machine and it works as intended.
Checklist
Change is backwards compatible.
Code formatted with
nix fmtornix-shell -p treefmt nixfmt deadnix keep-sorted nixf-diagnose --run treefmt.Code tested through
nix run .#tests -- test-allornix-shell --pure tests -A run.all.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
If this PR adds an exciting new feature or contains a breaking change.