Initial commit
Extracted the skeleton from https://github.com/fgaz/nur-packages.git
This commit is contained in:
		
						commit
						dd95bed0d8
					
				
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
result
 | 
			
		||||
result-*
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										23
									
								
								.travis.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								.travis.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,23 @@
 | 
			
		||||
language: nix
 | 
			
		||||
 | 
			
		||||
sudo: false
 | 
			
		||||
 | 
			
		||||
env:
 | 
			
		||||
  global:
 | 
			
		||||
    - CACHIX_CACHE=
 | 
			
		||||
    - NUR_REPO=<YOUR_NUR_REPO_NAME_HERE>
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
 - nix --version
 | 
			
		||||
 - travis_retry nix-channel --update
 | 
			
		||||
 - if [ -n "${CACHIX_CACHE}" ]; then nix-env -if https://github.com/cachix/cachix/tarball/master --substituters https://cachix.cachix.org --trusted-public-keys cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM=; fi
 | 
			
		||||
 - if [ -n "${CACHIX_CACHE}" ]; then cachix use "${CACHIX_CACHE}"; fi
 | 
			
		||||
 | 
			
		||||
script:
 | 
			
		||||
 - export outs=$(nix-build non-broken.nix)
 | 
			
		||||
 - echo Produced $outs
 | 
			
		||||
 | 
			
		||||
after_success:
 | 
			
		||||
  - if [ -n "${CACHIX_CACHE}" ]; then cachix push "${CACHIX_CACHE}" $outs; fi
 | 
			
		||||
  - curl -XPOST "https://nur-update.herokuapp.com/update?repo=${NUR_REPO}"
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										22
									
								
								LICENSE
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								LICENSE
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,22 @@
 | 
			
		||||
MIT License
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2018 Francesco Gazzetta
 | 
			
		||||
 | 
			
		||||
Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
in the Software without restriction, including without limitation the rights
 | 
			
		||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
			
		||||
copies of the Software, and to permit persons to whom the Software is
 | 
			
		||||
furnished to do so, subject to the following conditions:
 | 
			
		||||
 | 
			
		||||
The above copyright notice and this permission notice shall be included in all
 | 
			
		||||
copies or substantial portions of the Software.
 | 
			
		||||
 | 
			
		||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
			
		||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 | 
			
		||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
			
		||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
			
		||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 | 
			
		||||
SOFTWARE.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										28
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,28 @@
 | 
			
		||||
# nur-packages-template
 | 
			
		||||
 | 
			
		||||
**A template for [NUR](https://github.com/nix-community/NUR) repositories**
 | 
			
		||||
 | 
			
		||||
## Setup
 | 
			
		||||
 | 
			
		||||
1. Fork this repo
 | 
			
		||||
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!
 | 
			
		||||
3. Add your NUR repo name and your cachix repo name (optional) to
 | 
			
		||||
   [.travis.yml](./.travis.yml)
 | 
			
		||||
4. Enable travis for your repo
 | 
			
		||||
5. Change your travis and cachix names on the README template section and delete
 | 
			
		||||
   the rest
 | 
			
		||||
6. [Add yourself to NUR](https://github.com/nix-community/NUR#how-to-add-your-own-repository)
 | 
			
		||||
 | 
			
		||||
## README template
 | 
			
		||||
 | 
			
		||||
# nur-packages
 | 
			
		||||
 | 
			
		||||
**My personal [NUR](https://github.com/nix-community/NUR) repository**
 | 
			
		||||
 | 
			
		||||
[](https://travis-ci.com/<YOUR_TRAVIS_USERNAME>/nur-packages)
 | 
			
		||||
[](https://<YOUR_CACHIX_USERNAME>.cachix.org)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										19
									
								
								default.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								default.nix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,19 @@
 | 
			
		||||
# 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.
 | 
			
		||||
 | 
			
		||||
{ callPackage
 | 
			
		||||
, libsForQt5
 | 
			
		||||
, haskellPackages
 | 
			
		||||
, pythonPackages
 | 
			
		||||
# , ...
 | 
			
		||||
# Add here other callPackage/callApplication/... providers as the need arises
 | 
			
		||||
, ... }:
 | 
			
		||||
 | 
			
		||||
{
 | 
			
		||||
  example-package = callPackage ./pkgs/example-package { };
 | 
			
		||||
  # some-qt5-package = libsForQt5.callPackage ./pkgs/some-qt5-package { };
 | 
			
		||||
  # ...
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										25
									
								
								non-broken.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								non-broken.nix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,25 @@
 | 
			
		||||
# 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.
 | 
			
		||||
 | 
			
		||||
let filterSet =
 | 
			
		||||
      (f: s: builtins.listToAttrs
 | 
			
		||||
        (map
 | 
			
		||||
          (n: { name = n; value = builtins.getAttr n s; })
 | 
			
		||||
          (builtins.filter
 | 
			
		||||
            (n: f (builtins.getAttr n s))
 | 
			
		||||
            (builtins.attrNames s)
 | 
			
		||||
          )
 | 
			
		||||
        )
 | 
			
		||||
      );
 | 
			
		||||
in filterSet
 | 
			
		||||
     (p: (builtins.isAttrs p)
 | 
			
		||||
       && !(
 | 
			
		||||
             (builtins.hasAttr "meta" p)
 | 
			
		||||
             && (builtins.hasAttr "broken" p.meta)
 | 
			
		||||
             && (p.meta.broken)
 | 
			
		||||
           )
 | 
			
		||||
     )
 | 
			
		||||
     (import ./standalone.nix)
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										15
									
								
								overlay.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								overlay.nix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,15 @@
 | 
			
		||||
# 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.
 | 
			
		||||
 | 
			
		||||
self: super:
 | 
			
		||||
 | 
			
		||||
import ./default.nix {
 | 
			
		||||
  callPackage = super.callPackage;
 | 
			
		||||
  libsForQt5 = super.libsForQt5;
 | 
			
		||||
  haskellPackages = super.haskellPackages;
 | 
			
		||||
  pythonPackages = super.pythonPackages;
 | 
			
		||||
  # ...
 | 
			
		||||
  # Add here other callPackage/callApplication/... providers as the need arises
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										9
									
								
								pkgs/example-package/default.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								pkgs/example-package/default.nix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,9 @@
 | 
			
		||||
{ stdenv }:
 | 
			
		||||
 | 
			
		||||
stdenv.mkDerivation rec {
 | 
			
		||||
  name = "example-package-${version}";
 | 
			
		||||
  version = "1.0";
 | 
			
		||||
  buildPhase = "echo echo Hello World > example";
 | 
			
		||||
  installPhase = "install -Dm755 example $out";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										9
									
								
								standalone.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								standalone.nix
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,9 @@
 | 
			
		||||
# 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 {}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user