From 87c34ab72aa8cf3c76e7c5f75cd903593acaba53 Mon Sep 17 00:00:00 2001 From: jiriks74 Date: Fri, 10 Jan 2025 06:34:26 +0100 Subject: [PATCH] feat(ci/cd): Set up Hydra --- .hydra/jobsets.nix | 13 +++++++++ .hydra/spec.json | 70 ++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 16 +++++++++++ 3 files changed, 99 insertions(+) create mode 100644 .hydra/jobsets.nix create mode 100644 .hydra/spec.json diff --git a/.hydra/jobsets.nix b/.hydra/jobsets.nix new file mode 100644 index 0000000..343da56 --- /dev/null +++ b/.hydra/jobsets.nix @@ -0,0 +1,13 @@ +{ nixpkgs ? }: + +let + + pkgs = import nixpkgs { }; + +in + +{ + + myapp = pkgs.writeShellScript "hello" "${pkgs.hello}/bin/hello"; + +} diff --git a/.hydra/spec.json b/.hydra/spec.json new file mode 100644 index 0000000..208f8cf --- /dev/null +++ b/.hydra/spec.json @@ -0,0 +1,70 @@ +{ + "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 + } + } + }, + "zsh.nix": { + "enabled": 0, + "hidden": false, + "description": "ZSH flake", + "nixexprinput": "src", + "nixexprpath": "flake#hydraJobs", + "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 + } + "gitea_repo_name": { + "type": "string", + "value": "zsh.nix", + "emailresponsible": false + }, + "gitea_repo_owner": { + "type": "string", + "value": "jiriks74", + "emailresponsible": false + }, + "gitea_status_repo": { + "type": "string", + "value": "main", + "emailresponsible": false + }, + "gitea_http_url": { + "type": "string", + "value": "https://forgejo.stefka.eu/", + "emailresponsible": false + } + } + } +} diff --git a/flake.nix b/flake.nix index 0021731..1ecd0bf 100644 --- a/flake.nix +++ b/flake.nix @@ -47,5 +47,21 @@ ]; }; }; + hydraJobs = { + # Check the flake (flake.lock integrity, formatting, etc.) + flakeCheck = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixFlakes.checks.self); + + # Test evaluation of Home Manager modules + homeManagerModules = forAllSystems (system: { + default = nixpkgs.legacyPackages.${system}.nixFlakes.evalJobs { + flake = self; + paths = [ "homeManagerModules.default" ]; + }; + withPackages = nixpkgs.legacyPackages.${system}.nixFlakes.evalJobs { + flake = self; + paths = [ "homeManagerModules.withPackages" ]; + }; + }); + }; }; }