1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-28 21:21:02 +01:00

docker-cli: add module (#7411)

(cherry picked from commit 729c5e5465)
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Friedrich Altheide 2025-07-10 22:36:53 +02:00 committed by Austin Horstman
parent 05d7a84f50
commit c6a01e54af
6 changed files with 134 additions and 0 deletions

View file

@ -0,0 +1,37 @@
{
config,
...
}:
{
programs.docker-cli = {
enable = true;
configPath = ".docker/config2.json";
settings = {
"proxies" = {
"default" = {
"httpProxy" = "http://proxy.example.org:3128";
"httpsProxy" = "http://proxy.example.org:3128";
"noProxy" = "localhost";
};
};
};
};
nmt.script =
let
cfgDocker = config.programs.docker-cli;
configTestPath = "home-files/${cfgDocker.configPath}";
configHomePath = "/home/hm-user/${cfgDocker.configPath}";
in
''
assertFileContains home-path/etc/profile.d/hm-session-vars.sh \
'export DOCKER_CONFIG="${configHomePath}"'
assertPathNotExists home-files/.docker/config.json
assertFileExists ${configTestPath}
assertFileContent ${configTestPath} \
${./example-config.json}
'';
}