suckless-pkg.nix (520B) download
1{ stdenv, lib }:
2
3{ configHeader ? null, extraConfig ? { }, ... }@args:
4
5let
6 configs = extraConfig // (lib.optionalAttrs (configHeader != null) { "config.h" = configHeader; });
7 configurePhase = lib.concatStrings (lib.mapAttrsToList (dest: src: "ln -sfv ${src} ${dest}\n") configs);
8in
9stdenv.mkDerivation (
10 (builtins.removeAttrs args [ "configHeader" "extraConfig" ]) // {
11
12 inherit configurePhase;
13
14 buildPhase = ''
15 make all
16 '';
17
18 installPhase = ''
19 make PREFIX=$out install
20 '';
21 }
22)