about summary refs log tree commit diff
path: root/nixos/modules/services/networking/gdomap.nix
diff options
context:
space:
mode:
authorArtyom Shalkhakov <artyom.shalkhakov@gmail.com>2015-01-25 22:34:52 +0600
committerMatthew Bauer <mjbauer95@gmail.com>2016-08-16 21:00:27 +0000
commitd3d580ebbe1ef6330f194ed5fd9116030bd09025 (patch)
treed1be6e38a4e431610c3f906360754c214e3f43ba /nixos/modules/services/networking/gdomap.nix
parent9b17cd8fab54b8a06e32109299e4102fcdf3d53d (diff)
downloadnixlib-d3d580ebbe1ef6330f194ed5fd9116030bd09025.tar
nixlib-d3d580ebbe1ef6330f194ed5fd9116030bd09025.tar.gz
nixlib-d3d580ebbe1ef6330f194ed5fd9116030bd09025.tar.bz2
nixlib-d3d580ebbe1ef6330f194ed5fd9116030bd09025.tar.lz
nixlib-d3d580ebbe1ef6330f194ed5fd9116030bd09025.tar.xz
nixlib-d3d580ebbe1ef6330f194ed5fd9116030bd09025.tar.zst
nixlib-d3d580ebbe1ef6330f194ed5fd9116030bd09025.zip
gnustep: cleanup
Major clean-up. Everything builds fine.
Diffstat (limited to 'nixos/modules/services/networking/gdomap.nix')
-rw-r--r--nixos/modules/services/networking/gdomap.nix18
1 files changed, 12 insertions, 6 deletions
diff --git a/nixos/modules/services/networking/gdomap.nix b/nixos/modules/services/networking/gdomap.nix
index b4cef96eb879..da78810f6b21 100644
--- a/nixos/modules/services/networking/gdomap.nix
+++ b/nixos/modules/services/networking/gdomap.nix
@@ -4,7 +4,7 @@ with lib;
 
 let
   cfg = config.services.gdomap;
-  stateDir = "/var/lib/gdomap";
+  pidFile = "${cfg.pidDir}/gdomap.pid";
 in
 {
   #
@@ -20,6 +20,10 @@ in
 	  Note that gdomap runs as root.
         ";
       };
+      pidDir = mkOption {
+        default = "/var/run/gdomap";
+	description = "Location of the file which stores the PID of gdomap";
+      };
     };
   };
   #
@@ -27,20 +31,22 @@ in
   #
   config = mkIf config.services.gdomap.enable {
     # NOTE: gdomap runs as root
+    # TODO: extra user for gdomap?
     systemd.services.gdomap = {
       description = "gdomap server";
       wantedBy = [ "multi-user.target" ];
       after = [ "network.target" ];
       path  = [ pkgs.gnustep_base ];
       preStart = ''
-	mkdir -m 755 -p ${stateDir}
-	mkdir -m 755 -p /run/gdomap
+        mkdir -m 0700 -p ${cfg.pidDir}
+	chown -R nobody:nobody ${cfg.pidDir}
       '';
       serviceConfig = {
-        # NOTE: this is local-only configuration!
         ExecStart = "@${pkgs.gnustep_base}/bin/gdomap"
-	  + " -j ${stateDir} -p";
-	Restart = "always"; # "no";
+	  + " -d -p"
+	  + " -I ${pidFile}";
+#	  + " -j ${cfg.pidDir}";
+	Restart = "always";
 	RestartSec = 2;
 	TimeoutStartSec = "30";
 	Type = "forking";