nur: init
parent
fa063c8b9e
commit
64ec2ed17b
@ -1,5 +1,7 @@
|
|||||||
# nix-wow
|
# `nix-wow` NUR
|
||||||
|
|
||||||
This is a World of Warcraft related repository for NixOS consumption, i.e. run the game, run a TC server, etc.
|
**This is a World of Warcraft related [NUR](https://github.com/nix-community/NUR) for NixOS consumption, i.e. run the game, run a TC server, etc.**
|
||||||
|
|
||||||
Please do not link this page unless authorized to.
|
**Please do not link this page unless authorized to.**
|
||||||
|
|
||||||
|
[![Cachix Cache](https://img.shields.io/badge/cachix-nix-wow-blue.svg)](https://nix-wow.cachix.org)
|
||||||
|
@ -0,0 +1,53 @@
|
|||||||
|
# This file provides all the buildable and cacheable packages and
|
||||||
|
# package outputs in your package set. These are what gets built by CI,
|
||||||
|
# so if you correctly mark packages as
|
||||||
|
#
|
||||||
|
# - broken (using `meta.broken`),
|
||||||
|
# - unfree (using `meta.license.free`), and
|
||||||
|
# - locally built (using `preferLocalBuild`)
|
||||||
|
#
|
||||||
|
# then your CI will be able to build and cache only those packages for
|
||||||
|
# which this is possible.
|
||||||
|
|
||||||
|
{ pkgs ? import <nixpkgs> { } }:
|
||||||
|
|
||||||
|
with builtins;
|
||||||
|
let
|
||||||
|
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;
|
||||||
|
isCacheable = p: !(p.preferLocalBuild or false);
|
||||||
|
shouldRecurseForDerivations = p: isAttrs p && p.recurseForDerivations or false;
|
||||||
|
|
||||||
|
nameValuePair = n: v: { name = n; value = v; };
|
||||||
|
|
||||||
|
concatMap = builtins.concatMap or (f: xs: concatLists (map f xs));
|
||||||
|
|
||||||
|
flattenPkgs = s:
|
||||||
|
let
|
||||||
|
f = p:
|
||||||
|
if shouldRecurseForDerivations p then flattenPkgs p
|
||||||
|
else if isDerivation p then [ p ]
|
||||||
|
else [ ];
|
||||||
|
in
|
||||||
|
concatMap f (attrValues s);
|
||||||
|
|
||||||
|
outputsOf = p: map (o: p.${o}) p.outputs;
|
||||||
|
|
||||||
|
nurAttrs = import ./default.nix { inherit pkgs; };
|
||||||
|
|
||||||
|
nurPkgs =
|
||||||
|
flattenPkgs
|
||||||
|
(listToAttrs
|
||||||
|
(map (n: nameValuePair n nurAttrs.${n})
|
||||||
|
(filter (n: !isReserved n)
|
||||||
|
(attrNames nurAttrs))));
|
||||||
|
|
||||||
|
in
|
||||||
|
rec {
|
||||||
|
buildPkgs = filter isBuildable nurPkgs;
|
||||||
|
cachePkgs = filter isCacheable buildPkgs;
|
||||||
|
|
||||||
|
buildOutputs = concatMap outputsOf buildPkgs;
|
||||||
|
cacheOutputs = concatMap outputsOf cachePkgs;
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
# 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 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
|
||||||
|
|
||||||
|
{ pkgs ? import <nixpkgs> { } }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# 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 { };
|
||||||
|
# ...
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1624561540,
|
||||||
|
"narHash": "sha256-izJ2PYZMGMsSkg+e7c9A1x3t/yOLT+qzUM6WQsc2tqo=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "c6a049a3d32293b24c0f894a840872cf67fd7c11",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
description = "My personal NUR repository";
|
||||||
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
outputs = { self, nixpkgs }:
|
||||||
|
let
|
||||||
|
systems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"i686-linux"
|
||||||
|
"x86_64-darwin"
|
||||||
|
"aarch64-linux"
|
||||||
|
"armv6l-linux"
|
||||||
|
"armv7l-linux"
|
||||||
|
];
|
||||||
|
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
legacyPackages = forAllSystems (system: import ./default.nix {
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
});
|
||||||
|
packages = forAllSystems (system: nixpkgs.lib.filterAttrs (_: v: nixpkgs.lib.isDerivation v) self.legacyPackages.${system});
|
||||||
|
};
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
with pkgs.lib; {
|
||||||
|
# Add your library functions here
|
||||||
|
#
|
||||||
|
# hexint = x: hexvals.${toLower x};
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
# Add your NixOS modules here
|
||||||
|
#
|
||||||
|
# my-module = ./my-module;
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
# You can use this file as a nixpkgs overlay. This is useful in the
|
||||||
|
# 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
|
||||||
|
builtins.listToAttrs
|
||||||
|
(map (n: nameValuePair n nurAttrs.${n})
|
||||||
|
(builtins.filter (n: !isReserved n)
|
||||||
|
(builtins.attrNames nurAttrs)))
|
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
# Add your overlays here
|
||||||
|
#
|
||||||
|
# my-overlay = import ./my-overlay;
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
{ stdenv }:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "example-package-${version}";
|
||||||
|
version = "1.0";
|
||||||
|
src = ./.;
|
||||||
|
buildPhase = "echo echo Hello World > example";
|
||||||
|
installPhase = "install -Dm755 example $out";
|
||||||
|
}
|
Loading…
Reference in New Issue