summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorlethalman <lucabru@src.gnome.org>2015-07-24 10:11:26 +0200
committerlethalman <lucabru@src.gnome.org>2015-07-24 10:11:26 +0200
commit636f9ac0edff1bbeaa0edaeee4992aed6eddadf2 (patch)
treead7ef2a3fe6e3c718ceb2e82cef6b4187174c619 /nixos/modules
parentb3d02712c4c5447ae19ee0e34a43ed175a8ec4b4 (diff)
parent9d485d9433e98a7cde0be4867d844c42ac373ad5 (diff)
downloadnixlib-636f9ac0edff1bbeaa0edaeee4992aed6eddadf2.tar
nixlib-636f9ac0edff1bbeaa0edaeee4992aed6eddadf2.tar.gz
nixlib-636f9ac0edff1bbeaa0edaeee4992aed6eddadf2.tar.bz2
nixlib-636f9ac0edff1bbeaa0edaeee4992aed6eddadf2.tar.lz
nixlib-636f9ac0edff1bbeaa0edaeee4992aed6eddadf2.tar.xz
nixlib-636f9ac0edff1bbeaa0edaeee4992aed6eddadf2.tar.zst
nixlib-636f9ac0edff1bbeaa0edaeee4992aed6eddadf2.zip
Merge pull request #8799 from ryantm/master
heyefi service: init
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/networking/heyefi.nix82
2 files changed, 83 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 7e2c42f2b8c1..c56e6a82e831 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -288,6 +288,7 @@
   ./services/networking/gogoclient.nix
   ./services/networking/gvpe.nix
   ./services/networking/haproxy.nix
+  ./services/networking/heyefi.nix
   ./services/networking/hostapd.nix
   ./services/networking/i2pd.nix
   ./services/networking/i2p.nix
diff --git a/nixos/modules/services/networking/heyefi.nix b/nixos/modules/services/networking/heyefi.nix
new file mode 100644
index 000000000000..fc2b5a848578
--- /dev/null
+++ b/nixos/modules/services/networking/heyefi.nix
@@ -0,0 +1,82 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+  cfg = config.services.heyefi;
+in
+
+{
+
+  ###### interface
+
+  options = {
+
+    services.heyefi = {
+
+      enable = mkEnableOption "heyefi";
+
+      cardMacaddress = mkOption {
+        default = "";
+        description = ''
+          An Eye-Fi card MAC address.
+          '';
+      };
+
+      uploadKey = mkOption {
+        default = "";
+        description = ''
+          An Eye-Fi card's upload key.
+          '';
+      };
+
+      uploadDir = mkOption {
+        example = "/home/username/pictures";
+        description = ''
+          The directory to upload the files to.
+          '';
+      };
+
+      user = mkOption {
+        default = "root";
+        description = ''
+          heyefi will be run under this user (user must exist,
+          this can be your user name).
+        '';
+      };
+
+    };
+
+  };
+
+
+  ###### implementation
+
+  config = mkIf cfg.enable {
+
+    systemd.services.heyefi =
+      {
+        description = "heyefi service";
+        after = [ "network.target" ];
+        wantedBy = [ "multi-user.target" ];
+        serviceConfig = {
+          User = "${cfg.user}";
+          Restart = "always";
+          ExecStart = "${pkgs.heyefi}/bin/heyefi";
+        };
+
+      };
+
+    environment.etc."heyefi/heyefi.config".text =
+      ''
+        # /etc/heyefi/heyefi.conf: DO NOT EDIT -- this file has been generated automatically.
+        cards = [["${config.services.heyefi.cardMacaddress}","${config.services.heyefi.uploadKey}"]]
+        upload_dir = "${toString config.services.heyefi.uploadDir}"
+      '';
+
+    environment.systemPackages = [ pkgs.heyefi ];
+
+  };
+
+}