]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - default.nix
Add some tool applications
[perso/Immae/Config/Nix.git] / default.nix
index 28767a9b2dea0225c2da423ea8be9b4789964128..9dd553c1daeff173caec40288e0876149a1ffa63 100644 (file)
@@ -1,6 +1,21 @@
 with import <nixpkgs> {};
 let
   nixpkgs = import <nixpkgs> {};
+  postHook =  ''
+    header() {
+      echo -ne "\033[1;36m"
+      echo -n "$1"
+      echo -e "\033[0m"
+    }
+
+    echoCmd() {
+      printf "\033[1;34m%s:\033[0m" "$1"
+      shift
+      printf ' %q' "$@"
+      echo
+    }
+  '';
+
   fetchedGithub = path:
     let
       json = lib.importJSON path;
@@ -164,6 +179,29 @@ let
     '';
   };
 
+  cnagios = stdenv.mkDerivation (fetchedGithub ./fetched/cnagios.json // rec {
+    configureFlags = [
+      "--with-etc-dir=/etc/cnagios"
+      "--with-var-dir=/var/lib/naemon"
+      "--with-nagios-data=4"
+    ];
+
+    prePatch = ''
+      sed -i -e "s/-lcurses/-lncurses/" Makefile.in
+    '';
+    installPhase = ''
+      install -dm755 $out/share/doc/cnagios
+      install -Dm644 cnagiosrc $out/share/doc/cnagios/
+      install -Dm644 cnagios.help $out/share/doc/cnagios/
+      install -Dm644 cnagios.pl $out/share/doc/cnagios/
+      install -dm755 $out/bin
+      install -Dm755 cnagios $out/bin/
+    '';
+    propagatedBuildInputs = [ perl ncurses ];
+  });
+
+  nagios-cli = python2Packages.buildPythonApplication (fetchedGithub ./fetched/nagios-cli.json);
+
 # https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh
 # https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks
 in
@@ -189,9 +227,13 @@ in
     inherit pass;
     inherit ranger;
     inherit profanity;
-    inherit weechat;
+    inherit weechat irssi;
     inherit note terminal_velocity;
     inherit mtop;
     inherit tiv;
+    inherit cnagios nagios-cli;
+    inherit abook khard khal;
+    inherit graphicsmagick;
+    inherit youtube-dl;
     #inherit nixos;
   }