1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 11:39:46 +01:00

podman: moved settings under config

This commit is contained in:
Dylan Wilson 2024-11-08 10:47:16 -05:00
parent 02dfe57e5d
commit 968ea66db0
No known key found for this signature in database
2 changed files with 84 additions and 79 deletions

View file

@ -11,7 +11,8 @@ in {
options.services.podman = {
enable = lib.mkEnableOption "Podman, a daemonless container engine";
containersConf.settings = lib.mkOption {
config = {
containers.settings = lib.mkOption {
type = toml.type;
default = { };
description = "containers.conf configuration";
@ -68,6 +69,7 @@ in {
'';
};
};
};
config = lib.mkIf cfg.enable {
assertions =
@ -75,22 +77,23 @@ in {
home.packages = [ cfg.package ];
services.podman.storage.settings = {
services.podman.config.storage.settings = {
storage.driver = lib.mkDefault "overlay";
};
xdg.configFile = {
"containers/policy.json".source = if cfg.policy != { } then
pkgs.writeText "policy.json" (builtins.toJSON cfg.policy)
"containers/policy.json".source = if cfg.config.policy != { } then
pkgs.writeText "policy.json" (builtins.toJSON cfg.config.policy)
else
"${pkgs.skopeo.policy}/default-policy.json";
"containers/registries.conf".source = toml.generate "registries.conf" {
registries = lib.mapAttrs (n: v: { registries = v; }) cfg.registries;
registries =
lib.mapAttrs (n: v: { registries = v; }) cfg.config.registries;
};
"containers/storage.conf".source =
toml.generate "storage.conf" cfg.storage.settings;
toml.generate "storage.conf" cfg.config.storage.settings;
"containers/containers.conf".source =
toml.generate "containers.conf" cfg.containersConf.settings;
toml.generate "containers.conf" cfg.config.containers.settings;
};
};
}

View file

@ -3,7 +3,8 @@
{
services.podman = {
enable = true;
containersConf.settings = {
config = {
containers.settings = {
network = {
default_subnet = "172.16.10.0/24";
default_subnet_pools = [
@ -31,6 +32,7 @@
};
policy = { default = [{ type = "insecureAcceptAnything"; }]; };
};
};
nmt.script = ''
configPath=home-files/.config/containers