Skip to content

Commit

Permalink
fixup! fix setting default exporter settings
Browse files Browse the repository at this point in the history
`v.default` always fails because v is the (boolean) attrvalue of the
default settings.

`lib.mkOptionDefault v` would work fine.
But let's just plainly set the default option value.
This way, we can later convert the `settings` option to use
@Atemu's `defaultPriority` (NixOS#296979)
without forcing users to update their config.
  • Loading branch information
erikarvstedt committed Jan 5, 2025
1 parent 8fc7e98 commit 42c672c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions nixos/modules/services/misc/paperless.nix
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,7 @@ in
"d '${cfg.exporter.directory}' - ${cfg.user} ${config.users.users.${cfg.user}.group} - -"
];

services.paperless.exporter.settings =
lib.mapAttrs (n: v: lib.mkOptionDefault v.default) options.services.paperless.exporter.settings.default;
services.paperless.exporter.settings = options.services.paperless.exporter.settings.default;

systemd.services.paperless-exporter = {
startAt = lib.defaultTo [] cfg.exporter.onCalendar;
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/paperless.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import ./make-test-python.nix ({ lib, ... }: {
enable = true;

settings = {
"no-color" = false; # override a default option
"no-color" = lib.mkForce false; # override a default option
"no-thumbnail" = true; # add a new option
};

Expand Down

1 comment on commit 42c672c

@Atemu
Copy link

@Atemu Atemu commented on 42c672c Jan 6, 2025

Choose a reason for hiding this comment

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

(Please don't @-mention people in commit messages, they get pinged for every version of the commit that is ever pushed.)

Please sign in to comment.