modules(pihole-container): assert that host user has sub-uids/gids configured
This commit is contained in:
parent
8c58832c7d
commit
c8e603fd29
1 changed files with 11 additions and 0 deletions
|
@ -291,6 +291,17 @@ in rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
|
assertions = let
|
||||||
|
hostUserCfg = config.users.users.${cfg.hostConfig.user};
|
||||||
|
in [
|
||||||
|
{ assertion = hostUserCfg ? "subUidRanges" && hostUserCfg ? "subGidRanges";
|
||||||
|
message = ''
|
||||||
|
The host user most have configured subUidRanges & subGidRanges as pihole is running in a rootless podman container.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
systemd.services."pihole-rootless-container" = {
|
systemd.services."pihole-rootless-container" = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
|
|
Loading…
Add table
Reference in a new issue