tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/{containers,podman}: nixpkgs-fmt
zowoq
3 years ago
72a3a868
e95cb8f1
+28
-25
4 changed files
expand all
collapse all
unified
split
nixos
modules
virtualisation
containers.nix
podman
default.nix
network-socket-ghostunnel.nix
network-socket.nix
+9
-9
nixos/modules/virtualisation/containers.nix
···
8
8
in
9
9
{
10
10
meta = {
11
11
-
maintainers = [] ++ lib.teams.podman.members;
11
11
+
maintainers = [ ] ++ lib.teams.podman.members;
12
12
};
13
13
14
14
15
15
imports = [
16
16
(
17
17
lib.mkRemovedOptionModule
18
18
-
[ "virtualisation" "containers" "users" ]
19
19
-
"All users with `isNormalUser = true` set now get appropriate subuid/subgid mappings."
18
18
+
[ "virtualisation" "containers" "users" ]
19
19
+
"All users with `isNormalUser = true` set now get appropriate subuid/subgid mappings."
20
20
)
21
21
(
22
22
lib.mkRemovedOptionModule
23
23
-
[ "virtualisation" "containers" "containersConf" "extraConfig" ]
24
24
-
"Use virtualisation.containers.containersConf.settings instead."
23
23
+
[ "virtualisation" "containers" "containersConf" "extraConfig" ]
24
24
+
"Use virtualisation.containers.containersConf.settings instead."
25
25
)
26
26
];
27
27
···
87
87
};
88
88
89
89
insecure = mkOption {
90
90
-
default = [];
90
90
+
default = [ ];
91
91
type = types.listOf types.str;
92
92
description = lib.mdDoc ''
93
93
List of insecure repositories.
···
95
95
};
96
96
97
97
block = mkOption {
98
98
-
default = [];
98
98
+
default = [ ];
99
99
type = types.listOf types.str;
100
100
description = lib.mdDoc ''
101
101
List of blocked repositories.
···
104
104
};
105
105
106
106
policy = mkOption {
107
107
-
default = {};
107
107
+
default = { };
108
108
type = types.attrs;
109
109
example = literalExpression ''
110
110
{
···
149
149
};
150
150
151
151
environment.etc."containers/policy.json".source =
152
152
-
if cfg.policy != {} then pkgs.writeText "policy.json" (builtins.toJSON cfg.policy)
152
152
+
if cfg.policy != { } then pkgs.writeText "policy.json" (builtins.toJSON cfg.policy)
153
153
else utils.copyFile "${pkgs.skopeo.src}/default-policy.json";
154
154
};
155
155
+17
-14
nixos/modules/virtualisation/podman/default.nix
···
12
12
});
13
13
14
14
# Provides a fake "docker" binary mapping to podman
15
15
-
dockerCompat = pkgs.runCommand "${podmanPackage.pname}-docker-compat-${podmanPackage.version}" {
16
16
-
outputs = [ "out" "man" ];
17
17
-
inherit (podmanPackage) meta;
18
18
-
} ''
15
15
+
dockerCompat = pkgs.runCommand "${podmanPackage.pname}-docker-compat-${podmanPackage.version}"
16
16
+
{
17
17
+
outputs = [ "out" "man" ];
18
18
+
inherit (podmanPackage) meta;
19
19
+
} ''
19
20
mkdir -p $out/bin
20
21
ln -s ${podmanPackage}/bin/podman $out/bin/docker
21
22
···
26
27
done
27
28
'';
28
29
29
29
-
net-conflist = pkgs.runCommand "87-podman-bridge.conflist" {
30
30
-
nativeBuildInputs = [ pkgs.jq ];
31
31
-
extraPlugins = builtins.toJSON cfg.defaultNetwork.extraPlugins;
32
32
-
jqScript = ''
33
33
-
. + { "plugins": (.plugins + $extraPlugins) }
34
34
-
'';
35
35
-
} ''
30
30
+
net-conflist = pkgs.runCommand "87-podman-bridge.conflist"
31
31
+
{
32
32
+
nativeBuildInputs = [ pkgs.jq ];
33
33
+
extraPlugins = builtins.toJSON cfg.defaultNetwork.extraPlugins;
34
34
+
jqScript = ''
35
35
+
. + { "plugins": (.plugins + $extraPlugins) }
36
36
+
'';
37
37
+
} ''
36
38
jq <${cfg.package}/etc/cni/net.d/87-podman-bridge.conflist \
37
39
--argjson extraPlugins "$extraPlugins" \
38
40
"$jqScript" \
···
119
121
120
122
defaultNetwork.extraPlugins = lib.mkOption {
121
123
type = types.listOf json.type;
122
122
-
default = [];
124
124
+
default = [ ];
123
125
description = lib.mdDoc ''
124
126
Extra CNI plugin configurations to add to podman's default network.
125
127
'';
···
167
169
grep -v 'D! /run/podman 0700 root root' \
168
170
<$package/lib/tmpfiles.d/podman.conf \
169
171
>$out/lib/tmpfiles.d/podman.conf
170
170
-
'') ];
172
172
+
'')
173
173
+
];
171
174
172
175
systemd.tmpfiles.rules =
173
176
lib.optionals cfg.dockerSocket.enable [
174
177
"L! /run/docker.sock - - - - /run/podman/podman.sock"
175
178
];
176
179
177
177
-
users.groups.podman = {};
180
180
+
users.groups.podman = { };
178
181
179
182
assertions = [
180
183
{
+1
-1
nixos/modules/virtualisation/podman/network-socket-ghostunnel.nix
···
26
26
allowAll = lib.mkDefault true;
27
27
};
28
28
};
29
29
-
systemd.services.ghostunnel-server-podman-socket.serviceConfig.SupplementaryGroups = ["podman"];
29
29
+
systemd.services.ghostunnel-server-podman-socket.serviceConfig.SupplementaryGroups = [ "podman" ];
30
30
31
31
};
32
32
+1
-1
nixos/modules/virtualisation/podman/network-socket.nix
···
31
31
};
32
32
33
33
server = mkOption {
34
34
-
type = types.enum [];
34
34
+
type = types.enum [ ];
35
35
description = lib.mdDoc ''
36
36
Choice of TLS proxy server.
37
37
'';