mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
heyefi service: init
This commit is contained in:
parent
6c6a06b99f
commit
d6cee31b04
@ -286,6 +286,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
|
||||
|
87
nixos/modules/services/networking/heyefi.nix
Normal file
87
nixos/modules/services/networking/heyefi.nix
Normal file
@ -0,0 +1,87 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.services.heyefi;
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
|
||||
services.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/ryantm/picture;
|
||||
description = ''
|
||||
The directory to upload the files to.
|
||||
'';
|
||||
};
|
||||
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
description = ''
|
||||
Enable heyefi, an Eye-Fi upload server.
|
||||
'';
|
||||
};
|
||||
|
||||
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 ];
|
||||
|
||||
};
|
||||
|
||||
}
|
@ -6523,6 +6523,8 @@ let
|
||||
|
||||
herqq = callPackage ../development/libraries/herqq { };
|
||||
|
||||
heyefi = haskellPackages.heyefi;
|
||||
|
||||
hidapi = callPackage ../development/libraries/hidapi {
|
||||
libusb = libusb1;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user