File tree Expand file tree Collapse file tree 3 files changed +74
-1
lines changed Expand file tree Collapse file tree 3 files changed +74
-1
lines changed Original file line number Diff line number Diff line change 6
6
, zlib
7
7
, stdenv
8
8
, darwin
9
+ , pandoc
10
+ , texlive
11
+ , makeWrapper
9
12
} :
10
13
11
14
rustPlatform . buildRustPackage rec {
@@ -24,11 +27,20 @@ rustPlatform.buildRustPackage rec {
24
27
libgit2
25
28
openssl
26
29
zlib
30
+ makeWrapper
27
31
] ++ lib . optionals stdenv . isDarwin [
28
32
darwin . apple_sdk . frameworks . IOKit
29
33
darwin . apple_sdk . frameworks . Security
30
34
] ;
31
35
36
+ postFixup = ''
37
+ wrapProgram $out/bin/remote-text-server \
38
+ --set PATH ${ lib . makeBinPath [
39
+ pandoc
40
+ texlive
41
+ ] }
42
+ '' ;
43
+
32
44
env = {
33
45
OPENSSL_NO_VENDOR = true ;
34
46
VERGEN_IDEMPOTENT = true ;
Original file line number Diff line number Diff line change 13
13
( system : gen nixpkgs . legacyPackages . ${ system } ) ;
14
14
in {
15
15
packages = forAllSystems ( pkgs : rec {
16
- remote-text-server = pkgs . callPackage ./. { } ;
16
+ remote-text-server = pkgs . callPackage ./. { texlive = pkgs . texliveFull ; } ;
17
17
default = remote-text-server ;
18
18
dockerImage = pkgs . dockerTools . buildImage {
19
19
name = "remote-text-server" ;
23
23
} ;
24
24
} ;
25
25
} ) ;
26
+ nixosModules = rec {
27
+ remote-text-server = import ./module.nix ;
28
+ default = remote-text-server ;
29
+ } ;
26
30
} ;
27
31
}
Original file line number Diff line number Diff line change
1
+ { config , pkgs , lib , ... } :
2
+
3
+ with lib ;
4
+
5
+ let
6
+ cfg = config . services . remote-text-server ;
7
+ in
8
+ {
9
+ options . services . remote-text-server = {
10
+ enable = mkEnableOption "remote-text-server" ;
11
+ package = mkOption {
12
+ default = pkgs . callPackage ./. { texlive = pkgs . texliveFull ; } ;
13
+ defaultText = "remote-text-server" ;
14
+ description = "The remote-text-server package to use" ;
15
+ type = types . package ;
16
+ } ;
17
+ port = mkOption {
18
+ type = types . port ;
19
+ default = 7870 ;
20
+ example = 46264 ;
21
+ description = "The port to listen on. Currently ignored and always uses 3030" ;
22
+ } ;
23
+ } ;
24
+
25
+ config = mkIf cfg . enable {
26
+ systemd . services . remote-text-server = {
27
+ description = "RemoteText Server" ;
28
+
29
+ script = ''
30
+ cd $STATE_DIRECTORY
31
+ ${ cfg . package } /bin/remote-text-server --port ${ toString cfg . port }
32
+ '' ;
33
+
34
+ serviceConfig = {
35
+ DynamicUser = true ;
36
+ # EnvironmentFile = "/etc/jekyll-comments-env";
37
+ StateDirectory = "remote-text-server" ;
38
+
39
+ PrivateDevices = true ;
40
+ PrivateMounts = true ;
41
+ PrivateUsers = true ;
42
+ ProtectControlGroups = true ;
43
+ ProtectHome = true ;
44
+ ProtectHostname = true ;
45
+ ProtectKernelLogs = true ;
46
+ ProtectKernelModules = true ;
47
+ ProtectKernelTunables = true ;
48
+ } ;
49
+
50
+ wantedBy = [ "multi-user.target" ] ;
51
+ after = [ "network-online.target" ] ;
52
+ wants = [ "network-online.target" ] ;
53
+ } ;
54
+ # unnecessary bc tailscale is open. also should be set by the end user
55
+ # networking.firewall.interfaces."tailscale0".allowedTCPPorts = [ cfg.port ];
56
+ } ;
57
+ }
You can’t perform that action at this time.
0 commit comments