Added firmware package
This commit is contained in:
parent
2c53327c28
commit
1f965038fc
9 changed files with 41 additions and 7 deletions
50
MMDVMHost/module.nix
Normal file
50
MMDVMHost/module.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{ lib, config, pkgs, mmdvm_host, ... }:
|
||||
with lib;
|
||||
let
|
||||
# Shorter name to access final settings a
|
||||
# user of hello.nix module HAS ACTUALLY SET.
|
||||
# cfg is a typical convention.
|
||||
cfg = config.services.mmdvm_host;
|
||||
in
|
||||
{
|
||||
|
||||
options.services.mmdvm_host = {
|
||||
enable = mkEnableOption "MMDVMHost service";
|
||||
package = mkOption {
|
||||
default = mmdvm_host.x86_64-linux.default;
|
||||
type = types.package;
|
||||
};
|
||||
user = mkOption {
|
||||
type = types.str;
|
||||
default = "afg";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = [
|
||||
cfg.package
|
||||
];
|
||||
|
||||
systemd.services.mmdvm_host = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "network.target" ];
|
||||
after = [ "network.target" ];
|
||||
description = "MMDVMHost service";
|
||||
serviceConfig = {
|
||||
Type = "exec";
|
||||
User = cfg.user;
|
||||
Restart = "always";
|
||||
RestartSec = "3s";
|
||||
StartLimitIntervalSec = "0";
|
||||
RuntimeDirectory = "MMDVMHost";
|
||||
};
|
||||
script = ''
|
||||
exec ${cfg.package}/bin/MMDVMHost
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue