NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.31k stars 13.55k forks source link

rsyncd fails to parse auth users list / example incorrect #317875

Open catleeball opened 3 months ago

catleeball commented 3 months ago

Describe the bug

Setting "auth users" as specified by the example in the documentation fails at build time.

Steps To Reproduce

Steps to reproduce the behavior:

  1. In NixOS, add the example from the docs to your /etc/nixos/configuration.nix
services.rsyncd = {
    enable = true;
    settings = {
      global = {
        uid = "nobody";
        gid = "nobody";
        "use chroot" = true;
        "max connections" = 4;
      };
      ftp = {
        path = "/var/ftp/./pub";
        comment = "whole ftp area";
      };
      cvs = {
        path = "/data/cvs";
        comment = "CVS repository (requires authentication)";
        "auth users" = [ "tridge" "susan" ];
        "secrets file" = "/etc/rsyncd.secrets";
      };
};
  1. Run nixos-rebuild switch
  2. Get the following error:
unpacking channels...
building Nix...
building the system configuration...
error:
       … while calling the 'head' builtin

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:809:9:

          808|     in warnDeprecation opt //
          809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          810|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: A definition for option `services.rsyncd.settings.cvs."auth users"' is not of type `INI atom (null, bool, int, float or string)'. Definition values:
       - In `/etc/nixos/configuration.nix':
           [
             "tridge"
             "susan"
           ]

Expected behavior

Rsyncd builds without issue and runs with the specified auth users.

Additional context

Tested on NixOS 24.05 with uname -a: Linux beppo 6.9.3 #1-NixOS SMP PREEMPT_DYNAMIC Thu May 30 07:45:04 UTC 2024 x86_64 GNU/Linux

Notify maintainers

@ehmry , @stuebinm

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.3, NixOS, 24.05 (Uakari), 24.05.984.0b8e7a1ae5a9`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixos-24.05"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

stuebinm commented 3 months ago

Hi! I do not maintain nor have any involvement in this module (the change you saw was an unrelated tree-wide mass removal of the deprecated lib.mdDoc function); please do not ping people who last touched a file if it has a defined list of maintainers. I'll now unsubscribe from this issue.

ehmry commented 3 months ago

We've had other problems with the Rsync configuration generator - #304293

catleeball commented 2 months ago

Hi! I do not maintain nor have any involvement in this module (the change you saw was an unrelated tree-wide mass removal of the deprecated lib.mdDoc function); please do not ping people who last touched a file if it has a defined list of maintainers. I'll now unsubscribe from this issue.

Sorry, my mistake @stuebinm !