From 284deb135b4c08bcc4e70e935c91ab1619826092 Mon Sep 17 00:00:00 2001 From: Mark Sagi-Kazar Date: Fri, 27 Oct 2023 20:18:54 +0200 Subject: [PATCH] clear repository from template contents Signed-off-by: Mark Sagi-Kazar --- .github/workflows/build.yml | 76 ++++++++++++++++---------------- README.md | 35 +-------------- default.nix | 4 -- flake.nix | 6 +-- pkgs/example-package/default.nix | 9 ---- 5 files changed, 42 insertions(+), 88 deletions(-) delete mode 100644 pkgs/example-package/default.nix diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d1b4e6..2bf3cee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: # 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: "40 2 * * *" jobs: tests: strategy: @@ -20,7 +20,7 @@ jobs: # The repo name as used in # https://github.com/nix-community/NUR/blob/master/repos.json nurRepo: - - + - dagger # Set this to cache your build results in cachix for faster builds # in CI and for everyone who uses your cache. # @@ -31,45 +31,45 @@ jobs: # CACHIX_AUTH_TOKEN secret in your repository secrets settings in # Github found at # https://github.com//nur-packages/settings/secrets - cachixName: - - + # cachixName: + # - nixPath: - nixpkgs=channel:nixos-unstable - nixpkgs=channel:nixpkgs-unstable - nixpkgs=channel:nixos-23.05 runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install nix - uses: cachix/install-nix-action@v23 - 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 {}).lib.version' - - name: Setup cachix - uses: cachix/cachix-action@v12 - # Don't replace here! - if: ${{ matrix.cachixName != '' }} - with: - name: ${{ matrix.cachixName }} - signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - name: Check evaluation - run: | - nix-env -f . -qa \* --meta --xml \ - --allowed-uris https://static.rust-lang.org \ - --option restrict-eval true \ - --option allow-import-from-derivation true \ - --drv-path --show-trace \ - -I nixpkgs=$(nix-instantiate --find-file nixpkgs) \ - -I $PWD - - name: Build nix packages - run: nix shell -f '' nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs - - name: Trigger NUR update - # Don't replace here! - if: ${{ matrix.nurRepo != '' }} - run: curl -XPOST "https://nur-update.nix-community.org/update?repo=${{ matrix.nurRepo }}" + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install nix + uses: cachix/install-nix-action@v23 + 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 {}).lib.version' + # - name: Setup cachix + # uses: cachix/cachix-action@v12 + # # Don't replace here! + # if: ${{ matrix.cachixName != '' }} + # with: + # name: ${{ matrix.cachixName }} + # signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" + # authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" + - name: Check evaluation + run: | + nix-env -f . -qa \* --meta --xml \ + --allowed-uris https://static.rust-lang.org \ + --option restrict-eval true \ + --option allow-import-from-derivation true \ + --drv-path --show-trace \ + -I nixpkgs=$(nix-instantiate --find-file nixpkgs) \ + -I $PWD + - name: Build nix packages + run: nix shell -f '' nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs + - name: Trigger NUR update + # Don't replace here! + if: ${{ matrix.nurRepo != '' }} + run: curl -XPOST "https://nur-update.nix-community.org/update?repo=${{ matrix.nurRepo }}" diff --git a/README.md b/README.md index 077cfbc..c23e746 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,6 @@ -# nur-packages-template - -**A template for [NUR](https://github.com/nix-community/NUR) repositories** - -## 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** +**Dagger [NUR](https://github.com/nix-community/NUR) repository** -![Build and populate cache](https://github.com//nur-packages/workflows/Build%20and%20populate%20cache/badge.svg) - - -[![Cachix Cache](https://img.shields.io/badge/cachix--blue.svg)](https://.cachix.org) - +![Build and populate cache](https://github.com/dagger/nix/workflows/Build%20and%20populate%20cache/badge.svg) diff --git a/default.nix b/default.nix index d6497c9..4b081e6 100644 --- a/default.nix +++ b/default.nix @@ -13,8 +13,4 @@ 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 { }; - # ... } diff --git a/flake.nix b/flake.nix index 81a143f..6ac3788 100644 --- a/flake.nix +++ b/flake.nix @@ -1,15 +1,13 @@ { - description = "My personal NUR repository"; + description = "Dagger 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" + "aarch64-darwin" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); in diff --git a/pkgs/example-package/default.nix b/pkgs/example-package/default.nix deleted file mode 100644 index 41e22df..0000000 --- a/pkgs/example-package/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ stdenv }: - -stdenv.mkDerivation rec { - name = "example-package-${version}"; - version = "1.0"; - src = ./.; - buildPhase = "echo echo Hello World > example"; - installPhase = "install -Dm755 example $out"; -}