diff options
author | Jan Malakhovski <oxij@oxij.org> | 2014-06-12 05:36:16 +0000 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2014-09-01 10:33:48 +0400 |
commit | 99243a5c514c888e09bbc13214a6ba23ea03d392 (patch) | |
tree | a2dc076683ae597696da510917ee955791cd50e5 /nixos/modules/services/networking/atftpd.nix | |
parent | 8f50d803ef9c94fb82909e22b603982a0a522aea (diff) | |
download | nixpkgs-99243a5c514c888e09bbc13214a6ba23ea03d392.tar nixpkgs-99243a5c514c888e09bbc13214a6ba23ea03d392.tar.gz nixpkgs-99243a5c514c888e09bbc13214a6ba23ea03d392.tar.bz2 nixpkgs-99243a5c514c888e09bbc13214a6ba23ea03d392.tar.lz nixpkgs-99243a5c514c888e09bbc13214a6ba23ea03d392.tar.xz nixpkgs-99243a5c514c888e09bbc13214a6ba23ea03d392.tar.zst nixpkgs-99243a5c514c888e09bbc13214a6ba23ea03d392.zip |
nixos: add atftpd service
Diffstat (limited to 'nixos/modules/services/networking/atftpd.nix')
-rw-r--r-- | nixos/modules/services/networking/atftpd.nix | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/atftpd.nix b/nixos/modules/services/networking/atftpd.nix new file mode 100644 index 00000000000..ab9f8650f0f --- /dev/null +++ b/nixos/modules/services/networking/atftpd.nix @@ -0,0 +1,51 @@ +# NixOS module for atftpd TFTP server + +{ config, pkgs, ... }: + +with pkgs.lib; + +let + + cfg = config.services.atftpd; + +in + +{ + + options = { + + services.atftpd = { + + enable = mkOption { + default = false; + type = types.uniq types.bool; + description = '' + Whenever to enable the atftpd TFTP server. + ''; + }; + + root = mkOption { + default = "/var/empty"; + type = types.uniq types.string; + description = '' + Document root directory for the atftpd. + ''; + }; + + }; + + }; + + config = mkIf cfg.enable { + + systemd.services.atftpd = { + description = "atftpd TFTP server"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + # runs as nobody + serviceConfig.ExecStart = "${pkgs.atftp}/sbin/atftpd --daemon --no-fork --bind-address 0.0.0.0 ${cfg.root}"; + }; + + }; + +} |