diff --git a/nixos/modules/services/misc/rmfakecloud.nix b/nixos/modules/services/misc/rmfakecloud.nix index 6cc87753aa25..6fa08bcb2ec3 100644 --- a/nixos/modules/services/misc/rmfakecloud.nix +++ b/nixos/modules/services/misc/rmfakecloud.nix @@ -1,4 +1,9 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: with lib; @@ -6,7 +11,8 @@ let cfg = config.services.rmfakecloud; serviceDataDir = "/var/lib/rmfakecloud"; -in { +in +{ options = { services.rmfakecloud = { enable = mkEnableOption "rmfakecloud remarkable self-hosted cloud"; @@ -36,7 +42,12 @@ in { }; logLevel = mkOption { - type = types.enum [ "info" "debug" "warn" "error" ]; + type = types.enum [ + "info" + "debug" + "warn" + "error" + ]; default = "info"; description = '' Logging level. @@ -46,7 +57,9 @@ in { extraSettings = mkOption { type = with types; attrsOf str; default = { }; - example = { DATADIR = "/custom/path/for/rmfakecloud/data"; }; + example = { + DATADIR = "/custom/path/for/rmfakecloud/data"; + }; description = '' Extra settings in the form of a set of key-value pairs. For tokens and secrets, use `environmentFile` instead. @@ -106,11 +119,9 @@ in { Type = "simple"; Restart = "always"; - EnvironmentFile = - mkIf (cfg.environmentFile != null) cfg.environmentFile; + EnvironmentFile = mkIf (cfg.environmentFile != null) cfg.environmentFile; - AmbientCapabilities = - mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ]; + AmbientCapabilities = mkIf (cfg.port < 1024) [ "CAP_NET_BIND_SERVICE" ]; DynamicUser = true; PrivateDevices = true; @@ -128,7 +139,10 @@ in { ProtectProc = "invisible"; ProcSubset = "pid"; RemoveIPC = true; - RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ]; + RestrictAddressFamilies = [ + "AF_INET" + "AF_INET6" + ]; RestrictNamespaces = true; RestrictRealtime = true; RestrictSUIDSGID = true; diff --git a/pkgs/by-name/rm/rmfakecloud/package.nix b/pkgs/by-name/rm/rmfakecloud/package.nix index 315ac8ec43b1..d26c57aad1e4 100644 --- a/pkgs/by-name/rm/rmfakecloud/package.nix +++ b/pkgs/by-name/rm/rmfakecloud/package.nix @@ -1,4 +1,10 @@ -{ lib, fetchFromGitHub, buildGoModule, callPackage, enableWebui ? true }: +{ + lib, + fetchFromGitHub, + buildGoModule, + callPackage, + enableWebui ? true, +}: buildGoModule rec { pname = "rmfakecloud"; @@ -15,22 +21,31 @@ buildGoModule rec { ui = callPackage ./webui.nix { inherit version src; }; - postPatch = if enableWebui then '' - mkdir -p ui/build - cp -r ${ui}/* ui/build - '' else '' - sed -i '/go:/d' ui/assets.go - ''; + postPatch = + if enableWebui then + '' + mkdir -p ui/build + cp -r ${ui}/* ui/build + '' + else + '' + sed -i '/go:/d' ui/assets.go + ''; ldflags = [ - "-s" "-w" "-X main.version=v${version}" + "-s" + "-w" + "-X main.version=v${version}" ]; meta = with lib; { description = "Host your own cloud for the Remarkable"; homepage = "https://ddvk.github.io/rmfakecloud/"; license = licenses.agpl3Only; - maintainers = with maintainers; [ pacien martinetd ]; + maintainers = with maintainers; [ + pacien + martinetd + ]; mainProgram = "rmfakecloud"; }; }