nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 coreutils,
6 openssh,
7 gnutar,
8}:
9
10stdenv.mkDerivation rec {
11 pname = "rset";
12 version = "3.2";
13
14 src = fetchFromGitHub {
15 owner = "eradman";
16 repo = "rset";
17 tag = version;
18 hash = "sha256-b797R79aMopiPApTJ4Q3SP2MRjqCcNNO9BIxtuiNZks=";
19 };
20
21 patches = [ ./paths.patch ];
22
23 postPatch = ''
24 substituteInPlace rset.c \
25 --replace-fail @ssh@ ${openssh}/bin/ssh \
26 --replace-fail @miniquark@ $out/bin/miniquark \
27 --replace-fail @rinstall@ $out/bin/rinstall \
28 --replace-fail @rsub@ $out/bin/rsub
29
30 substituteInPlace execute.c \
31 --replace-fail @ssh@ ${openssh}/bin/ssh \
32 --replace-fail @ssh-add@ ${openssh}/bin/ssh-add \
33 --replace-fail @tar@ ${gnutar}/bin/tar
34
35 substituteInPlace rutils.c \
36 --replace-fail @install@ ${coreutils}/bin/install
37 '';
38
39 # these are to be run on the remote host,
40 # so we want to preserve the original shebang.
41 postFixup = ''
42 sed -i "1s@.*@#!/bin/sh@" $out/bin/rinstall
43 sed -i "1s@.*@#!/bin/sh@" $out/bin/rsub
44 '';
45
46 dontAddPrefix = true;
47 installFlags = [ "PREFIX=$(out)" ];
48
49 meta = {
50 homepage = "https://scriptedconfiguration.org/";
51 description = "Configure systems using any scripting language";
52 changelog = "https://github.com/eradman/rset/raw/${version}/NEWS";
53 license = lib.licenses.isc;
54 platforms = lib.platforms.unix;
55 maintainers = [ ];
56 };
57}