1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
diff --git a/default.nix b/default.nix
index ada08251a665ac6c80f062beb1ad3af928a7b9cb..46c40905331bc2233819c960917844bc49828cb1 100644
--- a/default.nix
+++ b/default.nix
@@ -1,19 +1,21 @@
# This file describes your repository contents.
-# It should return a set of nix derivations.
-# It should NOT import <nixpkgs>. Instead, you should take all dependencies as
-# arguments.
+# It should return a set of nix derivations
+# and optionally the special attributes `lib`, `modules` and `overlays`.
+# It should NOT import <nixpkgs>. Instead, you should take pkgs as an argument.
+# Having pkgs default to <nixpkgs> is fine though, and it lets you use short
+# commands such as:
+# nix-build -A mypackage
-{ callPackage
-, libsForQt5
-, haskellPackages
-, pythonPackages
-# , ...
-# Add here other callPackage/callApplication/... providers as the need arises
-, ... }:
+{ pkgs ? import <nixpkgs> {} }:
{
- example-package = callPackage ./pkgs/example-package { };
- # some-qt5-package = libsForQt5.callPackage ./pkgs/some-qt5-package { };
+ # The `lib`, `modules`, and `overlay` names are special
+ lib = import ./lib { inherit pkgs; }; # functions
+ modules = import ./modules; # NixOS modules
+ overlays = import ./overlays; # nixpkgs overlays
+
+ example-package = pkgs.callPackage ./pkgs/example-package { };
+ # some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { };
# ...
}
|