summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/misc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-11-28 17:09:12 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-11-28 17:09:12 +0000
commitc6617d28ef3762bbd5cb11dd3c56afb778ff42cc (patch)
tree18fbdfb4783a2e0c5625cdb51606058ca50e2ca8 /nixos/modules/services/misc
parent29cdd8ae609d107889469610176aa53676382eb1 (diff)
parent05d95cfe79a69cf690cec5d356b37e29d7d13d18 (diff)
Merge remote-tracking branch 'upstream/master' into aj-rust-custom-target
Diffstat (limited to 'nixos/modules/services/misc')
-rw-r--r--nixos/modules/services/misc/jellyfin.nix40
-rw-r--r--nixos/modules/services/misc/nix-daemon.nix2
2 files changed, 41 insertions, 1 deletions
diff --git a/nixos/modules/services/misc/jellyfin.nix b/nixos/modules/services/misc/jellyfin.nix
index 0493dadea94e..6a47dc3628f4 100644
--- a/nixos/modules/services/misc/jellyfin.nix
+++ b/nixos/modules/services/misc/jellyfin.nix
@@ -45,6 +45,46 @@ in
CacheDirectory = "jellyfin";
ExecStart = "${cfg.package}/bin/jellyfin --datadir '/var/lib/${StateDirectory}' --cachedir '/var/cache/${CacheDirectory}'";
Restart = "on-failure";
+
+ # Security options:
+
+ NoNewPrivileges = true;
+
+ AmbientCapabilities = "";
+ CapabilityBoundingSet = "";
+
+ # ProtectClock= adds DeviceAllow=char-rtc r
+ DeviceAllow = "";
+
+ LockPersonality = true;
+
+ PrivateTmp = true;
+ PrivateDevices = true;
+ PrivateUsers = true;
+
+ ProtectClock = true;
+ ProtectControlGroups = true;
+ ProtectHostname = true;
+ ProtectKernelLogs = true;
+ ProtectKernelModules = true;
+ ProtectKernelTunables = true;
+
+ RemoveIPC = true;
+
+ RestrictNamespaces = true;
+ # AF_NETLINK needed because Jellyfin monitors the network connection
+ RestrictAddressFamilies = [ "AF_NETLINK" "AF_INET" "AF_INET6" ];
+ RestrictRealtime = true;
+ RestrictSUIDSGID = true;
+
+ SystemCallArchitectures = "native";
+ SystemCallErrorNumber = "EPERM";
+ SystemCallFilter = [
+ "@system-service"
+
+ "~@chown" "~@cpu-emulation" "~@debug" "~@keyring" "~@memlock" "~@module"
+ "~@obsolete" "~@privileged" "~@setuid"
+ ];
};
};
diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix
index 2680b1cc0d3b..ed05882a6343 100644
--- a/nixos/modules/services/misc/nix-daemon.nix
+++ b/nixos/modules/services/misc/nix-daemon.nix
@@ -45,7 +45,7 @@ let
trusted-substituters = ${toString cfg.trustedBinaryCaches}
trusted-public-keys = ${toString cfg.binaryCachePublicKeys}
auto-optimise-store = ${boolToString cfg.autoOptimiseStore}
- require-sigs = ${if cfg.requireSignedBinaryCaches then "true" else "false"}
+ require-sigs = ${boolToString cfg.requireSignedBinaryCaches}
trusted-users = ${toString cfg.trustedUsers}
allowed-users = ${toString cfg.allowedUsers}
${optionalString (!cfg.distributedBuilds) ''