Files
home-manager/tests/modules/services/podman/darwin/basic.nix
Thierry Delafontaine f4bcc1ae1c podman: add darwin support with machine management
- 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
2026-01-09 09:15:55 -05:00

36 lines
1.3 KiB
Nix

{
services.podman = {
enable = true;
useDefaultMachine = true;
};
nmt.script = ''
serviceDir=LaunchAgents
# Check that the default machine watchdog launchd service exists
agentFile=$serviceDir/org.nix-community.home.podman-machine-podman-machine-default.plist
assertFileExists $agentFile
# Normalize and verify agent file content
agentFileNormalized=$(normalizeStorePaths "$agentFile")
assertFileContent "$agentFileNormalized" ${./basic-expected-agent.plist}
# Verify home activation creates the default machine
assertFileExists activate
assertFileRegex activate 'podman-machine-default'
assertFileRegex activate 'podman machine init podman-machine-default'
assertFileNotRegex activate '[-][-]cpus'
assertFileNotRegex activate '[-][-]disk-size'
assertFileNotRegex activate '[-][-]image'
assertFileNotRegex activate '[-][-]memory'
assertFileNotRegex activate '[-][-]rootful'
assertFileNotRegex activate '[-][-]swap'
assertFileNotRegex activate '[-][-]timezone'
assertFileNotRegex activate '[-][-]username'
assertFileNotRegex activate '[-][-]volumes'
# Verify that config directory is automatically mounted into the machine
assertFileRegex activate '\$HOME/\.config/containers:/home/core/\.config/containers'
'';
}