]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Start splitting nix environment to smaller files
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 25 Apr 2019 23:32:07 +0000 (01:32 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 25 Apr 2019 23:32:07 +0000 (01:32 +0200)
default.nix
pkgs/mtop/default.nix [new file with mode: 0644]
pkgs/note/default.nix [new file with mode: 0644]
pkgs/terminal-velocity/default.nix [new file with mode: 0644]
pkgs/terminal-velocity/fix_build.patch [moved from patches/terminal_velocity_fix_build.patch with 100% similarity]
pkgs/terminal-velocity/python3_support.patch [moved from patches/terminal_velocity_python3_support.patch with 100% similarity]
pkgs/terminal-velocity/sort_found_notes.patch [moved from patches/terminal_velocity_sort_found_notes.patch with 100% similarity]
pkgs/tiv/default.nix [new file with mode: 0644]
pkgs/tiv/tiv_builder.sh [moved from hooks/tiv_builder.sh with 100% similarity]

index 51ebcc23e646c0cb4b3f63703261d9d314ffc24c..38d7e0beb9fb3cf740db6876216bb004c3173336 100644 (file)
@@ -74,87 +74,10 @@ 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 python36Packages; 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 = [
 
   mypkgs.cnagios = stdenv.mkDerivation (fetchedGithub ./fetched/cnagios.json // rec {
     configureFlags = [
diff --git a/pkgs/mtop/default.nix b/pkgs/mtop/default.nix
new file mode 100644 (file)
index 0000000..4a89430
--- /dev/null
@@ -0,0 +1,24 @@
+{ buildPerlPackage, fetchurl, perlPackages, lib }:
+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 = with perlPackages; [ DBI DBDmysql Curses ];
+
+  postInstall = ''
+    cd "$out"
+    preConfigure || true
+  '';
+
+  meta = with 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;
+  };
+}
diff --git a/pkgs/note/default.nix b/pkgs/note/default.nix
new file mode 100644 (file)
index 0000000..0c422bc
--- /dev/null
@@ -0,0 +1,18 @@
+{ lib, buildPerlPackage, fetchurl, perlPackages }:
+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 = with perlPackages; [ YAML ];
+
+  meta = with 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;
+  };
+}
diff --git a/pkgs/terminal-velocity/default.nix b/pkgs/terminal-velocity/default.nix
new file mode 100644 (file)
index 0000000..9e79dee
--- /dev/null
@@ -0,0 +1,33 @@
+{ python36Packages }:
+with python36Packages;
+buildPythonApplication rec {
+  pname = "terminal-velocity-git";
+  version = "0.2.0";
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "13yrkcmvh5h5fwnai61sbmqkrjyisz08n62pq0ada2lyyqf7g6b9";
+  };
+
+  patches = [
+    ./sort_found_notes.patch
+    ./python3_support.patch
+    # FIXME: update this patch when version changes
+    ./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
+    '';
+}
diff --git a/pkgs/tiv/default.nix b/pkgs/tiv/default.nix
new file mode 100644 (file)
index 0000000..c03aabe
--- /dev/null
@@ -0,0 +1,19 @@
+{ buildPerlPackage, fetchurl, perlPackages }:
+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 = with perlPackages; [ PerlMagick ];
+  perlPreHookScript = ./tiv_builder.sh;
+  perlPreHook = ''
+    source $perlPreHookScript
+  '';
+  installPhase = ''
+    install -Dm755 tiv "$out/bin/tiv"
+  '';
+}
similarity index 100%
rename from hooks/tiv_builder.sh
rename to pkgs/tiv/tiv_builder.sh