Skip to content

Commit

Permalink
Chore(nur): update readme, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
till committed Jan 17, 2024
1 parent 550bb9f commit b83f3d2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 96 deletions.
38 changes: 11 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,40 @@
name: "Build and populate cache"

on:
pull_request:
push:
branches:
- main
- master
schedule:
# rebuild everyday at 2:51
# TIP: Choose a random time here so not all repositories are build at once:
# https://www.random.org/clock-times/?num=1&earliest=01%3A00&latest=08%3A00&interval=5&format=html&rnd=new
- cron: '51 2 * * *'
- cron: '51 4 * * *'

jobs:
tests:
strategy:
matrix:
# Set this to notify the global nur package registry that changes are
# available.
#
# The repo name as used in
# https://github.com/nix-community/NUR/blob/master/repos.json
# FIXME(till): update when it works
nurRepo:
- <YOUR_REPO_NAME>
# Set this to cache your build results in cachix for faster builds
# in CI and for everyone who uses your cache.
#
# Format: Your cachix cache host name without the ".cachix.org" suffix.
# Example: mycache (for mycache.cachix.org)
#
# For this to work, you also need to set the CACHIX_SIGNING_KEY or
# CACHIX_AUTH_TOKEN secret in your repository secrets settings in
# Github found at
# https://github.com/<your_githubname>/nur-packages/settings/secrets
cachixName:
- <YOUR_CACHIX_NAME>
nixPath:
- nixpkgs=channel:nixos-unstable
- nixpkgs=channel:nixpkgs-unstable
- nixpkgs=channel:nixos-23.05
runs-on: ubuntu-latest
env:
NIXPKGS_ALLOW_UNFREE: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install nix
uses: cachix/install-nix-action@v25
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
with:
nix_path: "${{ matrix.nixPath }}"
extra_nix_config: |
experimental-features = nix-command flakes
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- name: Show nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- name: Setup cachix
uses: cachix/cachix-action@v14
- uses: cachix/cachix-action@v14
# Don't replace <YOUR_CACHIX_NAME> here!
if: ${{ matrix.cachixName != '<YOUR_CACHIX_NAME>' }}
with:
Expand All @@ -65,10 +48,11 @@ jobs:
--option restrict-eval true \
--option allow-import-from-derivation true \
--drv-path --show-trace \
--impure \
-I nixpkgs=$(nix-instantiate --find-file nixpkgs) \
-I $PWD
- name: Build nix packages
run: nix shell -f '<nixpkgs>' nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs
run: nix shell --impure -f '<nixpkgs>' nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs
- name: Trigger NUR update
# Don't replace <YOUR_REPO_NAME> here!
if: ${{ matrix.nurRepo != '<YOUR_REPO_NAME>' }}
Expand Down
22 changes: 0 additions & 22 deletions LICENSE

This file was deleted.

38 changes: 4 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,7 @@
# nur-packages-template
# hostwithquantum/nur

**A template for [NUR](https://github.com/nix-community/NUR) repositories**
![Build and populate cache](https://github.com/hostwithquantum/nur/workflows/Build%20and%20populate%20cache/badge.svg)

## Setup

1. Click on [Use this template](https://github.com/nix-community/nur-packages-template/generate) to start a repo based on this template. (Do _not_ fork it.)
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. Choose your CI: Depending on your preference you can use github actions (recommended) or [Travis ci](https://travis-ci.com).
- Github actions: Change your NUR repo name and optionally add a cachix name in [.github/workflows/build.yml](./.github/workflows/build.yml) and change the cron timer
to a random value as described in the file
- Travis ci: Change your NUR repo name and optionally your cachix repo name in
[.travis.yml](./.travis.yml). Than enable travis in your repo. You can add a cron job in the repository settings on travis to keep your cachix cache fresh
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**

<!-- Remove this if you don't use github actions -->
![Build and populate cache](https://github.com/<YOUR-GITHUB-USER>/nur-packages/workflows/Build%20and%20populate%20cache/badge.svg)

<!--
Uncomment this if you use travis:
[![Build Status](https://travis-ci.com/<YOUR_TRAVIS_USERNAME>/nur-packages.svg?branch=master)](https://travis-ci.com/<YOUR_TRAVIS_USERNAME>/nur-packages)
-->
[![Cachix Cache](https://img.shields.io/badge/cachix-<YOUR_CACHIX_CACHE_NAME>-blue.svg)](https://<YOUR_CACHIX_CACHE_NAME>.cachix.org)
[![Cachix Cache](https://img.shields.io/badge/cachix-hostwithquantun-blue.svg)](https://hostwithquantum.cachix.org)

A nix user repository to install the runway CLI.
4 changes: 1 addition & 3 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@
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 { };
# ...
runway = pkgs.callPackage ./pkgs/runway { };
}
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
description = "My personal NUR repository";
description = "runway for nix";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }:
let
Expand Down
9 changes: 0 additions & 9 deletions pkgs/example-package/default.nix

This file was deleted.

0 comments on commit b83f3d2

Please sign in to comment.