about summary refs log tree commit diff
path: root/nixos/modules/services/networking/gnunet.nix
diff options
context:
space:
mode:
authorPhilipp Steinpass <philipp@xndr.de>2018-04-29 20:36:06 +0200
committerPhilipp Steinpass <philipp@xndr.de>2018-05-11 13:54:00 +0200
commitc3dba0b7a79c780ac8359f00d65af29930c7ae20 (patch)
treea65aeecdd96c1037cd8836a70c56ac390b701dc1 /nixos/modules/services/networking/gnunet.nix
parent79dcdce63387d8b0c624abbc00d00acaa7912a43 (diff)
nixos/gnunet: create switch for package.
Diffstat (limited to 'nixos/modules/services/networking/gnunet.nix')
-rw-r--r--nixos/modules/services/networking/gnunet.nix14
1 files changed, 11 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/gnunet.nix b/nixos/modules/services/networking/gnunet.nix
index 02cd53c6fa380..008b09e81a57c 100644
--- a/nixos/modules/services/networking/gnunet.nix
+++ b/nixos/modules/services/networking/gnunet.nix
@@ -102,6 +102,14 @@ in
         };
       };
 
+      package = mkOption {
+        type = types.package;
+        default = pkgs.gnunet;
+        defaultText = "pkgs.gnunet";
+        description = "Overridable attribute of the gnunet package to use.";
+        example = literalExample "pkgs.gnunet_git";
+      };
+
       extraOptions = mkOption {
         default = "";
         description = ''
@@ -130,16 +138,16 @@ in
 
     # The user tools that talk to `gnunetd' should come from the same source,
     # so install them globally.
-    environment.systemPackages = [ pkgs.gnunet ];
+    environment.systemPackages = [ cfg.package ];
 
     systemd.services.gnunet = {
       description = "GNUnet";
       after = [ "network.target" ];
       wantedBy = [ "multi-user.target" ];
-      path = [ pkgs.gnunet pkgs.miniupnpc ];
+      path = [ cfg.package pkgs.miniupnpc ];
       environment.TMPDIR = "/tmp";
       serviceConfig.PrivateTemp = true;
-      serviceConfig.ExecStart = "${pkgs.gnunet}/lib/gnunet/libexec/gnunet-service-arm -c ${configFile}";
+      serviceConfig.ExecStart = "${cfg.package}/lib/gnunet/libexec/gnunet-service-arm -c ${configFile}";
       serviceConfig.User = "gnunet";
       serviceConfig.UMask = "0007";
       serviceConfig.WorkingDirectory = homeDir;