nixos/{containers,podman}: nixpkgs-fmt

This commit is contained in:
zowoq 2022-08-18 09:53:45 +10:00
parent e95cb8f170
commit 72a3a868a0
4 changed files with 28 additions and 25 deletions

View file

@ -8,20 +8,20 @@ let
in
{
meta = {
maintainers = [] ++ lib.teams.podman.members;
maintainers = [ ] ++ lib.teams.podman.members;
};
imports = [
(
lib.mkRemovedOptionModule
[ "virtualisation" "containers" "users" ]
"All users with `isNormalUser = true` set now get appropriate subuid/subgid mappings."
[ "virtualisation" "containers" "users" ]
"All users with `isNormalUser = true` set now get appropriate subuid/subgid mappings."
)
(
lib.mkRemovedOptionModule
[ "virtualisation" "containers" "containersConf" "extraConfig" ]
"Use virtualisation.containers.containersConf.settings instead."
[ "virtualisation" "containers" "containersConf" "extraConfig" ]
"Use virtualisation.containers.containersConf.settings instead."
)
];
@ -87,7 +87,7 @@ in
};
insecure = mkOption {
default = [];
default = [ ];
type = types.listOf types.str;
description = lib.mdDoc ''
List of insecure repositories.
@ -95,7 +95,7 @@ in
};
block = mkOption {
default = [];
default = [ ];
type = types.listOf types.str;
description = lib.mdDoc ''
List of blocked repositories.
@ -104,7 +104,7 @@ in
};
policy = mkOption {
default = {};
default = { };
type = types.attrs;
example = literalExpression ''
{
@ -149,7 +149,7 @@ in
};
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";
};

View file

@ -12,10 +12,11 @@ let
});
# Provides a fake "docker" binary mapping to podman
dockerCompat = pkgs.runCommand "${podmanPackage.pname}-docker-compat-${podmanPackage.version}" {
outputs = [ "out" "man" ];
inherit (podmanPackage) meta;
} ''
dockerCompat = pkgs.runCommand "${podmanPackage.pname}-docker-compat-${podmanPackage.version}"
{
outputs = [ "out" "man" ];
inherit (podmanPackage) meta;
} ''
mkdir -p $out/bin
ln -s ${podmanPackage}/bin/podman $out/bin/docker
@ -26,13 +27,14 @@ let
done
'';
net-conflist = pkgs.runCommand "87-podman-bridge.conflist" {
nativeBuildInputs = [ pkgs.jq ];
extraPlugins = builtins.toJSON cfg.defaultNetwork.extraPlugins;
jqScript = ''
. + { "plugins": (.plugins + $extraPlugins) }
'';
} ''
net-conflist = pkgs.runCommand "87-podman-bridge.conflist"
{
nativeBuildInputs = [ pkgs.jq ];
extraPlugins = builtins.toJSON cfg.defaultNetwork.extraPlugins;
jqScript = ''
. + { "plugins": (.plugins + $extraPlugins) }
'';
} ''
jq <${cfg.package}/etc/cni/net.d/87-podman-bridge.conflist \
--argjson extraPlugins "$extraPlugins" \
"$jqScript" \
@ -119,7 +121,7 @@ in
defaultNetwork.extraPlugins = lib.mkOption {
type = types.listOf json.type;
default = [];
default = [ ];
description = lib.mdDoc ''
Extra CNI plugin configurations to add to podman's default network.
'';
@ -167,14 +169,15 @@ in
grep -v 'D! /run/podman 0700 root root' \
<$package/lib/tmpfiles.d/podman.conf \
>$out/lib/tmpfiles.d/podman.conf
'') ];
'')
];
systemd.tmpfiles.rules =
lib.optionals cfg.dockerSocket.enable [
"L! /run/docker.sock - - - - /run/podman/podman.sock"
];
users.groups.podman = {};
users.groups.podman = { };
assertions = [
{

View file

@ -26,7 +26,7 @@ in
allowAll = lib.mkDefault true;
};
};
systemd.services.ghostunnel-server-podman-socket.serviceConfig.SupplementaryGroups = ["podman"];
systemd.services.ghostunnel-server-podman-socket.serviceConfig.SupplementaryGroups = [ "podman" ];
};

View file

@ -31,7 +31,7 @@ in
};
server = mkOption {
type = types.enum [];
type = types.enum [ ];
description = lib.mdDoc ''
Choice of TLS proxy server.
'';