{nixos,nixosTests}/redlib: format with nixfmt
This commit is contained in:
parent
d78d09350a
commit
e286b91ebc
@ -1,8 +1,21 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
concatStringsSep
|
||||
mkEnableOption
|
||||
mkIf
|
||||
mkOption
|
||||
mkPackageOption
|
||||
mkRenamedOptionModule
|
||||
types
|
||||
;
|
||||
|
||||
cfg = config.services.redlib;
|
||||
|
||||
args = concatStringsSep " " ([
|
||||
@ -12,7 +25,16 @@ let
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
(mkRenamedOptionModule [ "services" "libreddit" ] [ "services" "redlib" ])
|
||||
(mkRenamedOptionModule
|
||||
[
|
||||
"services"
|
||||
"libreddit"
|
||||
]
|
||||
[
|
||||
"services"
|
||||
"redlib"
|
||||
]
|
||||
)
|
||||
];
|
||||
|
||||
options = {
|
||||
@ -55,6 +77,7 @@ in
|
||||
AmbientCapabilities = lib.mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ];
|
||||
Restart = "on-failure";
|
||||
RestartSec = "2s";
|
||||
|
||||
# Hardening
|
||||
CapabilityBoundingSet = if (cfg.port < 1024) then [ "CAP_NET_BIND_SERVICE" ] else [ "" ];
|
||||
DeviceAllow = [ "" ];
|
||||
@ -73,12 +96,19 @@ in
|
||||
ProtectKernelModules = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectProc = "invisible";
|
||||
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
|
||||
RestrictAddressFamilies = [
|
||||
"AF_INET"
|
||||
"AF_INET6"
|
||||
];
|
||||
RestrictNamespaces = true;
|
||||
RestrictRealtime = true;
|
||||
RestrictSUIDSGID = true;
|
||||
SystemCallArchitectures = "native";
|
||||
SystemCallFilter = [ "@system-service" "~@privileged" "~@resources" ];
|
||||
SystemCallFilter = [
|
||||
"@system-service"
|
||||
"~@privileged"
|
||||
"~@resources"
|
||||
];
|
||||
UMask = "0077";
|
||||
};
|
||||
};
|
||||
|
@ -1,4 +1,6 @@
|
||||
import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
||||
import ./make-test-python.nix (
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
name = "redlib";
|
||||
meta.maintainers = with lib.maintainers; [ soispha ];
|
||||
|
||||
@ -17,4 +19,5 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
||||
# Query a page that does not require Internet access
|
||||
machine.succeed("curl --fail http://localhost:80/settings")
|
||||
'';
|
||||
})
|
||||
}
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user