]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - default.nix
Add a bunch of programs
[perso/Immae/Config/Nix.git] / default.nix
index 28767a9b2dea0225c2da423ea8be9b4789964128..95caf5158e1f0880e63096abcea0b57b6f150353 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;
@@ -63,7 +78,7 @@ let
 
   nixos = import ./nixos_tools.nix {};
 
-  pass = nixpkgs.pass.overrideAttrs (oldAttrs:
+  pass = (nixpkgs.pass.withExtensions (exts: [ exts.pass-otp ])).overrideAttrs (oldAttrs:
     fetchedGit ./fetched/pass.json // {
       patches = oldAttrs.patches ++ [ ./patches/pass-fix-pass-init.patch ];
     }
@@ -164,6 +179,49 @@ 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);
+
+  pg_activity = with python2Packages; buildPythonApplication (fetchedGithub ./fetched/pg_activity.json // rec {
+    propagatedBuildInputs = [ psycopg2 psutil ];
+  });
+
+  pgloader = stdenv.mkDerivation (fetchedGithub ./fetched/pgloader.json // rec {
+    buildInputs = [ sbcl cacert sqlite freetds libzip curl git openssl makeWrapper ];
+    LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath [ sqlite libzip curl git openssl freetds ];
+    buildPhase = ''
+      export PATH=$PATH:$out/bin
+      export HOME=$TMPDIR
+      make pgloader
+    '';
+    dontStrip = true;
+    enableParallelBuilding = false;
+    installPhase = ''
+      install -Dm755 build/bin/pgloader "$out/bin/pgloader"
+      wrapProgram $out/bin/pgloader --prefix LD_LIBRARY_PATH : "${LD_LIBRARY_PATH}"
+    '';
+  });
+
 # 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 +247,26 @@ 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 pg_activity pgloader;
+    inherit ncmpc;
+    inherit cadaver;
+    inherit mairix notmuch;
+    inherit ctags;
+    inherit s3cmd;
+    inherit solc; # solidity
+    inherit rtorrent;
+    inherit strace;
+    inherit vdirsyncer;
+    inherit w3m lynx links;
+    inherit gitRepo;
+    inherit valgrind;
     #inherit nixos;
   }