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,7 +8,7 @@ let
in in
{ {
meta = { meta = {
maintainers = [] ++ lib.teams.podman.members; maintainers = [ ] ++ lib.teams.podman.members;
}; };
@ -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";
}; };

View file

@ -12,7 +12,8 @@ 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" ]; outputs = [ "out" "man" ];
inherit (podmanPackage) meta; inherit (podmanPackage) meta;
} '' } ''
@ -26,7 +27,8 @@ let
done done
''; '';
net-conflist = pkgs.runCommand "87-podman-bridge.conflist" { net-conflist = pkgs.runCommand "87-podman-bridge.conflist"
{
nativeBuildInputs = [ pkgs.jq ]; nativeBuildInputs = [ pkgs.jq ];
extraPlugins = builtins.toJSON cfg.defaultNetwork.extraPlugins; extraPlugins = builtins.toJSON cfg.defaultNetwork.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 = [
{ {

View file

@ -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" ];
}; };

View file

@ -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.
''; '';