forked from NixOS/nixpkgs
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'nixos-unstable' of github.com:airalab/airapkgs into nix…
…os-unstable
- Loading branch information
Showing
8 changed files
with
227 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.services.drone_passport; | ||
|
||
operationalToken = "0x7dE91B204C1C737bcEe6F000AAA6569Cf7061cb7"; | ||
|
||
in { | ||
options = { | ||
services.drone_flight_report = { | ||
enable = mkEnableOption "Enable Drone Flight Report service."; | ||
|
||
lighthouse = mkOption { | ||
type = types.str; | ||
default = "0xA02500497E5163DbC049453509Fae8C9825cf18e"; | ||
description = "Lighthouse to work on"; | ||
}; | ||
|
||
token = mkOption { | ||
type = types.str; | ||
default = operationalToken; | ||
description = "Operational token"; | ||
}; | ||
|
||
user = mkOption { | ||
type = types.str; | ||
default = "liability"; | ||
description = "User account under which service runs."; | ||
}; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
environment.systemPackages = with pkgs; [ drone_flight_report ]; | ||
|
||
systemd.services.drone_passport = { | ||
requires = [ "roscore.service" ]; | ||
after = [ "liability.service" "roscore.service" ]; | ||
wantedBy = [ "multi-user.target" ]; | ||
|
||
script = '' | ||
source ${pkgs.drone_flight_report}/setup.bash \ | ||
&& roslaunch drone_flight_report agent.launch \ | ||
lighthouse:="${cfg.lighthouse}" \ | ||
token:="${cfg.token}" | ||
''; | ||
|
||
serviceConfig = { | ||
Restart = "on-failure"; | ||
StartLimitInterval = 0; | ||
RestartSec = 60; | ||
User = cfg.user; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.services.drone_passport; | ||
|
||
operationalToken = "0x966EbbFD7ECbCF44b1e05341976e0652CFA01360"; | ||
|
||
in { | ||
options = { | ||
services.drone_passport = { | ||
enable = mkEnableOption "Enable Drone Passport service."; | ||
|
||
login = mkOption { | ||
type = types.str; | ||
default = ""; | ||
description = "Email sender login"; | ||
}; | ||
|
||
email_from = mkOption { | ||
type = types.str; | ||
default = ""; | ||
description = "The value of 'from' field in an email"; | ||
}; | ||
|
||
email_password = mkOption { | ||
type = types.str; | ||
default = ""; | ||
description = "Email password"; | ||
}; | ||
|
||
token = mkOption { | ||
type = types.str; | ||
default = operationalToken; | ||
description = "Operational token"; | ||
}; | ||
|
||
user = mkOption { | ||
type = types.str; | ||
default = "liability"; | ||
description = "User account under which service runs."; | ||
}; | ||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
environment.systemPackages = with pkgs; [ drone_passport_agent ]; | ||
|
||
systemd.services.drone_passport = { | ||
requires = [ "roscore.service" ]; | ||
after = [ "liability.service" "roscore.service" ]; | ||
wantedBy = [ "multi-user.target" ]; | ||
|
||
script = '' | ||
source ${pkgs.drone_passport_agent}/setup.bash \ | ||
&& roslaunch drone_passport_agent agent.launch \ | ||
login:="${cfg.login}" \ | ||
email_from:="${cfg.email_from}" \ | ||
email_password:="${cfg.email_password}" \ | ||
token:="${cfg.token}" | ||
''; | ||
|
||
serviceConfig = { | ||
Restart = "on-failure"; | ||
StartLimitInterval = 0; | ||
RestartSec = 60; | ||
User = cfg.user; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.services.issuing-service; | ||
|
||
emitterContractAddress = "0x4b255d6E57409232F7C29759D5699dabE66f8Cd5"; | ||
validatorContractAddress = "0x8a919cC91bA1ac88BF5FdCeb116c35f7Dc1Ed179"; | ||
|
||
python-eth_keyfile = pkgs.python3.withPackages (ps : with ps; [ eth-keyfile ]); | ||
|
||
in { | ||
options = { | ||
services.issuing-service = { | ||
enable = mkEnableOption "Enable Issuing service."; | ||
|
||
emitter_contract = mkOption { | ||
type = types.str; | ||
default = emitterContractAddress; | ||
description = "Emitter smart-contract address"; | ||
}; | ||
|
||
validator = mkOption { | ||
type = types.str; | ||
default = validatorContractAddress; | ||
description = "Validator smart-contract address."; | ||
}; | ||
|
||
lighthouse = mkOption { | ||
type = types.str; | ||
default = "0x2442ED30381f8556e1e2C12fdb0E7F0aa56192E9"; | ||
description = "Lighthouse address to work on"; | ||
}; | ||
|
||
token = mkOption { | ||
type = types.str; | ||
default = "0x7dE91B204C1C737bcEe6F000AAA6569Cf7061cb7"; | ||
description = "Payment token"; | ||
}; | ||
|
||
user = mkOption { | ||
type = types.str; | ||
default = "liability"; | ||
description = "User account under which service runs."; | ||
}; | ||
|
||
}; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
environment.systemPackages = with pkgs; [ issuing_service_agent ]; | ||
|
||
systemd.services.erc20 = { | ||
requires = [ "roscore.service" ]; | ||
after = [ "roscore.service" "liability.service" ]; | ||
wantedBy = [ "multi-user.target" ]; | ||
|
||
script = '' | ||
source ${pkgs.issuing_service_agent}/setup.bash \ | ||
&& roslaunch issuing_service_agent issuer.launch \ | ||
emitter_contract:="${cfg.emitter_contract}" \ | ||
validator:="${cfg.validator}" \ | ||
lighthouse:="${cfg.lighthouse}" \ | ||
token:="${cfg.token}" | ||
''; | ||
|
||
serviceConfig = { | ||
Restart = "on-failure"; | ||
StartLimitInterval = 0; | ||
RestartSec = 60; | ||
User = cfg.user; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters