-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
podman: add darwin support with machine management #8102
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
base: master
Are you sure you want to change the base?
Conversation
5612f58 to
ad8d7ec
Compare
811381d to
cb6e129
Compare
cb6e129 to
d162f21
Compare
|
I've just had a skim and will take a more thorough look later. Thanks for the contribution. I don't believe it's conventional to namespace service settings under the platform the feature is available for, eg the Any thoughts anyone else? |
|
I agree I don't really like darwin namespacing really... Should be able to hide options / disable options on darwin if they can't be used. visible = pkgs.stdenv.hostPlatform.isLinux;
readOnly = pkgs.stdenv.hostPlatform.isDarwin;or just don't make them available through not importing ? |
I agree. An implementation without a darwin namespace would be nicer. |
5da68ee to
1f40bb5
Compare
- restructure module from `podman-linux` to platform-agnostic `podman` - move linux-specific implementation to `modules/services/podman/linux/` - add darwin module with declarative machine management - implement launchd-based watchdog for auto-starting machines - maintains backward compatibility with existing linux functionality
1f40bb5 to
6eabf14
Compare
This change removes our custom podman-darwin module that manually managed Podman machines on macOS. Instead, we now rely on home-manager's native podman module which includes proper launchd integration for machine management. Waits for: nix-community/home-manager#8102
This change removes our custom podman-darwin module that manually managed Podman machines on macOS. Instead, we now rely on home-manager's native podman module which includes proper launchd integration for machine management. Waits for: nix-community/home-manager#8102
This change removes our custom podman-darwin module that manually managed Podman machines on macOS. Instead, we now rely on home-manager's native podman module which includes proper launchd integration for machine management. Waits for: nix-community/home-manager#8102
This change removes our custom podman-darwin module that manually managed Podman machines on macOS. Instead, we now rely on home-manager's native podman module which includes proper launchd integration for machine management. Waits for: nix-community/home-manager#8102
|
@n-hass just a ping. I removed the |
| ./networks.nix | ||
| ./services.nix | ||
| ./volumes.nix | ||
| ./linux/default.nix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make these imports conditional on platform? That way respective platforms will not have visibility of the invalid options. eg
imports =
lib.optional pkgs.stdenv.hostPlatform.isLinux ./linux/default.nix
++ lib.optional pkgs.stdenv.hostPlatform.isDarwin ./darwin.nix;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this, but I think conditional imports are not allowed - at least not this way. I get the following error, when running the tests with conditional imports:
> make test TEST=podman-configuration
nix-shell --pure tests -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixpkgs-unstable.tar.gz -A run.podman-configuration
unpacking 'https://github.com/NixOS/nixpkgs/archive/nixpkgs-unstable.tar.gz' into the Git cache...
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'nmt-run-podman-configuration'
whose name attribute is located at /nix/store/8pskd9fpj2lgv6fjyyvhhxvw4bmayfnd-source/pkgs/stdenv/generic/make-derivation.nix:541:13
… while evaluating attribute 'shellHook' of derivation 'nmt-run-podman-configuration'
at /nix/store/fm1dwqb08lxr1gk02niyvb1j7v4181c0-source/default.nix:38:41:
37| runShellOnlyCommand = name: shellHook:
38| pkgs.runCommandLocal name { inherit shellHook; } ''
| ^
39| echo This derivation is only useful when run through nix-shell.
… while evaluating the module argument `pkgs' in "/home/deaa/Developer/personal/home-manager/modules/services/podman":
… noting that argument `pkgs` is not externally provided, so querying `_module.args` instead, requiring `config`
… if you get an infinite recursion here, you probably reference `config` in `imports`. If you are trying to achieve a conditional import behavior dependent on `config`, consider importing unconditionally, and using `mkEnableOption` and `mkIf` to control its effect.
(stack trace truncated; use '--show-trace' to show the full, detailed trace)
error: infinite recursion encountered
make: *** [Makefile:14: test] Error 1@khaneliman do you know of a way to resolve this problem?
|
Impl looks good - just one small thing about guarding imports by platform. |
podman-linuxto platform-agnosticpodmanmodules/services/podman/linux/Checklist
Change is backwards compatible.
Code formatted with
nix fmtornix-shell -p treefmt nixfmt deadnix keep-sorted --run treefmt.Code tested through
nix run .#tests -- test-allornix-shell --pure tests -A run.all.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
If this PR adds an exciting new feature or contains a breaking change.