krebs builders: turn file into module
This commit is contained in:
parent
c34f8a33dc
commit
a4683911af
|
@ -1,8 +1,9 @@
|
|||
{ config, pkgs, ... }:
|
||||
{ pkgs, ... }:
|
||||
with import <stockholm/lib>;
|
||||
rec {
|
||||
{
|
||||
nixpkgs.config.packageOverrides = _: {
|
||||
execve = name: { filename, argv ? null, envp ? {}, destination ? "" }: let
|
||||
in writeC name { inherit destination; } /* c */ ''
|
||||
in pkgs.writeC name { inherit destination; } /* c */ ''
|
||||
#include <unistd.h>
|
||||
|
||||
static char *const filename = ${toC filename};
|
||||
|
@ -26,7 +27,8 @@ rec {
|
|||
}
|
||||
'';
|
||||
|
||||
execveBin = name: cfg: execve name (cfg // { destination = "/bin/${name}"; });
|
||||
execveBin = name: cfg:
|
||||
pkgs.execve name (cfg // { destination = "/bin/${name}"; });
|
||||
|
||||
makeScriptWriter = interpreter: name: text:
|
||||
assert (with types; either absolute-pathname filename).check name;
|
||||
|
@ -66,7 +68,7 @@ rec {
|
|||
strip --strip-unneeded "$exe"
|
||||
'';
|
||||
|
||||
writeDash = makeScriptWriter "${pkgs.dash}/bin/dash";
|
||||
writeDash = pkgs.makeScriptWriter "${pkgs.dash}/bin/dash";
|
||||
|
||||
writeDashBin = name:
|
||||
assert types.filename.check name;
|
||||
|
@ -289,5 +291,6 @@ rec {
|
|||
cp src.py "$out"
|
||||
'';
|
||||
|
||||
writeSed = makeScriptWriter "${pkgs.gnused}/bin/sed -f";
|
||||
writeSed = pkgs.makeScriptWriter "${pkgs.gnused}/bin/sed -f";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
{ config, lib, pkgs, ... }@args:
|
||||
with import <stockholm/lib>;
|
||||
{
|
||||
imports = [
|
||||
./builders.nix
|
||||
];
|
||||
nixpkgs.config.packageOverrides = oldpkgs: let
|
||||
|
||||
# This callPackage will try to detect obsolete overrides.
|
||||
|
@ -15,7 +18,6 @@ with import <stockholm/lib>;
|
|||
else override;
|
||||
|
||||
in {}
|
||||
// import ./builders.nix args
|
||||
// mapAttrs (_: flip callPackage {})
|
||||
(filterAttrs (_: dir: pathExists (dir + "/default.nix"))
|
||||
(subdirsOf ./.))
|
||||
|
|
Loading…
Reference in New Issue
Block a user