~andir/nixpkgs-dev

Patches for default.nix v1 PROPOSED

Matthias Beyer: 4
 Add gitignore
 fixup! Rewrite to fallback to unstable nixpkgs if required
 Rewrite to fallback to unstable nixpkgs if required
 Fix: Ignore gitignored files in src attribute

 4 files changed, 35 insertions(+), 22 deletions(-)
thx, pushed

To git://git.jb55.com/nixpkgs-ml-tools
   fdc1835..1cb9e68  master -> master
Matthias Beyer <mail@beyermatthias.de> writes:
Next
thanks!

pushed to git://jb55.com/nixpkgs-ml-tools
   24cd0c7..f8b4125  master -> master
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~andir/nixpkgs-dev/patches/20151/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH v1 1/3] Add gitignore Export this patch

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 .gitignore

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b2be92b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
result
-- 
2.29.2
thx, pushed

To git://git.jb55.com/nixpkgs-ml-tools
   fdc1835..1cb9e68  master -> master

[PATCH nixpkgs-ml-tools] fixup! Rewrite to fallback to unstable nixpkgs if required Export this patch

---
 default.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/default.nix b/default.nix
index 8214f9a..a2409ca 100644
--- a/default.nix
+++ b/default.nix
@@ -14,7 +14,7 @@ let

  paths = lib.makeBinPath (with pkgs; [ b4 notmuch ]);

  drv = { lib, stdenv, b4, notmuch, makeWrapper }:
  drv = { stdenv, b4, notmuch, makeWrapper }:
    stdenv.mkDerivation {
      name = "nixpkgs-ml-tools";
      version = "0.1";
-- 
2.29.2

[PATCH v1 2/3] Rewrite to fallback to unstable nixpkgs if required Export this patch

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
---
 default.nix | 52 ++++++++++++++++++++++++++++++++--------------------
 1 file changed, 32 insertions(+), 20 deletions(-)

diff --git a/default.nix b/default.nix
index 6b4d0cc..1f85fe4 100644
--- a/default.nix
+++ b/default.nix
@@ -1,28 +1,40 @@
{ pkgs ? import <nixpkgs> {} }:

let drv =
let
  lib = pkgs.lib;
  unstable = import
    # unstable nixpkgs on 2021-02-09
    (builtins.fetchTarball "https://github.com/nixos/nixpkgs/archive/d9c6f13e13f8cfe9adcb9dc5f7191336d0d8e8a7.tar.gz")
    { config = pkgs.config; };

{ lib, stdenv, b4, notmuch, makeWrapper }:
let paths = lib.makeBinPath [ b4 notmuch ];
in
stdenv.mkDerivation {
  name = "nixpkgs-ml-tools";
  version = "0.1";
  b4 = if (lib.elem "b4" (lib.attrNames pkgs)) then
    pkgs.b4
  else
    unstable.b4;

  src = ./.;
  paths = lib.makeBinPath (with pkgs; [ b4 notmuch ]);

  nativeBuildInputs = [ makeWrapper ];
  drv = { lib, stdenv, b4, notmuch, makeWrapper }:
    stdenv.mkDerivation {
      name = "nixpkgs-ml-tools";
      version = "0.1";

  makeFlags = [ "PREFIX=$(out)" ];
      src = ./.;

  postInstall = ''
    bins="$(find $out/bin -type f -executable -print)"
    for bin in $bins
    do
      patchShebangs "$bin"
      wrapProgram "$bin" --prefix PATH : "${paths}"
    done
  '';
};
      nativeBuildInputs = [ makeWrapper ];

in pkgs.callPackage drv {}
      makeFlags = [ "PREFIX=$(out)" ];

      postInstall = ''
        bins="$(find $out/bin -type f -executable -print)"
        for bin in $bins
        do
          patchShebangs "$bin"
          wrapProgram "$bin" --prefix PATH : "${paths}"
        done
      '';
    };

in pkgs.callPackage drv {
  inherit (pkgs) b4 notmuch;
}
-- 
2.29.2
Matthias Beyer <mail@beyermatthias.de> writes:

[PATCH v1 3/3] Fix: Ignore gitignored files in src attribute Export this patch

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
---
 default.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/default.nix b/default.nix
index 1f85fe4..8214f9a 100644
--- a/default.nix
+++ b/default.nix
@@ -19,7 +19,7 @@ let
      name = "nixpkgs-ml-tools";
      version = "0.1";

      src = ./.;
      src = pkgs.nix-gitignore.gitignoreSource [] ./.;

      nativeBuildInputs = [ makeWrapper ];

-- 
2.29.2
thanks!

pushed to git://jb55.com/nixpkgs-ml-tools
   24cd0c7..f8b4125  master -> master