• 1 Post
  • 318 Comments
Joined 3 years ago
cake
Cake day: June 30th, 2023

help-circle
  • I have a Server with ~16 podman services, each their own user, network namespace and uids. This is managed using NixOS and Home manager (which supports quadlets) but I am changing my setup to a single node k3s cluster with user namespaces because that seems simpler to manage. Here a snippet for how the subuids/subuids are defined:

    users.users.<username> = {
            subUidRanges = [{
                startUid = 100000+65536*( config.users.users.<username>.uid - 999);
                count = 65536;
            }];
            subGidRanges = [{
                startGid = 100000+65536*( config.users.users.<username>.uid - 999);
                count = 65536;
            }];
            home = "[...]";
            isNormalUser = true;
            linger = true;
            group = "users";
            openssh.authorizedKeys.keys = config.users.users.root.openssh.authorizedKeys.keys;
        };