New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hylafaxplus #44496
Hylafaxplus #44496
Conversation
|
||
package = mkOption { | ||
type = package; | ||
default = pkgs.hylafaxplus; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the alternative package to hylafaxplus
? Can you add an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it would be a good idea to leave room for HylaFAX (not +). I faintly recall that a couple of years ago I had to use the not-plus version as HylaFAX+ did some things that broke my workflows. However, I don't recall the exact reason.
Would it be better to remove this option? I could do that as I currently need the plus-version only, and others might use the overlays-mechanism of nixpkgs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add it, when there are other alternatives to hylafaxplus available in nixpkgs. Otherwise overriding the package with an overlay should be sufficient.
|
||
faxcron.enable.spoolInit = mkEnableOption '' | ||
Purge old files from the spooling area with | ||
`faxcron` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docbook equivalent, would be <literal>faxcron</literal>
example = "daily"; | ||
description = '' | ||
Purge old files from the spooling area with | ||
`faxcron` with the given frequency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too.
example = "daily"; | ||
description = '' | ||
Purge old files from the spooling area with | ||
`faxcron` with the given frequency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too.
Enable or suppress job archiving: | ||
`false` (the default!) disables archiving completely, | ||
`true` forces archiving of all jobs, | ||
while `null` only enables archiving for jobs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too.
''${cfg.package}/spool/bin/faxqclean'' | ||
''-q "${cfg.spoolAreaPath}"'' | ||
''-v'' | ||
(optionalString (cfg.faxqclean.archiving!=false) ''-a'') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: optionalString (cfg.faxqclean.archiving) ''-a''
is a bit more idiomatic and common.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really in this case: archiving
can also be set to null
, which means that it will archive only jobs that are flagged for archiving. I fear that optionalString
will misunderstand null
as boolean value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make it a enum
instead of boolean option? faxqclean.archiving = null;
is not so self-explaining.
''-q "${cfg.spoolAreaPath}"'' | ||
''-v'' | ||
(optionalString (cfg.faxqclean.archiving!=false) ''-a'') | ||
(optionalString (cfg.faxqclean.archiving==true) ''-A'') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
pkgs/servers/hylafaxplus/default.nix
Outdated
# for a couple of standard binaries in the `PATH` and | ||
# hardcode their absolute paths in the new package. | ||
buildInputs = [ | ||
coreutils # for `base64` command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can assume coreutils
to be always present.
pkgs/servers/hylafaxplus/default.nix
Outdated
openldap # optional | ||
pam # optional | ||
]; | ||
postPatch = ''. "${postPatch}"''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can assume postPatch
to to contain spaces, since the nix store does not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[I guess that's a "not"]
Is that certain? I recall reading somewhere that the directory of the nix store may be changed (at the price of a complete rebuild of all packages). I generally try to be on the safe side with spaces or other shell characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, spaces in the nix path are not supported and would break in many places. We prefer simpler code instead. Even if we would fix it, there are still many build systems and scripts that do not follow this assumption and we cannot fix all of them.
I've updated my branch / pull request. The new version should address all comments so far. I haven't used <literal> everywhere in the documentation strings, but also <filename> and others that I've found in other documentation strings in nixpkgs. I feels alright. Thanks to @Mic92 so far for all suggestions! I hope I haven't missed any with the new version. |
When enabling hylafax (
|
Create the top-level packages attribute 'hylafaxplus' that builds HylaFAX+ . Note: The nobody uid and the nogroup gid are hardcoded in the package. The package build recipe file contains options to modify these ids.
This commit adds the following * the uucp user * options for HylaFAX server to control startup and modems * systemd services for HylaFAX server processes including faxgettys for modems * systemd services to maintain the HylaFAX spool area, including cleanup with faxcron and faxqclean * default configuration for all server processes for a minimal working configuration Some notes: * HylaFAX configuration cannot be initialized with faxsetup (as it would be common on other Linux distributions). The hylafaxplus package contains a template spool area. * Modems are controlled by faxgetty. Send-only configuration (modems controlled by faxq) is not supported by this configuration setup. * To enable the service, one or more modems must be defined with config.services.hylafax.modems . * Sending mail *should* work: HylaFAX will use whatever is in config.services.mail.sendmailSetuidWrapper.program unless overridden with the sendmailPath option. * The admin has to create a hosts.hfaxd file somewhere (e.g. in /etc) before enabling HylaFAX. This file controls access to the server (see hosts.hfaxd(5) ). Sadly, HylaFAX does not permit account-based access control as is accepts connections via TCP only. * Active fax polling should work; I can't test it. * Passive fax polling is not supported by HylaFAX. * Pager transmissions (with sendpage) are disabled by default. I have never tested or used these. * Incoming data/voice/"extern"al calls won't be handled by default. I have never tested or used these.
Yes, one needs to define at least one modem. I'm wondering if it would be useful to permit starting HylaFAX without modems, but there is probably no use to this. With the latest version of the pull request, I added an assertion that complains about missing modems. Additionally, I added a note on the need to define modems in the description of the There is another option with a similar effect: Finally, I changed the names of some supporting build scripts of the package to be more consistent. |
This pull requests contains three commits
Motivation for this change
Send and receive faxes with NixOS.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
): NixOS 18.03nix path-info -S
before and after)There is another Pull Request to that end: #19392 , involved parties: @RamKromberg , @Mic92