Unverified Commit 63347957 authored by nessdoor's avatar nessdoor Committed by GitHub
Browse files

nixos/nsswitch: add support for overriding sudoers entries (#310818)

parent bef59fb5
Loading
Loading
Loading
Loading
+20 −6
Original line number Diff line number Diff line
@@ -62,6 +62,18 @@ with lib;
        default = [ ];
      };

      sudoers = mkOption {
        type = types.listOf types.str;
        description = ''
          List of sudoers entries to configure in {file}`/etc/nsswitch.conf`.

          Note that "files" is always prepended.

          This option only takes effect if nscd is enabled.
        '';
        default = [ ];
      };

      hosts = mkOption {
        type = types.listOf types.str;
        description = ''
@@ -112,6 +124,7 @@ with lib;
      passwd:    ${concatStringsSep " " config.system.nssDatabases.passwd}
      group:     ${concatStringsSep " " config.system.nssDatabases.group}
      shadow:    ${concatStringsSep " " config.system.nssDatabases.shadow}
      sudoers:   ${concatStringsSep " " config.system.nssDatabases.sudoers}

      hosts:     ${concatStringsSep " " config.system.nssDatabases.hosts}
      networks:  files
@@ -126,6 +139,7 @@ with lib;
      passwd = mkBefore [ "files" ];
      group = mkBefore [ "files" ];
      shadow = mkBefore [ "files" ];
      sudoers = mkBefore [ "files" ];
      hosts = mkMerge [
        (mkOrder 998 [ "files" ])
        (mkOrder 1499 [ "dns" ])