From 002823adceee104f061a90f2c53f4dffeec73436 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 13 May 2018 12:29:00 +0200 Subject: recv --- nix/default.nix | 1 + nix/module.nix | 6 ++++++ nix/recv.nix | 24 ++++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 nix/recv.nix (limited to 'nix') diff --git a/nix/default.nix b/nix/default.nix index dc225a3..b872f6a 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -6,4 +6,5 @@ self: super: pulseaudio-ctl = self.callPackage ./pulseaudio-ctl.nix {}; monitor-uucp = self.callPackage ./monitor-uucp.nix {}; rolling-directory = self.callPackage ./rolling-directory.nix {}; + recv = self.callPackage ./recv.nix {}; } diff --git a/nix/module.nix b/nix/module.nix index edc9bfb..40082b1 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -45,11 +45,17 @@ in { type = with types; listOf (submodule dirConfig); default = []; }; + + programs.recv.enable = mkEnableOption "the ‘recv’ program"; }; config = { nixpkgs.overlays = [ (import ./default.nix) ]; systemd.services = listToAttrs (map dirService config.services.rollingDirectories); + + security.wrappers = mkIf config.programs.recv.enable { + recv.source = "${pkgs.recv}/bin/recv"; + }; }; } diff --git a/nix/recv.nix b/nix/recv.nix new file mode 100644 index 0000000..6bdc559 --- /dev/null +++ b/nix/recv.nix @@ -0,0 +1,24 @@ +{ stdenv +, zsh, gnutar +}: + +stdenv.mkDerivation rec { + name = "recv-${version}"; + version = "0.1"; + src = ../recv; + + phases = [ "buildPhase" "installPhase" ]; + + inherit zsh gnutar; + + buildPhase = '' + substituteAll $src recv + ''; + + installPhase = '' + mkdir -p $out/bin + + install -m 755 -t $out/bin \ + recv + ''; +} -- cgit v1.2.3