├── .github ├── dependabot.yml └── workflows │ └── build.yml ├── .gitignore ├── LICENSE ├── README.md ├── ci.nix ├── default.nix ├── flake.lock ├── flake.nix ├── lib └── default.nix ├── modules └── default.nix ├── overlay.nix ├── overlays └── default.nix └── pkgs └── dagger ├── default.nix └── update.sh /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: "Build and populate cache" 2 | on: 3 | pull_request: 4 | push: 5 | branches: 6 | - main 7 | - master 8 | schedule: 9 | # rebuild everyday at 2:51 10 | # TIP: Choose a random time here so not all repositories are build at once: 11 | # https://www.random.org/clock-times/?num=1&earliest=01%3A00&latest=08%3A00&interval=5&format=html&rnd=new 12 | - cron: "40 2 * * *" 13 | jobs: 14 | tests: 15 | strategy: 16 | matrix: 17 | # Set this to notify the global nur package registry that changes are 18 | # available. 19 | # 20 | # The repo name as used in 21 | # https://github.com/nix-community/NUR/blob/master/repos.json 22 | nurRepo: 23 | - dagger 24 | # Set this to cache your build results in cachix for faster builds 25 | # in CI and for everyone who uses your cache. 26 | # 27 | # Format: Your cachix cache host name without the ".cachix.org" suffix. 28 | # Example: mycache (for mycache.cachix.org) 29 | # 30 | # For this to work, you also need to set the CACHIX_SIGNING_KEY or 31 | # CACHIX_AUTH_TOKEN secret in your repository secrets settings in 32 | # Github found at 33 | # https://github.com//nur-packages/settings/secrets 34 | # cachixName: 35 | # - 36 | nixPath: 37 | - nixpkgs=channel:nixos-unstable 38 | - nixpkgs=channel:nixpkgs-unstable 39 | - nixpkgs=channel:nixos-23.11 40 | - nixpkgs=channel:nixos-24.05 41 | runs-on: ubuntu-latest 42 | steps: 43 | - name: Checkout repository 44 | uses: actions/checkout@v4 45 | - name: Install nix 46 | uses: cachix/install-nix-action@v30 47 | with: 48 | nix_path: "${{ matrix.nixPath }}" 49 | extra_nix_config: | 50 | experimental-features = nix-command flakes 51 | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} 52 | - name: Show nixpkgs version 53 | run: nix-instantiate --eval -E '(import {}).lib.version' 54 | # - name: Setup cachix 55 | # uses: cachix/cachix-action@v12 56 | # # Don't replace here! 57 | # if: ${{ matrix.cachixName != '' }} 58 | # with: 59 | # name: ${{ matrix.cachixName }} 60 | # signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" 61 | # authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" 62 | - name: Check evaluation 63 | run: | 64 | nix-env -f . -qa \* --meta --xml \ 65 | --allowed-uris https://static.rust-lang.org \ 66 | --option restrict-eval true \ 67 | --option allow-import-from-derivation true \ 68 | --drv-path --show-trace \ 69 | -I nixpkgs=$(nix-instantiate --find-file nixpkgs) \ 70 | -I $PWD 71 | - name: Build nix packages 72 | run: nix shell -f '' nix-build-uncached -c nix-build-uncached ci.nix -A cacheOutputs 73 | - name: Trigger NUR update 74 | # Don't replace here! 75 | if: ${{ matrix.nurRepo != '' }} 76 | run: curl -XPOST "https://nur-update.nix-community.org/update?repo=${{ matrix.nurRepo }}" 77 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | result 2 | result-* 3 | 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Dagger, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nur-packages 2 | 3 | **Dagger [NUR](https://github.com/nix-community/NUR) repository** 4 | 5 | 6 | ![Build and populate cache](https://github.com/dagger/nix/workflows/Build%20and%20populate%20cache/badge.svg) 7 | 8 | This is updated by [GoReleaser 9 | Nixpkgs](https://goreleaser.com/customization/nix/) from within the 10 | [dagger/dagger](https://github.com/dagger/dagger/blob/v0.12.4/.goreleaser.yml#L31-L48) 11 | repository. GoReleaser runs in a `dagger` pipeline - [see the 12 | code](https://github.com/dagger/dagger/blob/v0.12.4/dev/cli.go#L184-L196). The 13 | entire release process - including this Nix flake - is captured in Dagger's 14 | [RELEASING 15 | documentation](https://github.com/dagger/dagger/blob/main/RELEASING.md). If 16 | you have more questions, [you can find us in our `#nix` Discord 17 | channel](https://discord.com/channels/707636530424053791/1122966469425233940) 👋 18 | 19 | ## Usage 20 | 21 | ### As flake 22 | 23 | ```nix 24 | { 25 | inputs = { 26 | nixpkgs.url = "nixpkgs/nixos-unstable"; 27 | flake-utils.url = "github:numtide/flake-utils"; 28 | dagger.url = "github:dagger/nix"; 29 | dagger.inputs.nixpkgs.follows = "nixpkgs"; 30 | }; 31 | 32 | outputs = { self, nixpkgs, flake-utils, dagger, ... }: 33 | flake-utils.lib.eachDefaultSystem (system: 34 | let 35 | pkgs = import nixpkgs {inherit system; }; 36 | in { 37 | devShells.default = pkgs.mkShell { 38 | buildInputs = [ dagger.packages.${system}.dagger ]; 39 | }; 40 | }); 41 | } 42 | ``` 43 | -------------------------------------------------------------------------------- /ci.nix: -------------------------------------------------------------------------------- 1 | # This file provides all the buildable and cacheable packages and 2 | # package outputs in your package set. These are what gets built by CI, 3 | # so if you correctly mark packages as 4 | # 5 | # - broken (using `meta.broken`), 6 | # - unfree (using `meta.license.free`), and 7 | # - locally built (using `preferLocalBuild`) 8 | # 9 | # then your CI will be able to build and cache only those packages for 10 | # which this is possible. 11 | 12 | { pkgs ? import { } }: 13 | 14 | with builtins; 15 | let 16 | isReserved = n: n == "lib" || n == "overlays" || n == "modules"; 17 | isDerivation = p: isAttrs p && p ? type && p.type == "derivation"; 18 | isBuildable = p: !(p.meta.broken or false) && p.meta.license.free or true; 19 | isCacheable = p: !(p.preferLocalBuild or false); 20 | shouldRecurseForDerivations = p: isAttrs p && p.recurseForDerivations or false; 21 | 22 | nameValuePair = n: v: { name = n; value = v; }; 23 | 24 | concatMap = builtins.concatMap or (f: xs: concatLists (map f xs)); 25 | 26 | flattenPkgs = s: 27 | let 28 | f = p: 29 | if shouldRecurseForDerivations p then flattenPkgs p 30 | else if isDerivation p then [ p ] 31 | else [ ]; 32 | in 33 | concatMap f (attrValues s); 34 | 35 | outputsOf = p: map (o: p.${o}) p.outputs; 36 | 37 | nurAttrs = import ./default.nix { inherit pkgs; }; 38 | 39 | nurPkgs = 40 | flattenPkgs 41 | (listToAttrs 42 | (map (n: nameValuePair n nurAttrs.${n}) 43 | (filter (n: !isReserved n) 44 | (attrNames nurAttrs)))); 45 | 46 | in 47 | rec { 48 | buildPkgs = filter isBuildable nurPkgs; 49 | cachePkgs = filter isCacheable buildPkgs; 50 | 51 | buildOutputs = concatMap outputsOf buildPkgs; 52 | cacheOutputs = concatMap outputsOf cachePkgs; 53 | } 54 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | # This file describes your repository contents. 2 | # It should return a set of nix derivations 3 | # and optionally the special attributes `lib`, `modules` and `overlays`. 4 | # It should NOT import . Instead, you should take pkgs as an argument. 5 | # Having pkgs default to is fine though, and it lets you use short 6 | # commands such as: 7 | # nix-build -A mypackage 8 | 9 | { pkgs ? import { } }: 10 | 11 | { 12 | # The `lib`, `modules`, and `overlay` names are special 13 | lib = import ./lib { inherit pkgs; }; # functions 14 | modules = import ./modules; # NixOS modules 15 | overlays = import ./overlays; # nixpkgs overlays 16 | 17 | dagger = pkgs.callPackage ./pkgs/dagger { }; 18 | } 19 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "nixpkgs": { 4 | "locked": { 5 | "lastModified": 1624561540, 6 | "narHash": "sha256-izJ2PYZMGMsSkg+e7c9A1x3t/yOLT+qzUM6WQsc2tqo=", 7 | "owner": "NixOS", 8 | "repo": "nixpkgs", 9 | "rev": "c6a049a3d32293b24c0f894a840872cf67fd7c11", 10 | "type": "github" 11 | }, 12 | "original": { 13 | "owner": "NixOS", 14 | "ref": "nixpkgs-unstable", 15 | "repo": "nixpkgs", 16 | "type": "github" 17 | } 18 | }, 19 | "root": { 20 | "inputs": { 21 | "nixpkgs": "nixpkgs" 22 | } 23 | } 24 | }, 25 | "root": "root", 26 | "version": 7 27 | } 28 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Dagger NUR repository"; 3 | inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; 4 | outputs = { self, nixpkgs }: 5 | let 6 | systems = [ 7 | "x86_64-linux" 8 | "x86_64-darwin" 9 | "aarch64-linux" 10 | "aarch64-darwin" 11 | ]; 12 | forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); 13 | in 14 | { 15 | legacyPackages = forAllSystems (system: import ./default.nix { 16 | pkgs = import nixpkgs { inherit system; }; 17 | }); 18 | packages = forAllSystems (system: nixpkgs.lib.filterAttrs (_: v: nixpkgs.lib.isDerivation v) self.legacyPackages.${system}); 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /lib/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | 3 | with pkgs.lib; { 4 | # Add your library functions here 5 | # 6 | # hexint = x: hexvals.${toLower x}; 7 | } 8 | -------------------------------------------------------------------------------- /modules/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | # Add your NixOS modules here 3 | # 4 | # my-module = ./my-module; 5 | } 6 | -------------------------------------------------------------------------------- /overlay.nix: -------------------------------------------------------------------------------- 1 | # You can use this file as a nixpkgs overlay. This is useful in the 2 | # case where you don't want to add the whole NUR namespace to your 3 | # configuration. 4 | 5 | self: super: 6 | let 7 | isReserved = n: n == "lib" || n == "overlays" || n == "modules"; 8 | nameValuePair = n: v: { name = n; value = v; }; 9 | nurAttrs = import ./default.nix { pkgs = super; }; 10 | 11 | in 12 | builtins.listToAttrs 13 | (map (n: nameValuePair n nurAttrs.${n}) 14 | (builtins.filter (n: !isReserved n) 15 | (builtins.attrNames nurAttrs))) 16 | -------------------------------------------------------------------------------- /overlays/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | # Add your overlays here 3 | # 4 | # my-overlay = import ./my-overlay; 5 | } 6 | -------------------------------------------------------------------------------- /pkgs/dagger/default.nix: -------------------------------------------------------------------------------- 1 | # This file was generated by GoReleaser. DO NOT EDIT. 2 | # vim: set ft=nix ts=2 sw=2 sts=2 et sta 3 | { 4 | system ? builtins.currentSystem 5 | , lib 6 | , fetchurl 7 | , installShellFiles 8 | , stdenvNoCC 9 | }: 10 | let 11 | shaMap = { 12 | x86_64-linux = "0p060wdzlvas2lzri91bkxhv558px2i1ri1xlp8gc4pdbnx454zf"; 13 | armv7l-linux = "1idick0aqnh1ay38idik4rx1s1yqy6g7ac4q9f0iha9r5y3ycpaf"; 14 | aarch64-linux = "1f96q7j5f7zrvgblpaz69xpazrq5ff2jh6w8c10igjb0dir42bq8"; 15 | x86_64-darwin = "1j9ms6wpkviaisvxiq285fq0b5543f56w45m4nmndfp5xrfwh88w"; 16 | aarch64-darwin = "0dqwshmr1f404716m380zi9c9nvzh98v19hfxmx9gbd3w3sl4w2p"; 17 | }; 18 | 19 | urlMap = { 20 | x86_64-linux = "https://dl.dagger.io/dagger/releases/0.18.9/dagger_v0.18.9_linux_amd64.tar.gz"; 21 | armv7l-linux = "https://dl.dagger.io/dagger/releases/0.18.9/dagger_v0.18.9_linux_armv7.tar.gz"; 22 | aarch64-linux = "https://dl.dagger.io/dagger/releases/0.18.9/dagger_v0.18.9_linux_arm64.tar.gz"; 23 | x86_64-darwin = "https://dl.dagger.io/dagger/releases/0.18.9/dagger_v0.18.9_darwin_amd64.tar.gz"; 24 | aarch64-darwin = "https://dl.dagger.io/dagger/releases/0.18.9/dagger_v0.18.9_darwin_arm64.tar.gz"; 25 | }; 26 | in 27 | stdenvNoCC.mkDerivation { 28 | pname = "dagger"; 29 | version = "0.18.9"; 30 | src = fetchurl { 31 | url = urlMap.${system}; 32 | sha256 = shaMap.${system}; 33 | }; 34 | 35 | sourceRoot = "."; 36 | 37 | nativeBuildInputs = [ installShellFiles ]; 38 | 39 | installPhase = '' 40 | mkdir -p $out/bin 41 | cp -vr ././dagger $out/bin/./dagger 42 | ''; 43 | postInstall = '' 44 | installShellCompletion --cmd dagger \ 45 | --bash <($out/bin/dagger completion bash) \ 46 | --fish <($out/bin/dagger completion fish) \ 47 | --zsh <($out/bin/dagger completion zsh) 48 | ''; 49 | 50 | system = system; 51 | 52 | meta = { 53 | description = "Dagger is an integrated platform to orchestrate the delivery of applications"; 54 | homepage = "https://dagger.io"; 55 | license = lib.licenses.asl20; 56 | 57 | sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; 58 | 59 | platforms = [ 60 | "aarch64-darwin" 61 | "aarch64-linux" 62 | "armv7l-linux" 63 | "x86_64-darwin" 64 | "x86_64-linux" 65 | ]; 66 | }; 67 | } 68 | -------------------------------------------------------------------------------- /pkgs/dagger/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euxo pipefail 4 | 5 | version=$1 6 | 7 | function get_hash() { 8 | nix hash to-sri --type sha256 $(nix-prefetch-url https://github.com/dagger/dagger/releases/download/v${version}/dagger_v${version}_${1}.tar.gz) 9 | } 10 | 11 | cat <