nixos/{containers,podman}: nixpkgs-fmt
This commit is contained in:
parent
e95cb8f170
commit
72a3a868a0
@ -8,20 +8,20 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
meta = {
|
meta = {
|
||||||
maintainers = [] ++ lib.teams.podman.members;
|
maintainers = [ ] ++ lib.teams.podman.members;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
(
|
(
|
||||||
lib.mkRemovedOptionModule
|
lib.mkRemovedOptionModule
|
||||||
[ "virtualisation" "containers" "users" ]
|
[ "virtualisation" "containers" "users" ]
|
||||||
"All users with `isNormalUser = true` set now get appropriate subuid/subgid mappings."
|
"All users with `isNormalUser = true` set now get appropriate subuid/subgid mappings."
|
||||||
)
|
)
|
||||||
(
|
(
|
||||||
lib.mkRemovedOptionModule
|
lib.mkRemovedOptionModule
|
||||||
[ "virtualisation" "containers" "containersConf" "extraConfig" ]
|
[ "virtualisation" "containers" "containersConf" "extraConfig" ]
|
||||||
"Use virtualisation.containers.containersConf.settings instead."
|
"Use virtualisation.containers.containersConf.settings instead."
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
insecure = mkOption {
|
insecure = mkOption {
|
||||||
default = [];
|
default = [ ];
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
List of insecure repositories.
|
List of insecure repositories.
|
||||||
@ -95,7 +95,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
block = mkOption {
|
block = mkOption {
|
||||||
default = [];
|
default = [ ];
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
List of blocked repositories.
|
List of blocked repositories.
|
||||||
@ -104,7 +104,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
policy = mkOption {
|
policy = mkOption {
|
||||||
default = {};
|
default = { };
|
||||||
type = types.attrs;
|
type = types.attrs;
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
{
|
{
|
||||||
@ -149,7 +149,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
environment.etc."containers/policy.json".source =
|
environment.etc."containers/policy.json".source =
|
||||||
if cfg.policy != {} then pkgs.writeText "policy.json" (builtins.toJSON cfg.policy)
|
if cfg.policy != { } then pkgs.writeText "policy.json" (builtins.toJSON cfg.policy)
|
||||||
else utils.copyFile "${pkgs.skopeo.src}/default-policy.json";
|
else utils.copyFile "${pkgs.skopeo.src}/default-policy.json";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -12,10 +12,11 @@ let
|
|||||||
});
|
});
|
||||||
|
|
||||||
# Provides a fake "docker" binary mapping to podman
|
# Provides a fake "docker" binary mapping to podman
|
||||||
dockerCompat = pkgs.runCommand "${podmanPackage.pname}-docker-compat-${podmanPackage.version}" {
|
dockerCompat = pkgs.runCommand "${podmanPackage.pname}-docker-compat-${podmanPackage.version}"
|
||||||
outputs = [ "out" "man" ];
|
{
|
||||||
inherit (podmanPackage) meta;
|
outputs = [ "out" "man" ];
|
||||||
} ''
|
inherit (podmanPackage) meta;
|
||||||
|
} ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
ln -s ${podmanPackage}/bin/podman $out/bin/docker
|
ln -s ${podmanPackage}/bin/podman $out/bin/docker
|
||||||
|
|
||||||
@ -26,13 +27,14 @@ let
|
|||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
net-conflist = pkgs.runCommand "87-podman-bridge.conflist" {
|
net-conflist = pkgs.runCommand "87-podman-bridge.conflist"
|
||||||
nativeBuildInputs = [ pkgs.jq ];
|
{
|
||||||
extraPlugins = builtins.toJSON cfg.defaultNetwork.extraPlugins;
|
nativeBuildInputs = [ pkgs.jq ];
|
||||||
jqScript = ''
|
extraPlugins = builtins.toJSON cfg.defaultNetwork.extraPlugins;
|
||||||
. + { "plugins": (.plugins + $extraPlugins) }
|
jqScript = ''
|
||||||
'';
|
. + { "plugins": (.plugins + $extraPlugins) }
|
||||||
} ''
|
'';
|
||||||
|
} ''
|
||||||
jq <${cfg.package}/etc/cni/net.d/87-podman-bridge.conflist \
|
jq <${cfg.package}/etc/cni/net.d/87-podman-bridge.conflist \
|
||||||
--argjson extraPlugins "$extraPlugins" \
|
--argjson extraPlugins "$extraPlugins" \
|
||||||
"$jqScript" \
|
"$jqScript" \
|
||||||
@ -119,7 +121,7 @@ in
|
|||||||
|
|
||||||
defaultNetwork.extraPlugins = lib.mkOption {
|
defaultNetwork.extraPlugins = lib.mkOption {
|
||||||
type = types.listOf json.type;
|
type = types.listOf json.type;
|
||||||
default = [];
|
default = [ ];
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
Extra CNI plugin configurations to add to podman's default network.
|
Extra CNI plugin configurations to add to podman's default network.
|
||||||
'';
|
'';
|
||||||
@ -167,14 +169,15 @@ in
|
|||||||
grep -v 'D! /run/podman 0700 root root' \
|
grep -v 'D! /run/podman 0700 root root' \
|
||||||
<$package/lib/tmpfiles.d/podman.conf \
|
<$package/lib/tmpfiles.d/podman.conf \
|
||||||
>$out/lib/tmpfiles.d/podman.conf
|
>$out/lib/tmpfiles.d/podman.conf
|
||||||
'') ];
|
'')
|
||||||
|
];
|
||||||
|
|
||||||
systemd.tmpfiles.rules =
|
systemd.tmpfiles.rules =
|
||||||
lib.optionals cfg.dockerSocket.enable [
|
lib.optionals cfg.dockerSocket.enable [
|
||||||
"L! /run/docker.sock - - - - /run/podman/podman.sock"
|
"L! /run/docker.sock - - - - /run/podman/podman.sock"
|
||||||
];
|
];
|
||||||
|
|
||||||
users.groups.podman = {};
|
users.groups.podman = { };
|
||||||
|
|
||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
|
@ -26,7 +26,7 @@ in
|
|||||||
allowAll = lib.mkDefault true;
|
allowAll = lib.mkDefault true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
systemd.services.ghostunnel-server-podman-socket.serviceConfig.SupplementaryGroups = ["podman"];
|
systemd.services.ghostunnel-server-podman-socket.serviceConfig.SupplementaryGroups = [ "podman" ];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
server = mkOption {
|
server = mkOption {
|
||||||
type = types.enum [];
|
type = types.enum [ ];
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
Choice of TLS proxy server.
|
Choice of TLS proxy server.
|
||||||
'';
|
'';
|
||||||
|
Loading…
Reference in New Issue
Block a user