Commit 39003ad9 authored by Yarny0's avatar Yarny0
Browse files

nixos/hylafax: add `package` option

parent eb52347d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
  ];

  config = lib.modules.mkIf config.services.hylafax.enable {
    environment.systemPackages = [ pkgs.hylafaxplus ];
    environment.systemPackages = [ config.services.hylafax.package ];
    users.users.uucp = {
      uid = config.ids.uids.uucp;
      group = "uucp";
+3 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ let
    mkIf
    mkMerge
    mkOption
    mkPackageOption
    ;
  inherit (lib.types)
    attrsOf
@@ -143,6 +144,8 @@ in

    enable = mkEnableOption "HylaFAX server";

    package = mkPackageOption pkgs "HylaFAX" { default = "hylafaxplus"; };

    autostart = mkOption {
      type = bool;
      default = true;
+2 −2
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ touch clientlog faxcron.lastrun xferfaxlog
chown @faxuser@:@faxgroup@ clientlog faxcron.lastrun xferfaxlog

# create symlinks for frozen directories/files
lnsym --target-directory=. "@hylafaxplus@"/spool/{COPYRIGHT,bin,config}
lnsym --target-directory=. "@package@"/spool/{COPYRIGHT,bin,config}

# create empty temporary directories
update --mode=0700 -d client dev status
@@ -93,7 +93,7 @@ install -d "@spoolAreaPath@/etc"
cd "@spoolAreaPath@/etc"

# create symlinks to all files in template's etc
lnsym --target-directory=. "@hylafaxplus@/spool/etc"/*
lnsym --target-directory=. "@package@/spool/etc"/*

# set LOCKDIR in setup.cache
sed --regexp-extended 's|^(UUCP_LOCKDIR=).*$|\1'"'@lockPath@'|g" --in-place setup.cache
+4 −4
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ let
  mkSpoolCmd =
    prefix: program: posArg: options:
    let
      start = "${prefix}${pkgs.hylafaxplus}/spool/bin/${program}";
      start = "${prefix}${cfg.package}/spool/bin/${program}";
      optionsList = toGNUCommandLine { mkOptionName = k: "-${k}"; } (
        { q = cfg.spoolAreaPath; } // options
      );
@@ -54,7 +54,7 @@ let
        { name, type, ... }@modem:
        ''
          # check if modem config file exists:
          test -f "${pkgs.hylafaxplus}/spool/config/${type}"
          test -f "${cfg.package}/spool/config/${type}"
          ln \
            --symbolic \
            --no-target-directory \
@@ -75,8 +75,8 @@ let
      faxgroup = "uucp";
      lockPath = "/var/lock";
      inherit globalConfigPath modemConfigPath;
      inherit (cfg) spoolAreaPath userAccessFile;
      inherit (pkgs) hylafaxplus runtimeShell;
      inherit (cfg) package spoolAreaPath userAccessFile;
      inherit (pkgs) runtimeShell;
    };
  };