summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorseth <[email protected]>2023-05-22 02:35:15 -0400
committerseth <[email protected]>2023-05-23 11:05:28 -0400
commit630934a2631d9429b4e46c1b6ec0f6640f332384 (patch)
treed8bd14cafb0ac382625bc5dca79b84d497e9bab7 /modules
parent2cb6cfab9553184c1e6a10303cb832fe96080d00 (diff)
!hercules-ci -> hydra
Diffstat (limited to 'modules')
-rw-r--r--modules/flake/ci.nix67
-rw-r--r--modules/flake/default.nix15
-rw-r--r--modules/flake/dev.nix14
-rw-r--r--modules/nixos/server/default.nix2
4 files changed, 37 insertions, 61 deletions
diff --git a/modules/flake/ci.nix b/modules/flake/ci.nix
index 91dc397..9f4e58d 100644
--- a/modules/flake/ci.nix
+++ b/modules/flake/ci.nix
@@ -1,56 +1,23 @@
{
+ myLib,
self,
- inputs,
...
-}: let
- inherit (inputs) hercules-ci-effects nixpkgs;
-in {
- imports = [
- hercules-ci-effects.flakeModule
- ];
-
- hercules-ci = {
- flake-update = {
- enable = true;
- when = {
- hour = [0];
- minute = 0;
+}: {
+ flake = {
+ hydraJobs = let
+ supportedSystems = [
+ "x86_64-linux"
+ "aarch64-linux"
+ ];
+ in
+ with (myLib.my.ci supportedSystems); {
+ apps = mkCompatibleApps self.apps;
+ checks = mkCompatible self.checks;
+ devShells = mkCompatible self.devShells;
+ formatter = mkCompatibleFormatters self.formatter;
+ homeConfigurations = mkCompatibleHM self.homeConfigurations;
+ packages = mkCompatiblePkgs self.packages;
+ hosts = mkCompatibleCfg self.nixosConfigurations;
};
- };
- };
-
- herculesCI = let
- inherit
- (import
- (hercules-ci-effects + "/vendor/hercules-ci-agent/default-herculesCI-for-flake.nix"))
- flakeToOutputs
- ;
- in rec {
- ciSystems = [
- "x86_64-linux"
- "aarch64-linux"
- ];
-
- onPush = {
- default = {
- outputs = with builtins;
- with nixpkgs.lib; let
- # use defaults, but only evaluate hosts
- defaults =
- removeAttrs
- (flakeToOutputs self {
- ciSystems = genAttrs ciSystems (_: {});
- })
- ["nixosConfigurations" "packages"];
-
- evaluate = mapAttrs (_: v:
- seq
- v.config.system.build.toplevel
- v._module.args.pkgs.emptyFile)
- self.nixosConfigurations;
- in
- mkForce (defaults // evaluate);
- };
- };
};
}
diff --git a/modules/flake/default.nix b/modules/flake/default.nix
index 29c6c63..655ca47 100644
--- a/modules/flake/default.nix
+++ b/modules/flake/default.nix
@@ -1,9 +1,22 @@
-_: {
+{
+ inputs,
+ self,
+ ...
+}: {
imports = [
./ci.nix
./dev.nix
];
+ _module.args.myLib = self.lib {
+ inherit inputs;
+ inherit (inputs.nixpkgs) lib;
+ };
+
+ flake = {
+ lib = import ../../lib;
+ };
+
systems = [
"x86_64-linux"
"aarch64-linux"
diff --git a/modules/flake/dev.nix b/modules/flake/dev.nix
index 089c77a..6543fdd 100644
--- a/modules/flake/dev.nix
+++ b/modules/flake/dev.nix
@@ -1,18 +1,16 @@
{
- self,
inputs,
+ self,
...
-}: let
- inherit (inputs) pre-commit-hooks ragenix;
-in {
+}: {
perSystem = {
pkgs,
system,
...
}: {
checks = {
- pre-commit-check = pre-commit-hooks.lib.${system}.run {
- src = ./..;
+ pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
+ src = ./.;
hooks = {
actionlint.enable = true;
alejandra.enable = true;
@@ -29,12 +27,12 @@ in {
in {
default = mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
- packages = with pkgs; [
+ packages = with pkgs;
+ with inputs; [
actionlint
alejandra
deadnix
just
- nil
ragenix.packages.${system}.ragenix
statix
stylua
diff --git a/modules/nixos/server/default.nix b/modules/nixos/server/default.nix
index 210484e..55680d2 100644
--- a/modules/nixos/server/default.nix
+++ b/modules/nixos/server/default.nix
@@ -31,14 +31,12 @@ in {
trusted-substituters = [
"https://getchoo.cachix.org"
"https://nix-community.cachix.org"
- "https://hercules-ci.cachix.org"
"https://wurzelpfropf.cachix.org"
];
trusted-public-keys = [
"getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
- "hercules-ci.cachix.org-1:ZZeDl9Va+xe9j+KqdzoBZMFJHVQ42Uu/c/1/KMC5Lw0="
"wurzelpfropf.cachix.org-1:ilZwK5a6wJqVr7Fyrzp4blIEkGK+LJT0QrpWr1qBNq0="
];
};