From 57516c38fac824fb8ea3b1a494f69218bae2d37b Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 23 Aug 2023 11:25:28 +0200 Subject: [PATCH 1/4] dev: Add flake-update --- flake.lock | 133 ++++++++++++++++++++++++++++++++++++++++++++++++++++- flake.nix | 26 ++++++++--- 2 files changed, 152 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index f80a4d6..7a6ee24 100644 --- a/flake.lock +++ b/flake.lock @@ -20,6 +20,45 @@ "type": "github" } }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1688466019, + "narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "hercules-ci-effects", + "hercules-ci-agent", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1688466019, + "narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "haskell-flake": { "locked": { "lastModified": 1675296942, @@ -36,7 +75,98 @@ "type": "github" } }, + "haskell-flake_2": { + "locked": { + "lastModified": 1684780604, + "narHash": "sha256-2uMZsewmRn7rRtAnnQNw1lj0uZBMh4m6Cs/7dV5YF08=", + "owner": "srid", + "repo": "haskell-flake", + "rev": "74210fa80a49f1b6f67223debdbf1494596ff9f2", + "type": "github" + }, + "original": { + "owner": "srid", + "ref": "0.3.0", + "repo": "haskell-flake", + "type": "github" + } + }, + "hercules-ci-agent": { + "inputs": { + "flake-parts": "flake-parts_3", + "haskell-flake": "haskell-flake_2", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1688568579, + "narHash": "sha256-ON0M56wtY/TIIGPkXDlJboAmuYwc73Hi8X9iJGtxOhM=", + "owner": "hercules-ci", + "repo": "hercules-ci-agent", + "rev": "367dd8cd649b57009a6502e878005a1e54ad78c5", + "type": "github" + }, + "original": { + "id": "hercules-ci-agent", + "type": "indirect" + } + }, + "hercules-ci-effects": { + "inputs": { + "flake-parts": "flake-parts_2", + "hercules-ci-agent": "hercules-ci-agent", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1689397210, + "narHash": "sha256-fVxZnqxMbsDkB4GzGAs/B41K0wt/e+B/fLxmTFF/S20=", + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "rev": "0a63bfa3f00a3775ea3a6722b247880f1ffe91ce", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "hercules-ci-effects", + "type": "github" + } + }, "nixpkgs": { + "locked": { + "lastModified": 1688322751, + "narHash": "sha256-eW62dC5f33oKZL7VWlomttbUnOTHrAbte9yNUNW8rbk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0fbe93c5a7cac99f90b60bdf5f149383daaa615f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1688049487, + "narHash": "sha256-100g4iaKC9MalDjUW9iN6Jl/OocTDtXdeAj7pEGIRh4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4bc72cae107788bf3f24f30db2e2f685c9298dc9", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1676300157, "narHash": "sha256-1HjRzfp6LOLfcj/HJHdVKWAkX9QRAouoh6AjzJiIerU=", @@ -56,7 +186,8 @@ "inputs": { "flake-parts": "flake-parts", "haskell-flake": "haskell-flake", - "nixpkgs": "nixpkgs" + "hercules-ci-effects": "hercules-ci-effects", + "nixpkgs": "nixpkgs_2" } } }, diff --git a/flake.nix b/flake.nix index c623eb2..0fad924 100644 --- a/flake.nix +++ b/flake.nix @@ -6,12 +6,15 @@ haskell-flake.url = "github:srid/haskell-flake/0.1.0"; flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs"; + hercules-ci-effects.url = "github:hercules-ci/hercules-ci-effects"; + hercules-ci-effects.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = inputs@{ self, flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } ({ config, lib, extendModules, ... }: { imports = [ inputs.haskell-flake.flakeModule + inputs.hercules-ci-effects.flakeModule inputs.flake-parts.flakeModules.easyOverlay ./docs/flake-module.nix ./tests/flake-module.nix @@ -63,6 +66,23 @@ ]; }); }; + + hercules-ci.flake-update = { + enable = true; + autoMergeMethod = "merge"; + when = { + hour = [ 2 ]; + dayOfMonth = [ 5 ]; + }; + }; + + herculesCI.ciSystems = [ + # "aarch64-darwin" + # "aarch64-linux" + "x86_64-darwin" + "x86_64-linux" + ]; + flake = { debug = { inherit inputs config lib; }; @@ -79,12 +99,6 @@ in composition.config.out.dockerComposeYaml; }; nixosModules.arion = ./nixos-module.nix; - herculesCI.ciSystems = [ - # "aarch64-darwin" - # "aarch64-linux" - "x86_64-darwin" - "x86_64-linux" - ]; }; }); } From 6881b440b6e147025eef1da2b5991d13708c5965 Mon Sep 17 00:00:00 2001 From: Jasper Chan Date: Mon, 6 Nov 2023 21:58:30 -0800 Subject: [PATCH 2/4] add support for stop_grace_period --- src/nix/modules/service/docker-compose-service.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/nix/modules/service/docker-compose-service.nix b/src/nix/modules/service/docker-compose-service.nix index c038ac6..3c60ee3 100644 --- a/src/nix/modules/service/docker-compose-service.nix +++ b/src/nix/modules/service/docker-compose-service.nix @@ -297,6 +297,11 @@ in default = null; description = serviceRef "stop_signal"; }; + service.stop_grace_period = mkOption { + type = nullOr str; + default = null; + description = serviceRef "stop_grace_period"; + }; service.sysctls = mkOption { type = attrsOf (either str int); default = {}; @@ -380,6 +385,8 @@ in inherit (config.service) restart; } // lib.optionalAttrs (config.service.stop_signal != null) { inherit (config.service) stop_signal; + } // lib.optionalAttrs (config.service.stop_grace_period != null) { + inherit (config.service) stop_grace_period; } // lib.optionalAttrs (config.service.tmpfs != []) { inherit (config.service) tmpfs; } // lib.optionalAttrs (config.service.tty != null) { From 493fa1e5757d21d11917c28ca85a46b1d54c2111 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 28 Nov 2023 19:36:55 +0100 Subject: [PATCH 3/4] deployment.adoc: fetchTarball instead of abstract variable --- docs/modules/ROOT/pages/deployment.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/modules/ROOT/pages/deployment.adoc b/docs/modules/ROOT/pages/deployment.adoc index ea8f12c..5e27d58 100644 --- a/docs/modules/ROOT/pages/deployment.adoc +++ b/docs/modules/ROOT/pages/deployment.adoc @@ -45,10 +45,10 @@ NOTE: This deployment method does NOT use an `arion-pkgs.nix` file, but reuses # Pick one of: # - niv ((import ./nix/sources.nix).arion + "/nixos-module.nix") - # - flakes (where arion is a flake input) + # - or flakes (where arion is a flake input) arion.nixosModules.arion - # - other - arionPath + "/nixos-module.nix") + # - or other: copy commit hash of arion and replace HASH in: + (builtins.fetchTarball "https://github.com/hercules-ci/arion/archive/HASH.tar.gz") + "/nixos-module.nix") ]; virtualisation.arion = { From f68888200db1eca52701321a836f238a87c19856 Mon Sep 17 00:00:00 2001 From: Hercules CI Effects Date: Tue, 5 Dec 2023 15:49:42 +0000 Subject: [PATCH 4/4] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/47478a4a003e745402acf63be7f9a092d51b83d7' (2023-02-09) → 'github:hercules-ci/flake-parts/34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5' (2023-12-01) • Updated input 'hercules-ci-effects': 'github:hercules-ci/hercules-ci-effects/0a63bfa3f00a3775ea3a6722b247880f1ffe91ce' (2023-07-15) → 'github:hercules-ci/hercules-ci-effects/31b6cd7569191bfcd0a548575b0e2ef953ed7d09' (2023-11-26) • Updated input 'hercules-ci-effects/flake-parts': 'github:hercules-ci/flake-parts/8e8d955c22df93dbe24f19ea04f47a74adbdc5ec' (2023-07-04) → 'github:hercules-ci/flake-parts/c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4' (2023-10-03) • Updated input 'hercules-ci-effects/flake-parts/nixpkgs-lib': 'github:NixOS/nixpkgs/4bc72cae107788bf3f24f30db2e2f685c9298dc9?dir=lib' (2023-06-29) → follows 'hercules-ci-effects/nixpkgs' • Removed input 'hercules-ci-effects/hercules-ci-agent' • Removed input 'hercules-ci-effects/hercules-ci-agent/flake-parts' • Removed input 'hercules-ci-effects/hercules-ci-agent/flake-parts/nixpkgs-lib' • Removed input 'hercules-ci-effects/hercules-ci-agent/haskell-flake' • Removed input 'hercules-ci-effects/hercules-ci-agent/nixpkgs' • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/545c7a31e5dedea4a6d372712a18e00ce097d462' (2023-02-13) → 'github:NixOS/nixpkgs/91050ea1e57e50388fa87a3302ba12d188ef723a' (2023-12-01) --- flake.lock | 123 ++++++++--------------------------------------------- 1 file changed, 17 insertions(+), 106 deletions(-) diff --git a/flake.lock b/flake.lock index 7a6ee24..71d6019 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1675933616, - "narHash": "sha256-/rczJkJHtx16IFxMmAWu5nNYcSXNg1YYXTHoGjLrLUA=", + "lastModified": 1701473968, + "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "47478a4a003e745402acf63be7f9a092d51b83d7", + "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", "type": "github" }, "original": { @@ -22,14 +22,17 @@ }, "flake-parts_2": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "nixpkgs-lib": [ + "hercules-ci-effects", + "nixpkgs" + ] }, "locked": { - "lastModified": 1688466019, - "narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=", + "lastModified": 1696343447, + "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec", + "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", "type": "github" }, "original": { @@ -37,28 +40,6 @@ "type": "indirect" } }, - "flake-parts_3": { - "inputs": { - "nixpkgs-lib": [ - "hercules-ci-effects", - "hercules-ci-agent", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1688466019, - "narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, "haskell-flake": { "locked": { "lastModified": 1675296942, @@ -75,55 +56,19 @@ "type": "github" } }, - "haskell-flake_2": { - "locked": { - "lastModified": 1684780604, - "narHash": "sha256-2uMZsewmRn7rRtAnnQNw1lj0uZBMh4m6Cs/7dV5YF08=", - "owner": "srid", - "repo": "haskell-flake", - "rev": "74210fa80a49f1b6f67223debdbf1494596ff9f2", - "type": "github" - }, - "original": { - "owner": "srid", - "ref": "0.3.0", - "repo": "haskell-flake", - "type": "github" - } - }, - "hercules-ci-agent": { - "inputs": { - "flake-parts": "flake-parts_3", - "haskell-flake": "haskell-flake_2", - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1688568579, - "narHash": "sha256-ON0M56wtY/TIIGPkXDlJboAmuYwc73Hi8X9iJGtxOhM=", - "owner": "hercules-ci", - "repo": "hercules-ci-agent", - "rev": "367dd8cd649b57009a6502e878005a1e54ad78c5", - "type": "github" - }, - "original": { - "id": "hercules-ci-agent", - "type": "indirect" - } - }, "hercules-ci-effects": { "inputs": { "flake-parts": "flake-parts_2", - "hercules-ci-agent": "hercules-ci-agent", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1689397210, - "narHash": "sha256-fVxZnqxMbsDkB4GzGAs/B41K0wt/e+B/fLxmTFF/S20=", + "lastModified": 1701009247, + "narHash": "sha256-GuX16rzRze2y7CsewJLTV6qXkXWyEwp6VCZXi8HLruU=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "0a63bfa3f00a3775ea3a6722b247880f1ffe91ce", + "rev": "31b6cd7569191bfcd0a548575b0e2ef953ed7d09", "type": "github" }, "original": { @@ -134,45 +79,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1688322751, - "narHash": "sha256-eW62dC5f33oKZL7VWlomttbUnOTHrAbte9yNUNW8rbk=", + "lastModified": 1701436327, + "narHash": "sha256-tRHbnoNI8SIM5O5xuxOmtSLnswEByzmnQcGGyNRjxsE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0fbe93c5a7cac99f90b60bdf5f149383daaa615f", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-lib": { - "locked": { - "dir": "lib", - "lastModified": 1688049487, - "narHash": "sha256-100g4iaKC9MalDjUW9iN6Jl/OocTDtXdeAj7pEGIRh4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "4bc72cae107788bf3f24f30db2e2f685c9298dc9", - "type": "github" - }, - "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1676300157, - "narHash": "sha256-1HjRzfp6LOLfcj/HJHdVKWAkX9QRAouoh6AjzJiIerU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "545c7a31e5dedea4a6d372712a18e00ce097d462", + "rev": "91050ea1e57e50388fa87a3302ba12d188ef723a", "type": "github" }, "original": { @@ -187,7 +98,7 @@ "flake-parts": "flake-parts", "haskell-flake": "haskell-flake", "hercules-ci-effects": "hercules-ci-effects", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs" } } },