feat(ci/cd): Set up Hydra
This commit is contained in:
parent
72dd5a2eb3
commit
1e7e927421
4 changed files with 69 additions and 0 deletions
13
.hydra/jobsets.nix
Normal file
13
.hydra/jobsets.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{ nixpkgs ? <nixpkgs> }:
|
||||
|
||||
let
|
||||
|
||||
pkgs = import nixpkgs { };
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
myapp = pkgs.writeShellScript "hello" "${pkgs.hello}/bin/hello";
|
||||
|
||||
}
|
26
.hydra/spec.json
Normal file
26
.hydra/spec.json
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"hello": {
|
||||
"enabled": 1,
|
||||
"hidden": false,
|
||||
"description": "test",
|
||||
"nixexprinput": "src",
|
||||
"nixexprpath": ".hydra/jobsets.nix",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 100,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 3,
|
||||
"inputs": {
|
||||
"src": {
|
||||
"type": "git",
|
||||
"value": "https://forgejo.stefka.eu/jiriks74/zsh.nix main",
|
||||
"emailresponsible": false
|
||||
},
|
||||
"nixpkgs": { "type": "git",
|
||||
"type": "git",
|
||||
"value": "https://github.com/NixOS/nixpkgs.git nixos-unstable",
|
||||
"emailresponsible": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,6 +5,11 @@
|
|||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/master";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
|
@ -47,5 +52,6 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
hydraJobs = import ./hydra.nix {inherit inputs outputs;};
|
||||
};
|
||||
}
|
||||
|
|
24
hydra.nix
Normal file
24
hydra.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
inputs,
|
||||
outputs,
|
||||
}: let
|
||||
inherit (inputs.nixpkgs) lib;
|
||||
|
||||
notBroken = pkg: !(pkg.meta.broken or false);
|
||||
isDistributable = pkg: (pkg.meta.license or {redistributable = true;}).redistributable;
|
||||
hasPlatform = sys: pkg: lib.elem sys (pkg.meta.platforms or [sys]);
|
||||
filterValidPkgs = sys: pkgs:
|
||||
lib.filterAttrs (_: pkg:
|
||||
lib.isDerivation pkg
|
||||
&& hasPlatform sys pkg
|
||||
&& notBroken pkg
|
||||
&& isDistributable pkg)
|
||||
pkgs;
|
||||
|
||||
getConfigTopLevel = _: cfg: cfg.config.system.build.toplevel;
|
||||
in {
|
||||
# pkgs = lib.mapAttrs filterValidPkgs outputs.packages;
|
||||
# hosts = lib.mapAttrs getConfigTopLevel outputs.nixosConfigurations;
|
||||
default = lib.mapAttrs getConfigTopLevel outputs.homeManagerModules.default;
|
||||
withPackages = lib.mapAttrs getConfigTopLevel outputs.homeManagerModules.withPackages;
|
||||
}
|
Loading…
Reference in a new issue