Skip to content

Commit aef81db

Browse files
Start podman automatically for erasmussen with launchd
1 parent 9e99276 commit aef81db

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

toolchain/containers/default.nix

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
}:
77
{
88
options.dotfiles.containers.enable = lib.mkEnableOption "container Toolchain";
9+
options.dotfiles.containers.podmanAutostart = lib.mkEnableOption "podman machine autostart";
910

1011
config = lib.mkIf config.dotfiles.containers.enable {
1112
home.packages = with pkgs; [
@@ -16,5 +17,22 @@
1617
podman-tui
1718
skopeo
1819
];
20+
21+
launchd.agents = lib.mkIf config.dotfiles.containers.podmanAutostart {
22+
podman-machine = {
23+
enable = true;
24+
config = {
25+
Label = "io.podman.machine.start";
26+
RunAtLoad = true;
27+
ProgramArguments = [
28+
"${pkgs.podman}/bin/podman"
29+
"machine"
30+
"start"
31+
];
32+
StandardOutPath = "${config.xdg.dataHome}/containers/podman/machine/podman-machine.log";
33+
StandardErrorPath = "${config.xdg.dataHome}/containers/podman/machine/podman-machine.log";
34+
};
35+
};
36+
};
1937
};
2038
}

users/erasmussen/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ in
4444
zed.enable = true;
4545
c.enable = true;
4646
containers.enable = true;
47+
containers.podmanAutostart = true;
4748
dotnet.enable = true;
4849
go.enable = true;
4950
javascript.enable = true;

0 commit comments

Comments
 (0)