Skip to content

Instantly share code, notes, and snippets.

/hiawatha.nix Secret

Created February 26, 2017 16:59
Show Gist options
  • Save anonymous/dadb79ed421bd65a02905013e1165013 to your computer and use it in GitHub Desktop.
Save anonymous/dadb79ed421bd65a02905013e1165013 to your computer and use it in GitHub Desktop.
{ config, lib, pkgs, ...}:
let
cfg = config.services.hiawatha;
in
with lib;
{
options.services.hiawatha = {
enable = mkOption {
default = false;
description = "Enable the Hiawatha server";
};
configFile = {
default = "${pkgs.hiawatha}/etc/hiawatha" ;
type = types.path;
};
};
config = mkIf cfg.enable {
systemd.services.hiawatha = {
description = "Hiawatha";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pkgs.hiawatha}/bin/hiawatha -c cfg.configFile";
Type = "forking";
DynamicUsers = true;
};
environment.systemPackages = [ pkgs.hiawatha ];
/*
users.extraUsers.hiawatha = {
group = "hiawatha";
uid = config.ids.uids.hiawatha;};
users.extraGroups.hiawatha.gid = config.ids.uids.hiawatha; */
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment