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.

add hydraJobs, jobset.nix & spec.json

marshmallow b1493f43 fc2b9d7a

+119
+1
flake.nix
··· 44 44 flake = { 45 45 nixosModules.default = import ./runtime/module.nix; 46 46 makeHive = import ./runtime/makeHive.nix; 47 + hydraJobs = { inherit (self.packages) x86_64-linux; }; 47 48 }; 48 49 49 50 perSystem =
+87
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 ? 100, 32 + enableemail ? false, 33 + emailoverride ? "", 34 + keepnr ? 5, 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; 83 + flake = "git+ssh://git@github.com/${repo.owner}/${repo.name}?ref=${pr.head.ref}"; 84 + }; 85 + }) pull_requests) 86 + ); 87 + }
+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": 5, 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 + }
+7
wire/cli/src/main.rs
··· 31 31 #[cfg(feature = "dhat-heap")] 32 32 let _profiler = dhat::Profiler::new_heap(); 33 33 34 + // random change 35 + // another 36 + // a third 37 + // 38 + 39 + print!("real functionality"); 40 + 34 41 let args = Cli::parse(); 35 42 36 43 let modifiers = args.to_subcommand_modifiers();