From 8fe43d231b7fa8436a29934ebe62d9048ba78478 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sat, 28 May 2022 13:18:06 +0200 Subject: [PATCH] dev: Use hercules-ci-effects.flakeModule --- dev/flake-module.nix | 15 +++++++-------- dev/flake.lock | 6 +++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/dev/flake-module.nix b/dev/flake-module.nix index 435bbab..78777a2 100644 --- a/dev/flake-module.nix +++ b/dev/flake-module.nix @@ -1,8 +1,9 @@ -{ config, lib, inputs, ... }: +{ config, lib, inputs, withSystem, ... }: { imports = [ inputs.pre-commit-hooks-nix.flakeModule + inputs.hercules-ci-effects.flakeModule ../site/flake-module.nix ]; systems = [ "x86_64-linux" "aarch64-darwin" ]; @@ -30,23 +31,21 @@ }; flake = { + # Because of ./README.md, we can't use the built-in flake support, including + # the `effects` flake attribute. We have to define `herculesCI` ourselves. options.herculesCI = lib.mkOption { type = lib.types.raw; }; config.herculesCI = { branch, ... }: { onPush.default.outputs = { inherit (config.flake) packages checks; effects = - let - pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; - effects = inputs.hercules-ci-effects.lib.withPkgs pkgs; - in - { + withSystem "x86_64-linux" ({ config, pkgs, effects, ... }: { netlifyDeploy = effects.netlifyDeploy { - content = config.flake.packages.x86_64-linux.siteContent; + content = config.packages.siteContent; secretName = "default-netlify"; siteId = "29a153b1-3698-433c-bc73-62415efb8117"; productionDeployment = branch == "main"; }; - }; + }); }; }; diff --git a/dev/flake.lock b/dev/flake.lock index 2a33091..848cac1 100644 --- a/dev/flake.lock +++ b/dev/flake.lock @@ -20,11 +20,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1653487348, - "narHash": "sha256-lWqxXMRqO8blpwhH2qvrFBVp6aZ7V+Z3xTqkNWKyLQw=", + "lastModified": 1653740649, + "narHash": "sha256-3kZc+D03J+Uleftpdv5BuBogwkc45zvhDte/AI0BvaI=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "0ab66b56d3f2b40ddfd981899d1757773632075f", + "rev": "6d99ef9727b1327ec7eb6fa2055b74bd88ea4709", "type": "github" }, "original": {