mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 01:19:32 +08:00
- 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
53 lines
1.4 KiB
Nix
53 lines
1.4 KiB
Nix
{ config, lib, ... }:
|
|
{
|
|
imports = [ ./podman-stubs.nix ];
|
|
config = lib.mkIf config.test.enableLegacyIfd {
|
|
services.podman = {
|
|
enable = true;
|
|
networks = {
|
|
"my-net" = {
|
|
subnet = "192.168.1.0/24";
|
|
gateway = "192.168.1.1";
|
|
extraPodmanArgs = [ "--ipam-driver dhcp" ];
|
|
extraConfig = {
|
|
Network = {
|
|
NetworkName = "my-net";
|
|
Options = {
|
|
isolate = "true";
|
|
};
|
|
PodmanArgs = [
|
|
"--dns=192.168.55.1"
|
|
"--log-level=debug"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
|
|
"my-net-2" = {
|
|
subnet = "192.168.2.0/24";
|
|
gateway = "192.168.2.1";
|
|
extraConfig = {
|
|
Network = {
|
|
NetworkName = "some-other-network-name";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
test.asserts.assertions.expected = [
|
|
''In 'my-net-2' config. Network.NetworkName: 'some-other-network-name' does not match expected type: value "my-net-2" (singular enum)''
|
|
];
|
|
|
|
nmt.script = ''
|
|
configPath=home-files/.config/systemd/user
|
|
networkFile=$configPath/podman-my-net-network.service
|
|
assertFileExists $networkFile
|
|
|
|
networkFile=$(normalizeStorePaths $networkFile)
|
|
|
|
assertFileContent $networkFile ${./network-expected.service}
|
|
'';
|
|
};
|
|
}
|