mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
podman: support mounts configuration (#7377)
This commit is contained in:
@@ -84,6 +84,12 @@ in
|
||||
`skopeo` will be used.
|
||||
'';
|
||||
};
|
||||
|
||||
mounts = lib.mkOption {
|
||||
default = [ ];
|
||||
type = lib.types.listOf lib.types.str;
|
||||
description = "mounts.conf configuration";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -107,6 +113,9 @@ in
|
||||
};
|
||||
"containers/storage.conf".source = toml.generate "storage.conf" cfg.settings.storage;
|
||||
"containers/containers.conf".source = toml.generate "containers.conf" cfg.settings.containers;
|
||||
"containers/mounts.conf" = lib.mkIf (cfg.settings.mounts != [ ]) {
|
||||
text = builtins.concatStringsSep "\n" cfg.settings.mounts;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/usr/share/secrets:/run/secrets
|
||||
@@ -34,6 +34,7 @@
|
||||
policy = {
|
||||
default = [ { type = "insecureAcceptAnything"; } ];
|
||||
};
|
||||
mounts = [ "/usr/share/secrets:/run/secrets" ];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -43,20 +44,24 @@
|
||||
policyFile=$configPath/policy.json
|
||||
registriesFile=$configPath/registries.conf
|
||||
storageFile=$configPath/storage.conf
|
||||
mountsFile=$configPath/mounts.conf
|
||||
|
||||
assertFileExists $containersFile
|
||||
assertFileExists $policyFile
|
||||
assertFileExists $registriesFile
|
||||
assertFileExists $storageFile
|
||||
assertFileExists $mountsFile
|
||||
|
||||
containersFile=$(normalizeStorePaths $containersFile)
|
||||
policyFile=$(normalizeStorePaths $policyFile)
|
||||
registriesFile=$(normalizeStorePaths $registriesFile)
|
||||
storageFile=$(normalizeStorePaths $storageFile)
|
||||
mountsFile=$(normalizeStorePaths $mountsFile)
|
||||
|
||||
assertFileContent $containersFile ${./configuration-containers-expected.conf}
|
||||
assertFileContent $policyFile ${./configuration-policy-expected.json}
|
||||
assertFileContent $registriesFile ${./configuration-registries-expected.conf}
|
||||
assertFileContent $storageFile ${./configuration-storage-expected.conf}
|
||||
assertFileContent $mountsFile ${./configuration-mounts-expected.conf}
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user