]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - default.nix
Start splitting nix environment to smaller files
[perso/Immae/Config/Nix.git] / default.nix
index 1f50aa365046a18e29ceff3fdf665837d9afe0ae..38d7e0beb9fb3cf740db6876216bb004c3173336 100644 (file)
@@ -1,14 +1,8 @@
-with import <immaeNixpkgsNext> {};
-with import ./libs.nix { nixpkgs = import <immaeNixpkgsNext> {}; };
+with import <nixpkgs> {};
+with import ./libs.nix { nixpkgs = import <nixpkgs> {}; };
 let
   mypkgs = {};
 
-  mypkgs.ledger = (ledger.override { boost = boost166; }).overrideAttrs (_old:
-    fetchedGithub ./fetched/ledger.json // {
-      postInstall = "";
-    }
-  );
-
   mypkgs.taskwarrior = taskwarrior.overrideAttrs (old: rec {
     postInstall = ''${old.postInstall}
       mkdir -p "$out/share/vim/vimfiles/ftdetect"
@@ -29,6 +23,11 @@ let
   mypkgs.weboob = (pythonPackages.weboob.overridePythonAttrs {
       setupPyBuildFlags = [ "--no-qt" "--xdg" ];
     }).overrideAttrs (old: rec {
+      version = "1.5";
+      src = fetchurl {
+        url = "https://git.weboob.org/weboob/weboob/-/archive/${version}/${old.pname}-${version}.tar.gz";
+        sha256 = "0l6q5nm5g0zn6gmf809059kddrbds27wgygxsfkqja9blks5vq7z";
+      };
       postInstall = ''${old.postInstall or ""}
         mkdir -p $out/share/bash-completion/completions/
         cp tools/weboob_bash_completion $out/share/bash-completion/completions/weboob
@@ -63,19 +62,11 @@ let
     configureFlags = old.configureFlags ++ [ "--enable-plugins" ];
   });
 
-  mypkgs.weechat = (wrapWeechat (
-    weechat-unwrapped.overrideAttrs (old: rec {
-      version = "2.3";
-      name = "weechat-${version}";
-      src = fetchurl {
-        url = "https://weechat.org/files/src/weechat-${version}.tar.bz2";
-        sha256 = "0mi4pfnyny0vqc35r0scn6yy21y790a5iwq8ms7kch7b7z11jn9w";
-      };
-      patches = [];
-    })
-  ) {}).override {
+  mypkgs.weechat = weechat.override {
     configure = { availablePlugins, ... }: {
       plugins = with availablePlugins; [
+          # Make sure websocket_client is not 0.55.0, it provokes
+          # regular crashes
          (python.withPackages (ps: with ps; [websocket_client emoji]))
          perl
          ruby
@@ -83,92 +74,16 @@ let
     };
   };
 
-  buildPerlPackage = perlPackages.buildPerlPackage;
-  mypkgs.note = buildPerlPackage rec {
-    name = "note-1.3.26";
-    src = fetchurl {
-      url = "mirror://cpan/authors/id/T/TL/TLINDEN/${name}.tar.gz";
-      sha256 = "1h645rnb5vpms48fcyzvp7cwwcbf9k5xq49w2bpniyzzgk2brjrq";
-    };
-    outputs = ["out" "man"];
-    propagatedBuildInputs = [ perlPackages.YAML ];
-    meta = with stdenv.lib; {
-      description = "A perl script for maintaining notes";
-      homepage    = http://www.daemon.de/NOTE;
-      license     = licenses.gpl3;
-      maintainers = with maintainers; [ { name  = "T.v.Dein"; email = "tlinden@cpan.org"; } ];
-      platforms   = platforms.unix;
-    };
-  };
-
-  mypkgs.terminal-velocity = with python3Packages; buildPythonApplication rec {
-    pname = "terminal-velocity-git";
-    version = "0.2.0";
-
-    patches = [
-      ./patches/terminal_velocity_sort_found_notes.patch
-      ./patches/terminal_velocity_python3_support.patch
-      # FIXME: update this patch when version changes
-      ./patches/terminal_velocity_fix_build.patch
-    ];
-
-    propagatedBuildInputs = [ chardet urwid (sh.overridePythonAttrs { doCheck = false; }) pyyaml ];
-    buildInputs = [ m2r (restructuredtext_lint.overridePythonAttrs { doCheck = false; }) pygments ];
-
-    postInstall = ''
-      rm $out/bin/terminal_velocity
-      '';
-    src = fetchPypi {
-      inherit pname version;
-      sha256 = "13yrkcmvh5h5fwnai61sbmqkrjyisz08n62pq0ada2lyyqf7g6b9";
-    };
-  };
-
-  mypkgs.mtop = buildPerlPackage rec {
-    name = "mtop-${version}";
-    version = "0.6.6";
-    src = fetchurl {
-      url = "http://downloads.sourceforge.net/project/mtop/mtop/v${version}/mtop-${version}.tar.gz";
-      sha256 = "0x0x5300b1j9i0xxk8rsrki0pspyzj2vylhzv8qg3l6j26aw0zrf";
-    };
-    outputs = ["out"];
-    buildInputs = [ perlPackages.DBI perlPackages.DBDmysql perlPackages.Curses ];
-
-    postInstall = ''
-      cd "$out"
-      preConfigure || true
-    '';
-    meta = with stdenv.lib; {
-      description = "MySQL top (monitor and examine slow queries)";
-      homepage    = http://mtop.sourceforge.net/;
-      license     = licenses.gpl3;
-      maintainers = with maintainers; [ { name  = "Marc Prewitt"; email = "mprewitt@chelsea.net"; } ];
-      platforms   = platforms.unix;
-    };
-  };
-
-  mypkgs.tiv = buildPerlPackage rec {
-    name = "tiv-${version}";
-    version = "2015";
-    src = fetchurl {
-      url = "http://xyne.archlinux.ca/projects/tiv/src/tiv-${version}.tar.xz";
-      sha256 = "1vq073v7z7vmcd57lhs4rf4jasji69cpjgkz4dykp94a77p1qq90";
-    };
-    outputs = ["out"];
-    buildInputs = [ perlPackages.PerlMagick ];
-    perlPreHookScript = ./hooks/tiv_builder.sh;
-    perlPreHook = ''
-      source ${perlPreHookScript}
-    '';
-    installPhase = ''
-      install -Dm755 tiv "$out/bin/tiv"
-    '';
-  };
+  mypkgs.mtop = callPackage ./pkgs/mtop {};
+  mypkgs.note = callPackage ./pkgs/note {};
+  mypkgs.terminal-velocity = callPackage ./pkgs/terminal-velocity {};
+  mypkgs.tiv = callPackage ./pkgs/tiv {};
 
   mypkgs.cnagios = stdenv.mkDerivation (fetchedGithub ./fetched/cnagios.json // rec {
     configureFlags = [
       "--with-etc-dir=/etc/cnagios"
       "--with-var-dir=/var/lib/naemon"
+      "--with-status-file=/var/lib/naemon/status.dat"
       "--with-nagios-data=4"
     ];
 
@@ -548,8 +463,124 @@ let
         '';
     };
 
-    mypkgs.lesspipe = lesspipe.overrideAttrs(old: {
-      configureFlags = (old.configureFlags or []) ++ [ "--yes" ];
+  mypkgs.lesspipe = lesspipe.overrideAttrs(old: {
+    configureFlags = (old.configureFlags or []) ++ [ "--yes" ];
+  });
+
+  mypkgs.genius = stdenv.mkDerivation rec {
+    name = "genius-${version}";
+    version = "1.0.24";
+    src = fetchurl {
+      url = "https://download.gnome.org/sources/genius/1.0/${name}.tar.xz";
+      sha256 = "772f95f6ae4716d39bb180cd50e8b6b9b074107bee0cd083b825e1e6e55916b6";
+    };
+    buildInputs = [
+      mpfr glib hicolor-icon-theme gtk2 intltool gnome-doc-utils python3 gnome2.gtksourceview
+      autoconf automake libtool ncurses readline pkg-config
+    ];
+    preConfigure = ''
+      autoreconf -fi
+      '';
+    preBuild = ''
+      sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
+      '';
+  };
+
+  mypkgs.unicode = let
+    version = "12.0";
+    version-full = "${version}.0";
+    files = {
+      emoji-data = fetchurl {
+        url = "http://www.unicode.org/Public/emoji/${version}/emoji-data.txt";
+        sha256 = "03sf7h1d6kb9m5s02lif88jsi5kjszpkfvcymaqxj8ds70ar9pgv";
+      };
+      emoji-sequences = fetchurl {
+        url = "http://www.unicode.org/Public/emoji/${version}/emoji-sequences.txt";
+        sha256 = "1hghki2rn3n7m4lwpwi2a5wrsf2nij4bxga9ldabx4g0g2k23svs";
+      };
+      emoji-test = fetchurl {
+        url = "http://www.unicode.org/Public/emoji/${version}/emoji-test.txt";
+        sha256 = "1dqd0fh999mh6naj816ni113m9dimfy3ih9nffjq2lrv9mmlgdck";
+      };
+      emoji-variation-sequences = fetchurl {
+        url = "http://www.unicode.org/Public/emoji/${version}/emoji-variation-sequences.txt";
+        sha256 = "1cccwx5bl79w4c19vi5dhjqxrph92s8hihp9y8s2cqvdzmgbln7a";
+      };
+      emoji-zwj-sequences = fetchurl {
+        url = "http://www.unicode.org/Public/emoji/${version}/emoji-zwj-sequences.txt";
+        sha256 = "1l791nbijmmhwa7kmvfn8gp26ban512l6mgqpz1mnbq3xm19181n";
+      };
+    };
+    zippedFiles = {
+      UCD = fetchurl {
+        url = "http://www.unicode.org/Public/zipped/${version-full}/UCD.zip";
+        sha256 = "1ighy39cjkmqnv1797wrxjz76mv1fdw7zp5j04q55bkwxsdkvrmh";
+      };
+      Unihan = fetchurl {
+        url = "http://www.unicode.org/Public/zipped/${version-full}/Unihan.zip";
+        sha256 = "1kfdhgg2gm52x3s07bijb5cxjy0jxwhd097k5lqhvzpznprm6ibf";
+      };
+    };
+  in
+    pkgs.runCommand "unicode" {
+      buildInputs = [ libarchive ];
+    } ''
+    mkdir -p $out/share/unicode
+    ${builtins.concatStringsSep "\n" (lib.attrsets.mapAttrsToList (n: u: "install -Dm644 ${u} $out/share/unicode/emoji/${n}.txt") files)}
+    ${builtins.concatStringsSep "\n" (lib.attrsets.mapAttrsToList (n: u: ''
+      install -Dm644 ${u} $out/share/unicode/${n}.zip
+      bsdtar -C "$out/share/unicode" -x -f "$out/share/unicode/${n}.zip"
+      '') zippedFiles)}
+    '';
+
+  mypkgs.dwm = dwm.overrideAttrs(old: rec {
+    postPatch = ''
+      cp ${./patches/dwm_config.h} ./config.h
+      '';
+  });
+
+  mypkgs.nixops = nixops.overrideAttrs (old: {
+    preConfigure = (old.preConfigure or "") + ''
+      sed -i -e "/'keyFile'/s/'path'/'string'/" nixops/backends/__init__.py
+      '';
+  });
+  mypkgs.flrn = let
+    slang = stdenv.mkDerivation rec {
+      name = "slang-debian-patched-${version}";
+      version = "1.4.9";
+      src = fetchurl {
+        url = "ftp://space.mit.edu/pub/davis/slang/v1.4/slang-1.4.9.tar.gz";
+        sha256 = "1y2mg0whqh4b3acd0k17i4biz55bimxg8aaxhmwd165cvspxns9r";
+      };
+      debianPatches = fetchurl {
+        url = "http://archive.debian.org/debian-archive/debian-amd64/pool/main/s/slang/slang_1.4.9dbs-8.diff.gz";
+        sha256 = "0xdq14k5ynqfwpmis1rcggs7m4n921i3bs27icbmbhfg5gb2hap2";
+      };
+      preConfigure = ''
+        cp $debianPatches ./slang.diff.gz
+        gunzip slang.diff.gz
+        patch -p1 < slang.diff
+        for i in debian/patches/*; do
+          patch -p1 < $i
+        done
+        makeFlagsArray=(CFLAGS=" -g -O2 -fno-strength-reduce -DUTF8 -D_REENTRANT -D_XOPEN_SOURCE=500")
+        '';
+      postBuild = ''
+        sed -i "1i#ifndef UTF8\n#define UTF8\n#endif" src/slang.h
+        '';
+    };
+  in
+    stdenv.mkDerivation (fetchedGithub ./fetched/flrn.json // rec {
+      buildInputs = [ libetpan openssl autoconf groff slang yacc ];
+      preConfigure = ''
+        sed -i -e "s/test -e configure/false/" configure.in
+        autoconf
+        sed -i -e '/define CHECK_MAIL/d' src/flrn_config.h
+        sed -i -e '/DEFAULT_DIR_FILE/s@".flrn"@".config/flrn"@' src/flrn_config.h
+        sed -i -e '/DEFAULT_CONFIG_FILE/s@".flrnrc"@"flrnrc"@' src/flrn_config.h
+        sed -i -e '/DEFAULT_FLNEWS_FILE/s@".flnewsrc"@"flnewsrc"@' src/flrn_config.h
+        sed -i -e '/flrn_char chaine/s@18@20@' src/flrn_command.c
+        '';
     });
 # https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh
 # https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks
@@ -588,7 +619,6 @@ in
     inherit keybase;
     inherit bogofilter;
     inherit mtr;
-    inherit nixops;
     inherit urlview;
     inherit rr;
     inherit nix-zsh-completions;
@@ -609,4 +639,14 @@ in
     inherit emacs26-nox;
     inherit highlight sourceHighlight;
     pygmentize = python3Packages.pygments;
+    inherit iftop htop;
+    inherit fetchmail;
+    inherit bc;
+    inherit cpulimit;
+    inherit dmenu st;
+    inherit poppler_utils;
+    inherit tmux;
+    inherit netcat-gnu;
+    inherit ledger;
+    inherit ffmpeg libxslt;
   }