ALPHA: wire is a tool to deploy nixos systems wire.althaea.zone/
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

switch build stuff to buildbot

+15 -166
-29
.github/workflows/hydra.yml
··· 1 - permissions: 2 - contents: read 3 - pull-requests: read 4 - name: "Hydra Stopgap" 5 - on: 6 - - pull_request_target 7 - 8 - concurrency: 9 - group: ${{ github.workflow }}-${{ github.event.number }} 10 - cancel-in-progress: true 11 - 12 - jobs: 13 - add-status: 14 - runs-on: ubuntu-latest 15 - steps: 16 - - name: Create Pending Docs Status 17 - uses: actions/github-script@v7 18 - if: contains(github.event.pull_request.labels.*.name, 'hydra') 19 - with: 20 - github-token: ${{ secrets.STATUS_TOKEN }} 21 - script: | 22 - github.rest.repos.createCommitStatus({ 23 - owner: context.repo.owner, 24 - repo: context.repo.repo, 25 - sha: github.event.pull_request.head.sha, 26 - state: 'pending', 27 - description: 'Waiting for hydra to evaluate this PR...', 28 - context: 'ci/hydra:wire:pr_${{ github.event.number }}:packages.docs' 29 - })
-15
flake.nix
··· 19 19 outputs = 20 20 { 21 21 self, 22 - nixpkgs, 23 22 flake-parts, 24 23 systems, 25 24 git-hooks, ··· 45 44 flake = { 46 45 nixosModules.default = import ./runtime/module.nix; 47 46 makeHive = import ./runtime/makeHive.nix; 48 - hydraJobs = 49 - let 50 - inherit (inputs.nixpkgs) lib; 51 - in 52 - { 53 - packages = { 54 - inherit (self.packages.x86_64-linux) docs; 55 - } 56 - // lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: { 57 - inherit (self.packages.${system}) wire wire-small; 58 - }); 59 - 60 - tests = lib.filterAttrs (n: _: (lib.hasPrefix "vm" n)) self.checks.x86_64-linux; 61 - }; 62 47 }; 63 48 64 49 perSystem =
-88
jobsets.nix
··· 1 - # referenced from https://github.com/aciceri/nixfleet/blob/master/modules/hydra/jobsets.nix 2 - # thank you! 3 - { 4 - prs, 5 - ... 6 - }: 7 - let 8 - repo = { 9 - owner = "wires-org"; 10 - name = "wire"; 11 - }; 12 - 13 - # nixpkgs 14 - mapAttrsToList = f: attrs: builtins.attrValues (builtins.mapAttrs f attrs); 15 - mapAttrs' = f: set: builtins.listToAttrs (mapAttrsToList f set); 16 - filterAttrs = 17 - pred: set: 18 - removeAttrs set (builtins.filter (name: !pred name set.${name}) (builtins.attrNames set)); 19 - 20 - pull_requests = filterAttrs (_num: pr: builtins.any (label: label.name == "hydra") pr.labels) ( 21 - builtins.fromJSON (builtins.readFile prs) 22 - ); 23 - 24 - mkJobset = 25 - { 26 - enabled ? 1, 27 - hidden ? false, 28 - type ? 1, 29 - description ? "", 30 - checkinterval ? 60, 31 - schedulingshares ? 2, 32 - enableemail ? false, 33 - emailoverride ? "", 34 - keepnr ? 3, 35 - flake, 36 - }: 37 - { 38 - inherit 39 - enabled 40 - hidden 41 - type 42 - description 43 - checkinterval 44 - schedulingshares 45 - enableemail 46 - emailoverride 47 - keepnr 48 - flake 49 - ; 50 - }; 51 - 52 - mkSpec = 53 - contents: 54 - let 55 - escape = builtins.replaceStrings [ ''"'' ] [ ''\"'' ]; 56 - contentsJson = builtins.toJSON contents; 57 - in 58 - builtins.derivation { 59 - name = "spec.json"; 60 - system = "x86_64-linux"; 61 - preferLocalBuild = true; 62 - allowSubstitutes = false; 63 - builder = "/bin/sh"; 64 - args = [ 65 - (builtins.toFile "builder.sh" '' 66 - echo "${escape contentsJson}" > $out 67 - '') 68 - ]; 69 - }; 70 - in 71 - { 72 - jobsets = mkSpec ( 73 - { 74 - main = mkJobset { 75 - description = "${repo.name}'s main branch"; 76 - flake = "git+ssh://git@github.com/${repo.owner}/${repo.name}?ref=main"; 77 - }; 78 - } 79 - // (mapAttrs' (n: pr: { 80 - name = "pr_${n}"; 81 - value = mkJobset { 82 - description = "${pr.title} ${pr.html_url}"; 83 - # Force fork's sha to be from within the context of the parent 84 - flake = "git+ssh://git@github.com/${repo.owner}/${repo.name}?rev=${pr.head.sha}"; 85 - }; 86 - }) pull_requests) 87 - ); 88 - }
+15 -10
nix/checks.nix
··· 3 3 { 4 4 craneLib, 5 5 commonArgs, 6 + self', 6 7 ... 7 8 }: 8 9 { 9 - checks.wire-nextest = craneLib.cargoNextest ( 10 - { 11 - partitions = 2; 12 - cargoArtifacts = craneLib.buildDepsOnly commonArgs; 13 - cargoNextestPartitionsExtraArgs = builtins.concatStringsSep " " [ 14 - "--no-tests pass" 15 - ]; 10 + checks = { 11 + inherit (self'.packages) wire wire-small docs; 12 + 13 + wire-nextest = craneLib.cargoNextest ( 14 + { 15 + partitions = 2; 16 + cargoArtifacts = craneLib.buildDepsOnly commonArgs; 17 + cargoNextestPartitionsExtraArgs = builtins.concatStringsSep " " [ 18 + "--no-tests pass" 19 + ]; 16 20 17 - } 18 - // commonArgs 19 - ); 21 + } 22 + // commonArgs 23 + ); 24 + }; 20 25 }; 21 26 }
-24
spec.json
··· 1 - { 2 - "enabled": 1, 3 - "hidden": false, 4 - "description": "wire tool", 5 - "nixexprinput": "src", 6 - "nixexprpath": "jobsets.nix", 7 - "checkinterval": 300, 8 - "schedulingshares": 1, 9 - "enableemail": false, 10 - "emailoverride": "", 11 - "keepnr": 2, 12 - "inputs": { 13 - "src": { 14 - "type": "git", 15 - "value": "https://github.com/wires-org/wire.git main", 16 - "emailresponsible": false 17 - }, 18 - "prs": { 19 - "type": "githubpulls", 20 - "value": "wires-org wire", 21 - "emailresponsible": false 22 - } 23 - } 24 - }