forked from icetan/nixiform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
42 lines (39 loc) · 1.25 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
let
nixiform = {
stdenv, makeWrapper, lib, shellcheck,
glibcLocales, coreutils, gzip, gnused, gnugrep, gnutar, openssh, git, jq,
nix, nix-diff
}: stdenv.mkDerivation rec {
name = "nixiform-${version}";
version = lib.fileContents ./lib/version;
src = lib.sourceByRegex ./. [
"bin" "bin/.*"
"lib" "lib/.*"
];
nativeBuildInputs = [ makeWrapper shellcheck ];
buildPhase = "true";
installPhase = let
path = lib.makeBinPath [
coreutils gzip gnused gnugrep gnutar openssh git jq
nix nix-diff
];
locales = lib.optionalString (glibcLocales != null)
"--set LOCALE_ARCHIVE \"${glibcLocales}\"/lib/locale/locale-archive";
in ''
mkdir -p $out/{bin,lib}
cp -r -t $out/bin ./bin/*
cp -r -t $out/lib ./lib/*
wrapProgram "$out/bin/nixiform" --argv0 nixiform --prefix PATH : "${path}" ${locales}
'';
doCheck = true;
checkPhase = ''
shellcheck -x bin/* lib/{infect,configurators/*}
'';
meta = with lib; {
description = "Nixiform deploy NixOS configurations";
homepage = https://github.com/icetan/nixiform;
license = licenses.gpl3;
inherit version;
};
};
in { pkgs ? import <nixpkgs> {} }: pkgs.callPackage nixiform {}