diff --git a/flake.nix b/flake.nix index 617d2a3..b97c445 100644 --- a/flake.nix +++ b/flake.nix @@ -88,5 +88,12 @@ # TODO: Re-enable this when I figure out how to prevent needing to build # dependencies for architectures other than the host machine # checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks inputs.self.deploy) inputs.deploy-rs.lib; + + hydraJobs = { + inherit + (inputs.self) + packages + ; + }; }; } diff --git a/modules/nixos/services/hydra/default.nix b/modules/nixos/services/hydra/default.nix new file mode 100644 index 0000000..9c1cc53 --- /dev/null +++ b/modules/nixos/services/hydra/default.nix @@ -0,0 +1,36 @@ +{ + options, + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.aa.services.hydra; +in { + options.aa.services.hydra = with types; { + enable = mkEnableOption "hydra"; + }; + + config = mkIf cfg.enable { + # NOTE: Need to create user to allow web configuration + # sudo -u hydra hydra-create-user alice \ + # --full-name 'Alice Q. User' \ + # --email-address 'alice@example.org' \ + # --password-prompt \ + # --role admin + + services.hydra = { + enable = true; + hydraURL = "http://localhost:3000"; + notificationSender = "hydra@localhost"; + buildMachinesFiles = []; + useSubstitutes = true; + }; + + nix.settings = { + allowed-users = ["hydra"]; + allowed-uris = ["github:"]; + }; + }; +}