From 97b17113791d3410bb2fc8307a3a26a47594fcf8 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 15 Oct 2015 00:19:12 +0200 Subject: [PATCH 1/8] tv base: environment.variables.EDITOR = "vim" --- tv/2configs/base.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tv/2configs/base.nix b/tv/2configs/base.nix index 1c6eba662..a5ad7c7d3 100644 --- a/tv/2configs/base.nix +++ b/tv/2configs/base.nix @@ -79,11 +79,7 @@ in environment.etc."vim/vim${majmin pkgs.vim.version}".source = "${pkgs.vim}/share/vim/vim${majmin pkgs.vim.version}"; - # multiple-definition-problem when defining environment.variables.EDITOR - environment.extraInit = '' - EDITOR=vim - ''; - + environment.variables.EDITOR = lib.mkForce "vim"; environment.variables.VIM = "/etc/vim"; } { From 32c8e9a10b14071c5e5b128c33eaa87a363bce81 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 15 Oct 2015 00:26:02 +0200 Subject: [PATCH 2/8] tv base: drop redundant "lib." --- tv/2configs/base.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/2configs/base.nix b/tv/2configs/base.nix index a5ad7c7d3..010d4b326 100644 --- a/tv/2configs/base.nix +++ b/tv/2configs/base.nix @@ -79,7 +79,7 @@ in environment.etc."vim/vim${majmin pkgs.vim.version}".source = "${pkgs.vim}/share/vim/vim${majmin pkgs.vim.version}"; - environment.variables.EDITOR = lib.mkForce "vim"; + environment.variables.EDITOR = mkForce "vim"; environment.variables.VIM = "/etc/vim"; } { From 35dd3df5c6276dace7bfbd755a72a6122ecf5ae3 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 15 Oct 2015 00:55:07 +0200 Subject: [PATCH 3/8] krebs lib: init eq --- krebs/4lib/default.nix | 2 ++ 1 file changed, 2 insertions(+) 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; }; From 3a375d843ec4a6828673597810101923619a3e94 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 15 Oct 2015 00:59:00 +0200 Subject: [PATCH 4/8] krebs lib: init subdirsOf --- krebs/4lib/default.nix | 4 ++++ 1 file changed, 4 insertions(+) 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)); } From ce86a988c11fe3077da439672b8a462cec61bcd4 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 15 Oct 2015 01:02:25 +0200 Subject: [PATCH 5/8] krebs pkgs: callPackages for all subdirs --- krebs/5pkgs/default.nix | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) 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; } '' From 521f74a4fe4635fc9b7366ac928c5066626496d1 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 15 Oct 2015 01:59:40 +0200 Subject: [PATCH 6/8] krebs pkgs: allow recursive pkgs --- krebs/5pkgs/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } '' From 7eb564d0eff22226a2e9955a3c239d1a770bde93 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 15 Oct 2015 02:00:32 +0200 Subject: [PATCH 7/8] push: init at 1.0.0 --- krebs/5pkgs/default.nix | 4 +++ krebs/5pkgs/push/default.nix | 48 ++++++++++++++++++++++++++++++++++++ tv/1systems/wu.nix | 1 + tv/2configs/git.nix | 1 + 4 files changed, 54 insertions(+) create mode 100644 krebs/5pkgs/push/default.nix 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 + ''; +} + diff --git a/tv/1systems/wu.nix b/tv/1systems/wu.nix index 0ef846f93..cc99b0498 100644 --- a/tv/1systems/wu.nix +++ b/tv/1systems/wu.nix @@ -89,6 +89,7 @@ with lib; pavucontrol posix_man_pages pssh + push qrencode sxiv texLive diff --git a/tv/2configs/git.nix b/tv/2configs/git.nix index 401cf5f4d..d782c87f1 100644 --- a/tv/2configs/git.nix +++ b/tv/2configs/git.nix @@ -35,6 +35,7 @@ let nixos-infest = {}; nixpkgs = {}; painload = {}; + push = {}; quipper = {}; regfish = {}; stockholm = { From 338df3310352163d3cce850e6ff461c2cdf58eb5 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 15 Oct 2015 02:48:11 +0200 Subject: [PATCH 8/8] make eval: provide stockholm via -I --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 552e6e0fd..8834cb7c8 100644 --- a/Makefile +++ b/Makefile @@ -35,11 +35,11 @@ ifeq ($(filter),json) else filter() { cat; } endif - NIX_PATH=stockholm=$$PWD:$$NIX_PATH \ nix-instantiate \ $${extraArgs-} \ --eval \ -A "$$get" \ + -I stockholm="$$PWD" \ '' \ --argstr current-date "$$(date -Is)" \ --argstr current-host-name "$$HOSTNAME" \