-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1060 from nix-community/dave
convenience features: mixin modules + pkgs arg
- Loading branch information
Showing
23 changed files
with
682 additions
and
396 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
lib, | ||
dream2nix, | ||
config, | ||
packageSets, | ||
... | ||
}: let | ||
cfg = config.haskell-cabal; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
lib, | ||
dream2nix, | ||
config, | ||
packageSets, | ||
... | ||
}: let | ||
l = lib // builtins; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: "buildPythonPackage" | ||
state: "internal" | ||
maintainers: | ||
- DavHau | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
config, | ||
dream2nix, | ||
lib, | ||
... | ||
}: let | ||
l = lib // builtins; | ||
|
||
buildPythonPackageOptions = import ../buildPythonPackage/options.nix {inherit config lib;}; | ||
|
||
keepArg = key: val: buildPythonPackageOptions ? ${key}; | ||
in { | ||
imports = [ | ||
./interface.nix | ||
dream2nix.modules.dream2nix.mkDerivation-mixin | ||
dream2nix.modules.dream2nix.deps | ||
]; | ||
config = { | ||
package-func.func = config.deps.python.pkgs.buildPythonPackage; | ||
package-func.args = lib.filterAttrs keepArg config; | ||
|
||
deps = {nixpkgs, ...}: { | ||
python = l.mkOptionDefault nixpkgs.python3; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
config, | ||
lib, | ||
... | ||
}: let | ||
l = lib // builtins; | ||
t = l.types; | ||
|
||
buildPythonPackageOptions = import ../buildPythonPackage/options.nix {inherit config lib;}; | ||
in { | ||
options = | ||
buildPythonPackageOptions | ||
// { | ||
deps.python = l.mkOption { | ||
type = t.package; | ||
description = "The python interpreter package to use"; | ||
}; | ||
}; | ||
|
||
config = { | ||
format = lib.mkOptionDefault ( | ||
if config.pyproject == null | ||
then "setuptools" | ||
else null | ||
); | ||
}; | ||
} |
16 changes: 16 additions & 0 deletions
16
modules/dream2nix/buildPythonPackage-mixin/tests/packages/basic/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
config, | ||
lib, | ||
dream2nix, | ||
... | ||
}: { | ||
imports = [ | ||
dream2nix.modules.dream2nix.buildPythonPackage-mixin | ||
dream2nix.modules.dream2nix.core | ||
]; | ||
name = "test"; | ||
version = "1.0.0"; | ||
phases = ["buildPhase"]; | ||
buildPhase = "echo -n hello > $out && cp $out $dist"; | ||
format = "setuptools"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.