From 35dd3df5c6276dace7bfbd755a72a6122ecf5ae3 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 15 Oct 2015 00:55:07 +0200 Subject: krebs lib: init eq --- krebs/4lib/default.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'krebs') diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix index ca7219c7e..f83be9ff8 100644 --- a/krebs/4lib/default.nix +++ b/krebs/4lib/default.nix @@ -5,6 +5,8 @@ with lib; builtins // lib // rec { + eq = x: y: x == y; + addName = name: set: set // { inherit name; }; -- cgit v1.2.3 From 3a375d843ec4a6828673597810101923619a3e94 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 15 Oct 2015 00:59:00 +0200 Subject: krebs lib: init subdirsOf --- krebs/4lib/default.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'krebs') diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix index f83be9ff8..78f719988 100644 --- a/krebs/4lib/default.nix +++ b/krebs/4lib/default.nix @@ -24,4 +24,8 @@ builtins // lib // rec { null = "NULL"; string = toJSON x; # close enough }.${typeOf x}; + + subdirsOf = path: + mapAttrs (name: _: path + "/${name}") + (filterAttrs (_: eq "directory") (readDir path)); } -- cgit v1.2.3 From ce86a988c11fe3077da439672b8a462cec61bcd4 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 15 Oct 2015 01:02:25 +0200 Subject: krebs pkgs: callPackages for all subdirs --- krebs/5pkgs/default.nix | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'krebs') diff --git a/krebs/5pkgs/default.nix b/krebs/5pkgs/default.nix index c48c3dee8..83cca961e 100644 --- a/krebs/5pkgs/default.nix +++ b/krebs/5pkgs/default.nix @@ -2,29 +2,7 @@ with import ../4lib { inherit lib; }; -let - inherit (pkgs) callPackage; -in - -rec { - cac = callPackage ./cac {}; - charybdis = callPackage ./charybdis {}; - dic = callPackage ./dic {}; - genid = callPackage ./genid {}; - get = callPackage ./get {}; - github-hosts-sync = callPackage ./github-hosts-sync {}; - hashPassword = callPackage ./hashPassword {}; - jq = callPackage ./jq {}; - krebszones = callPackage ./krebszones {}; - lentil = callPackage ./lentil {}; - much = callPackage ./much {}; - nq = callPackage ./nq {}; - posix-array = callPackage ./posix-array {}; - pssh = callPackage ./pssh {}; - passwdqc-utils = callPackage ./passwdqc-utils {}; - Reaktor = callPackage ./Reaktor {}; - realwallpaper = callPackage ./realwallpaper.nix {}; - youtube-tools = callPackage ./youtube-tools {}; +mapAttrs (_: flip pkgs.callPackage {}) (subdirsOf ./.) // rec { execve = name: { filename, argv, envp ? {}, destination ? "" }: writeC name { inherit destination; } '' -- cgit v1.2.3 From 521f74a4fe4635fc9b7366ac928c5066626496d1 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 15 Oct 2015 01:59:40 +0200 Subject: krebs pkgs: allow recursive pkgs --- krebs/5pkgs/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'krebs') diff --git a/krebs/5pkgs/default.nix b/krebs/5pkgs/default.nix index 83cca961e..9b059f046 100644 --- a/krebs/5pkgs/default.nix +++ b/krebs/5pkgs/default.nix @@ -2,7 +2,12 @@ with import ../4lib { inherit lib; }; -mapAttrs (_: flip pkgs.callPackage {}) (subdirsOf ./.) // rec { +let + subdirs = mapAttrs (_: flip pkgs.callPackage {}) (subdirsOf ./.); + pkgs' = pkgs // subdirs; +in + +subdirs // rec { execve = name: { filename, argv, envp ? {}, destination ? "" }: writeC name { inherit destination; } '' -- cgit v1.2.3 From 7eb564d0eff22226a2e9955a3c239d1a770bde93 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 15 Oct 2015 02:00:32 +0200 Subject: push: init at 1.0.0 --- krebs/5pkgs/default.nix | 4 ++++ krebs/5pkgs/push/default.nix | 48 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 krebs/5pkgs/push/default.nix (limited to 'krebs') diff --git a/krebs/5pkgs/default.nix b/krebs/5pkgs/default.nix index 9b059f046..a8a1b5853 100644 --- a/krebs/5pkgs/default.nix +++ b/krebs/5pkgs/default.nix @@ -9,6 +9,10 @@ in subdirs // rec { + push = pkgs'.callPackage ./push { + inherit (subdirs) get jq; + }; + execve = name: { filename, argv, envp ? {}, destination ? "" }: writeC name { inherit destination; } '' #include diff --git a/krebs/5pkgs/push/default.nix b/krebs/5pkgs/push/default.nix new file mode 100644 index 000000000..ce496d9c3 --- /dev/null +++ b/krebs/5pkgs/push/default.nix @@ -0,0 +1,48 @@ +{ fetchgit, lib, stdenv +, coreutils +, get +, git +, gnused +, jq +, openssh +, parallel +, ... }: + +stdenv.mkDerivation { + name = "push-1.0.0"; + + src = fetchgit { + url = http://cgit.cd.retiolum/push; + rev = "513da89fe50b3bad3d758855f5622c4508977e4a"; + sha256 = "6124e1d4d4ef57455e2f06891e06fb01d3786846efaf9b79e3176d89988e1b4e"; + }; + + phases = [ + "unpackPhase" + "installPhase" + ]; + + installPhase = + let + path = lib.makeSearchPath "bin" [ + coreutils + get + git + gnused + jq + openssh + parallel + ]; + in + '' + mkdir -p $out/bin + + sed \ + '1s,.*,&\nPATH=${path},' \ + < ./push \ + > $out/bin/push + + chmod +x $out/bin/push + ''; +} + -- cgit v1.2.3