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

help-circle
  • Add renovate bot (self-hosted or not) or a similar not to your nixos repository to automatically update your lock file. Enable automatic system rebuilds (not live, nixos-rebuild boot…) to keep in sync with the repo.

    Include multiple nixos systems in one repo, then reuse configuration or even make them reference each other (if you want that)

    Find an issue to report upstream (or even add a pull request)

    Fully automate your reinstall using disko and nixos-anywhere (don’t forget luks)

    Be happy (optional)

    Go over everything you’ve written in your repo so far, realise it’s formatted wrong and spend 2 hours fixing it until it no longer works

    Build a derivation for something that doesn’t exist (also add a pull request if applicable and you’ve got time to maintain it)

    Add a little nixpkgs-unstable, as a treat (use overlays)

    Backups

    Build a server so convoluted, kubernetes is easier to manage (I am here)




  • 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;
        };
    









  • If you delete a still opened file on Linux then the file will disappear for all processes which didn’t already open it, all programs that did already open it can still read and write to it and the file on disk will never be overwritten (as in, used for other files) as long as there’s still a process with the file open.

    Simplifying how it works: The file you see is a link to the actual file(inode), when a program opens a file using this link they get a copy of the link. As long as one link/copy of it still exist the file won’t be deleted. When a program closes all its links get cleaned up so on shutdown all files which only have processes referring to them get marked as deleted.