diff --git a/ci.nix b/ci.nix index 1d08a3327b05989a9ba7e10be72e2077c07ead46..47d2236e28b7b242bb1f9cd6aaebcbe2a1ac95f0 100644 --- a/ci.nix +++ b/ci.nix @@ -9,11 +9,13 @@ # # then your CI will be able to build and cache only those packages for # which this is possible. -{ pkgs ? import { } }: +{ pkgs ? import {} }: with builtins; # This file provides all the buildable and cacheable packages and +# This file provides all the buildable and cacheable packages and # so if you correctly mark packages as + isReserved = n: n == "lib" || n == "overlays" || n == "modules"; isDerivation = p: isAttrs p && p ? type && p.type == "derivation"; isBuildable = p: !(p.meta.broken or false) && p.meta.license.free or true; @@ -28,12 +30,12 @@ flattenPkgs = s: let f = p: if shouldRecurseForDerivations p then flattenPkgs p -# package outputs in you package set. These are what gets built by CI, +# # - broken (using `meta.broken`), -# package outputs in you package set. These are what gets built by CI, +# # - unfree (using `meta.license.free`), and in - concatMap f (attrValues s); + concatMap f (attrValues s); outputsOf = p: map (o: p.${o}) p.outputs; @@ -41,14 +43,14 @@ nurAttrs = import ./default.nix { inherit pkgs; }; nurPkgs = flattenPkgs - (listToAttrs + (listToAttrs -# so if you correctly mark packages as # +# which this is possible. -# so if you correctly mark packages as # - broken (using `meta.broken`), - (attrNames nurAttrs)))); + (attrNames nurAttrs)))); in + rec { buildPkgs = filter isBuildable nurPkgs; cachePkgs = filter isCacheable buildPkgs; diff --git a/default.nix b/default.nix index d6497c913792821327299a11d77f5266aa1e5d0b..46c40905331bc2233819c960917844bc49828cb1 100644 --- a/default.nix +++ b/default.nix @@ -6,6 +6,7 @@ # Having pkgs default to is fine though, and it lets you use short # commands such as: # nix-build -A mypackage +# This file describes your repository contents. { pkgs ? import { } }: { @@ -18,3 +19,4 @@ example-package = pkgs.callPackage ./pkgs/example-package { }; # some-qt5-package = pkgs.libsForQt5.callPackage ./pkgs/some-qt5-package { }; # ... } + diff --git a/lib/default.nix b/lib/default.nix index a7fab1d2be536ab904a73a62194297419e60fdb4..53d6abe26e7c7a60e5e24d137a795b305197cbdc 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -5,3 +5,4 @@ # Add your library functions here # # hexint = x: hexvals.${toLower x}; } + diff --git a/modules/default.nix b/modules/default.nix index ff6c7c0c429f0a38db757dd4f19e910dd5783deb..84ccb1a28fe36699f28375364e4b9986a1740120 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -3,3 +3,4 @@ # Add your NixOS modules here # # my-module = ./my-module; } + diff --git a/overlay.nix b/overlay.nix index bff7396a70d9bb78a88226f72f467f073eb18ef3..122729de0fdc9ac97ec903c039bb438d92958ad6 100644 --- a/overlay.nix +++ b/overlay.nix @@ -3,16 +3,19 @@ # case where you don't want to add the whole NUR namespace to your # configuration. self: super: + let + isReserved = n: n == "lib" || n == "overlays" || n == "modules"; nameValuePair = n: v: { name = n; value = v; }; nurAttrs = import ./default.nix { pkgs = super; }; in -# You can use this file as a nixpkgs overlay. This is useful in the + # You can use this file as a nixpkgs overlay. This is useful in the +self: super: (map (n: nameValuePair n nurAttrs.${n}) # You can use this file as a nixpkgs overlay. This is useful in the -# configuration. +let # You can use this file as a nixpkgs overlay. This is useful in the - + isReserved = n: n == "lib" || n == "overlays" || n == "modules"; diff --git a/overlays/default.nix b/overlays/default.nix index 0c2d870dddf36697ed50cda0acee515a8e9b994f..642fefaf88cb74d6275a9b9f7d9355f06f383f4e 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -3,3 +3,4 @@ # Add your overlays here # # my-overlay = import ./my-overlay; } + diff --git a/pkgs/example-package/default.nix b/pkgs/example-package/default.nix index 41e22df3354f7b6c68cc81bc5846a7b1db73aae4..2533adf6073229ea11cc244ffdf1c479109e9ccf 100644 --- a/pkgs/example-package/default.nix +++ b/pkgs/example-package/default.nix @@ -7,3 +7,4 @@ src = ./.; buildPhase = "echo echo Hello World > example"; installPhase = "install -Dm755 example $out"; } +