Skip to content

Commit

Permalink
nixos/google-oslogin: Move nsswitch config into the module
Browse files Browse the repository at this point in the history
Motivation: NixOS#86350
  • Loading branch information
flokli committed Apr 30, 2020
1 parent 0510d59 commit 4b71b6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions nixos/modules/config/nsswitch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ let
nsswins = canLoadExternalModules && config.services.samba.nsswins;
ldap = canLoadExternalModules && (config.users.ldap.enable && config.users.ldap.nsswitch);
resolved = canLoadExternalModules && config.services.resolved.enable;
googleOsLogin = canLoadExternalModules && config.security.googleOsLogin.enable;

hostArray = mkMerge [
(mkBefore [ "files" ])
Expand All @@ -32,7 +31,6 @@ let
(mkBefore [ "files" ])
(mkIf ldap [ "ldap" ])
(mkIf mymachines [ "mymachines" ])
(mkIf googleOsLogin [ "cache_oslogin oslogin" ])
(mkIf canLoadExternalModules (mkAfter [ "systemd" ]))
];

Expand Down Expand Up @@ -172,7 +170,6 @@ in {
# configured IP addresses, or ::1 and 127.0.0.2 as
# fallbacks. Systemd also provides nss-mymachines to return IP
# addresses of local containers.
system.nssModules = (optionals canLoadExternalModules [ config.systemd.package.out ])
++ optional googleOsLogin pkgs.google-compute-engine-oslogin.out;
system.nssModules = (optionals canLoadExternalModules [ config.systemd.package.out ]);
};
}
1 change: 1 addition & 0 deletions nixos/modules/security/google_oslogin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ in

# enable the nss module, so user lookups etc. work
system.nssModules = [ package ];
system.nssDatabases.passwd = [ "cache_oslogin" "oslogin" ];

# Ugly: sshd refuses to start if a store path is given because /nix/store is group-writable.
# So indirect by a symlink.
Expand Down

0 comments on commit 4b71b6f

Please sign in to comment.