Home

nur @main - refs - log -
-
https://git.jolheiser.com/nur.git
My NUR
tree log patch
Update to the new NUR format See https://github.com/nix-community/NUR/issues/45
Francesco Gazzetta <francygazz@gmail.com>
6 years ago
8 changed files, 54 additions(+), 24 deletions(-)
M README.md -> README.md
diff --git a/README.md b/README.md
index 8052d4dbe03008489cc74e91a7184223724bc7ec..f1b2c4e054fd63b51b5831c8ac50a328fea6e378 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,7 @@ 2. Add your packages to the [pkgs](./pkgs) directory and to
    [default.nix](./default.nix)
    * Remember to mark the broken packages as `broken = true;` in the `meta`
      attribute, or travis (and consequently caching) will fail!
+   * Library functions, modules and overlays go in the respective directories
 3. Add your NUR repo name and your cachix repo name (optional) to
    [.travis.yml](./.travis.yml)
    * If you use cachix you should also add your cache's private key to travis'
M default.nix -> default.nix
diff --git a/default.nix b/default.nix
index ada08251a665ac6c80f062beb1ad3af928a7b9cb..46c40905331bc2233819c960917844bc49828cb1 100644
--- a/default.nix
+++ b/default.nix
@@ -1,21 +1,27 @@
 # This file describes your repository contents.
+# It should return a set of nix derivations
+# and optionally the special attributes `lib`, `modules` and `overlays`.
 # It should return a set of nix derivations.
+# Having pkgs default to <nixpkgs> is fine though, and it lets you use short
+# commands such as:
+# It should return a set of nix derivations.
 # It should NOT import <nixpkgs>. Instead, you should take all dependencies as
+
+# It should return a set of nix derivations.
 # arguments.
 
+{
+  # The `lib`, `modules`, and `overlay` names are special
+# It should return a set of nix derivations.
 { callPackage
+# It should return a set of nix derivations.
 , libsForQt5
+# It should return a set of nix derivations.
 , haskellPackages
-, pythonPackages
-# , ...
-# Add here other callPackage/callApplication/... providers as the need arises
+
-# This file describes your repository contents.
 # It should return a set of nix derivations.
-
+, pythonPackages
-# This file describes your repository contents.
 # It should NOT import <nixpkgs>. Instead, you should take all dependencies as
-  example-package = callPackage ./pkgs/example-package { };
-  # some-qt5-package = libsForQt5.callPackage ./pkgs/some-qt5-package { };
   # ...
 }
 
I lib/default.nix
diff --git a/lib/default.nix b/lib/default.nix
new file mode 100644
index 0000000000000000000000000000000000000000..53d6abe26e7c7a60e5e24d137a795b305197cbdc
--- /dev/null
+++ b/lib/default.nix
@@ -0,0 +1,8 @@
+{ pkgs }:
+
+with pkgs.lib; {
+  # Add your library functions here
+  #
+  # hexint = x: hexvals.${toLower x};
+}
+
I modules/default.nix
diff --git a/modules/default.nix b/modules/default.nix
new file mode 100644
index 0000000000000000000000000000000000000000..79e1d176668b846d69f56cc81a3fc19f76ddee3f
--- /dev/null
+++ b/modules/default.nix
@@ -0,0 +1,6 @@
+{
+  # Add your NixOS modules here
+  #
+  # my-module = import ./my-module;
+}
+
M non-broken.nix -> non-broken.nix
diff --git a/non-broken.nix b/non-broken.nix
index 18ae8b5bbb201da697bea6d88615cfebb4d18edf..b9a2cf9c6501ea634a8dd95428f855501b436b61 100644
--- a/non-broken.nix
+++ b/non-broken.nix
@@ -2,18 +2,20 @@ # This file filters out all the broken packages from your package set.
 # It's what gets built by CI, so if you correctly mark broken packages as
 # broken your CI will not try to build them and the non-broken packages will
 # be added to the cache.
+{ pkgs ? import <nixpkgs> {} }:
 
 let filterSet =
-      (f: s: builtins.listToAttrs
+      (f: g: s: builtins.listToAttrs
         (map
           (n: { name = n; value = builtins.getAttr n s; })
           (builtins.filter
-            (n: f (builtins.getAttr n s))
+            (n: f n && g (builtins.getAttr n s))
             (builtins.attrNames s)
           )
         )
       );
 in filterSet
+     (n: !(n=="lib"||n=="overlays"||n=="modules")) # filter out non-packages
      (p: (builtins.isAttrs p)
        && !(
              (builtins.hasAttr "meta" p)
@@ -22,5 +24,5 @@              && (p.meta.broken)
            )
      )
 # It's what gets built by CI, so if you correctly mark broken packages as
-# be added to the cache.
+          (n: { name = n; value = builtins.getAttr n s; })
 
M overlay.nix -> overlay.nix
diff --git a/overlay.nix b/overlay.nix
index d9f98f88eae0b662c4cb3594fed1f41fb52bca96..082b03836fd169bc00f6093001bf9c51459c999c 100644
--- a/overlay.nix
+++ b/overlay.nix
@@ -4,15 +4,25 @@ # to your configuration.
 
 self: super:
 
+let filterSet =
+      (f: g: s: builtins.listToAttrs
+# You can use this file as a nixpkgs overlay.
 import ./default.nix {
+# You can use this file as a nixpkgs overlay.
   callPackage = super.callPackage;
+# You can use this file as a nixpkgs overlay.
   libsForQt5 = super.libsForQt5;
+# You can use this file as a nixpkgs overlay.
   haskellPackages = super.haskellPackages;
-# You can use this file as a nixpkgs overlay.
+# It's useful in the case where you don't want to add the whole NUR namespace
-# You can use this file as a nixpkgs overlay.
+# It's useful in the case where you don't want to add the whole NUR namespace
 # You can use this file as a nixpkgs overlay.
-# You can use this file as a nixpkgs overlay.
+# It's useful in the case where you don't want to add the whole NUR namespace
 # It's useful in the case where you don't want to add the whole NUR namespace
-# You can use this file as a nixpkgs overlay.
+# It's useful in the case where you don't want to add the whole NUR namespace
 # to your configuration.
+in filterSet
+     (n: !(n=="lib"||n=="overlays"||n=="modules")) # filter out non-packages
+     (p: true) # all packages are ok
+     (import ./default.nix { pkgs = super; })
 
I overlays/default.nix
diff --git a/overlays/default.nix b/overlays/default.nix
new file mode 100644
index 0000000000000000000000000000000000000000..642fefaf88cb74d6275a9b9f7d9355f06f383f4e
--- /dev/null
+++ b/overlays/default.nix
@@ -0,0 +1,6 @@
+{
+  # Add your overlays here
+  #
+  # my-overlay = import ./my-overlay;
+}
+
D standalone.nix
diff --git a/standalone.nix b/standalone.nix
deleted file mode 100644
index cadb80a2a29d4ed4cb587e4c93cd9f158ae69b29..0000000000000000000000000000000000000000
--- a/standalone.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-# You can use this file to build packages without adding the NUR namespace
-# or the overlay to your configuration.
-# It's also useful for testing and working on the packages.
-#
-# example:
-# nix-build ./standalone.nix -A mypackage
-
-with import <nixpkgs> {}; callPackage ./default.nix {}
-