diff options
| author | seth <[email protected]> | 2023-04-23 00:59:19 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-04-23 07:35:25 -0400 |
| commit | b0fd12cc8fbd57067e270137f02b6c40a2dbf226 (patch) | |
| tree | cb24fed453928a88fd738a13134ced5161814c66 | |
| parent | 07af751ba8cccf8009cf3586f07d746141f2ebab (diff) | |
try out hercules
| -rw-r--r-- | flake.lock | 120 | ||||
| -rw-r--r-- | flake.nix | 128 |
2 files changed, 183 insertions, 65 deletions
@@ -107,7 +107,9 @@ }, "flake-parts": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "nixpkgs-lib": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1680392223, @@ -208,6 +210,22 @@ "type": "github" } }, + "haskell-flake": { + "locked": { + "lastModified": 1678745009, + "narHash": "sha256-ujfwSrkxThmHJozibkCnJmlXLVyxm+Cbo2Q4wXPbCS4=", + "owner": "srid", + "repo": "haskell-flake", + "rev": "26852ade574c712bc3912ad28de52b0c4cf7d4cb", + "type": "github" + }, + "original": { + "owner": "srid", + "ref": "0.2.0", + "repo": "haskell-flake", + "type": "github" + } + }, "haumea": { "inputs": { "nixpkgs": [ @@ -228,6 +246,60 @@ "type": "github" } }, + "hercules-ci-agent": { + "inputs": { + "flake-parts": [ + "flake-parts" + ], + "haskell-flake": "haskell-flake", + "nix-darwin": "nix-darwin", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit-hooks-nix": [ + "pre-commit-hooks" + ] + }, + "locked": { + "lastModified": 1681758488, + "narHash": "sha256-RBd/RNq3wL52FvoajMwrnfyZPfq67KMzmp6rtNAx/2o=", + "owner": "hercules-ci", + "repo": "hercules-ci-agent", + "rev": "ef296dd6211e2ffeb942f12e6232a2d9abdd488d", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-agent", + "type": "github" + } + }, + "hercules-ci-effects": { + "inputs": { + "flake-parts": [ + "flake-parts" + ], + "hercules-ci-agent": [ + "hercules-ci-agent" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1681898675, + "narHash": "sha256-nIJ7CAdiHv4i1no/VgDoeTJLzbLYwu5+/Ycoyzn0S78=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "15ff4f63e5f28070391a5b09a82f6d5c6cc5c9d0", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -254,7 +326,9 @@ "flake-compat": [ "flake-compat" ], - "flake-parts": "flake-parts", + "flake-parts": [ + "flake-parts" + ], "flake-utils": [ "flake-utils" ], @@ -283,6 +357,27 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "hercules-ci-agent", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1680266963, + "narHash": "sha256-IW/lzbUCOcldLHWHjNSg1YoViDnZOmz0ZJL7EH9OkV8=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "99d4187d11be86b49baa3a1aec0530004072374f", + "type": "github" + }, + "original": { + "owner": "LnL7", + "repo": "nix-darwin", + "type": "github" + } + }, "nixinate": { "inputs": { "nixpkgs": [ @@ -360,24 +455,6 @@ "type": "indirect" } }, - "nixpkgs-lib": { - "locked": { - "dir": "lib", - "lastModified": 1680213900, - "narHash": "sha256-cIDr5WZIj3EkKyCgj/6j3HBH4Jj1W296z7HTcWj1aMA=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e3652e0735fbec227f342712f180f4f21f0594f2", - "type": "github" - }, - "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs-test": { "locked": { "lastModified": 1679009563, @@ -478,10 +555,13 @@ "inputs": { "agenix": "agenix", "flake-compat": "flake-compat", + "flake-parts": "flake-parts", "flake-utils": "flake-utils", "getchoo": "getchoo", "guzzle_api": "guzzle_api", "haumea": "haumea", + "hercules-ci-agent": "hercules-ci-agent", + "hercules-ci-effects": "hercules-ci-effects", "home-manager": "home-manager", "lanzaboote": "lanzaboote", "nixinate": "nixinate", @@ -19,6 +19,10 @@ flake = false; }; flake-utils.url = "github:numtide/flake-utils"; + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; getchoo = { url = "github:getchoo/overlay"; inputs.nixpkgs.follows = "nixpkgs"; @@ -33,6 +37,18 @@ url = "github:nix-community/haumea"; inputs.nixpkgs.follows = "nixpkgs"; }; + hercules-ci-agent = { + url = "github:hercules-ci/hercules-ci-agent"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-parts.follows = "flake-parts"; + inputs.pre-commit-hooks-nix.follows = "pre-commit-hooks"; + }; + hercules-ci-effects = { + url = "github:hercules-ci/hercules-ci-effects"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-parts.follows = "flake-parts"; + inputs.hercules-ci-agent.follows = "hercules-ci-agent"; + }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -49,6 +65,7 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-compat.follows = "flake-compat"; inputs.flake-utils.follows = "flake-utils"; + inputs.flake-parts.follows = "flake-parts"; inputs.pre-commit-hooks-nix.follows = "pre-commit-hooks"; # TODO: ditto inputs.rust-overlay.follows = "rust-overlay"; @@ -80,20 +97,18 @@ outputs = inputs @ { self, - nixpkgs, agenix, haumea, getchoo, - flake-utils, nixinate, openwrt-imagebuilder, pre-commit-hooks, + flake-parts, ... }: let - inherit (flake-utils.lib) eachDefaultSystem; inherit (getchooLib.configs) mapHMUsers mapHosts; - getchooLib = let + getchooLib = with inputs; let args = { users = with haumea.lib; load { @@ -104,55 +119,78 @@ in getchoo.lib (inputs // args); in - eachDefaultSystem (system: let - pkgs = import nixpkgs {inherit system;}; - in { - apps = nixinate.nixinate.${system} self; - checks = { - pre-commit-check = pre-commit-hooks.lib.${system}.run { - src = ./.; - hooks = { - actionlint.enable = true; - alejandra.enable = true; - deadnix.enable = true; - statix.enable = true; - stylua.enable = true; - }; - }; + flake-parts.lib.mkFlake {inherit inputs;} { + imports = [ + inputs.hercules-ci-effects.flakeModule + ]; + + flake = { + nixosConfigurations = mapHosts ./hosts; + + nixosModules.getchoo = import ./modules; }; - devShells = let - inherit (pkgs) mkShell; - in { - default = mkShell { - inherit (self.checks.${system}.pre-commit-check) shellHook; - packages = with pkgs; [ - actionlint - agenix.packages.${system}.agenix - alejandra - deadnix - fzf - git-crypt - just - statix - stylua - ]; + hercules-ci = { + flake-update = { + enable = true; + when.hour = [0]; }; }; - formatter = pkgs.alejandra; + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + perSystem = { + pkgs, + system, + ... + }: { + apps = nixinate.nixinate.${system} self; + checks = { + pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run { + src = ./.; + hooks = { + actionlint.enable = true; + alejandra.enable = true; + deadnix.enable = true; + statix.enable = true; + stylua.enable = true; + }; + }; + }; + + devShells = let + inherit (pkgs) mkShell; + in { + default = mkShell { + inherit (self.checks.${system}.pre-commit-check) shellHook; + packages = with inputs; + with pkgs; [ + actionlint + agenix.packages.${system}.agenix + alejandra + deadnix + fzf + git-crypt + just + statix + stylua + ]; + }; + }; - homeConfigurations = mapHMUsers system ./users; - }) - // { - nixosConfigurations = mapHosts ./hosts; + formatter = pkgs.alejandra; - nixosModules.getchoo = import ./modules; + legacyPackages.homeConfigurations = mapHMUsers system ./users; - packages.x86_64-linux = let - pkgs = import nixpkgs {system = "x86_64-linux";}; - in { - turret = pkgs.callPackage ./hosts/_turret {inherit openwrt-imagebuilder;}; + packages = with inputs; + with pkgs; { + turret = callPackage ./hosts/_turret {inherit openwrt-imagebuilder;}; + }; }; }; } |
