Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for RFC108 imperative containers #216025

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Oct 1, 2024

  1. nixos/systemd-nspawn: Updates to switch-to-configuration.pl

    This is a refactor of the necessary changes for RFC108 to
    reduce the delta with current master and conform it to code
    changes made to switch-to-configuration.pl since the project
    started. I'll try to summarise the changes:
    
    - Camel case to snake case
    - Try to conform compare_nspawn_units to match the style and
     logic of compare_units for long term maintainability.
    - Remove fingerprintNspawnUnits and use comp_array over deepCmp.
     By using parse_unit instead of parseNspawn, override confs will
     be factored in to the data loading and comparison so I don't see
     a need to do the fingerprinting.
    - Remove use of smartmatch in favour of hash map membership,
     see L331/%section_cmp as an example of this being done elsewhere.
    - @systemd@ -> $new_systemd
    
    Overall, I hope this makes the RFC108 component changes to the
    script easier to maintain in nixpkgs.
    
    This also contains work from squashed commits:
    
    - Query active nspawn instance names via DBus
    
    The original implementation is pretty hacky and doesn't work correctly
    if the name of one running instance is the prefix of the name another
    instance (e.g. `foo` and `foobar`).
    
    Using `ListMachines` from machined's DBus API instead to get some
    structure data seems more reasonable here. This is also the way how
    `machienctl list` retrieves running machines.
    m1cr0man committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    79340c4 View commit details
    Browse the repository at this point in the history
  2. nixos/systemd-nspawn: Skip more filesystems for containers

    Within systemd nspawn, even less default filesystems are
    required than what is currently assumed in filesystem.nix.
    This PR wraps more mounts in conditional toggles to respect this.
    m1cr0man committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    d1ae8c1 View commit details
    Browse the repository at this point in the history
  3. nixos/systemd-nspawn: Write individual units to etc

    This allows imperative container management to create unit
    files in /etc/systemd/nspawn
    m1cr0man committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    a9bf933 View commit details
    Browse the repository at this point in the history