Merge pull request #148 from hercules-ci/hs-update

arion-compose.cabal: Loosen base constraint + update
This commit is contained in:
Robert Hensing 2022-04-23 23:29:28 +02:00 committed by GitHub
commit cd962c840e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 36 additions and 19 deletions

View file

@ -29,7 +29,7 @@ source-repository head
location: https://github.com/hercules-ci/arion location: https://github.com/hercules-ci/arion
common common common common
build-depends: base >=4.12.0.0 && <4.15 build-depends: base >=4.12.0.0 && <4.17
, aeson , aeson
, aeson-pretty , aeson-pretty
, async , async

View file

@ -233,7 +233,7 @@ Type:: string
Default:: Default::
+ +
---- ----
{"_type":"literalExpression","text":"config.service.name"} {"_type":"literalExpression","text":"\"localhost/\" + config.service.name"}
---- ----

View file

@ -8,10 +8,12 @@ let
options = eval.options; options = eval.options;
}; };
in (pkgs.writeText "agent-options" '' in (pkgs.runCommand "agent-options.adoc" { } ''
cat >$out <<EOF
= Arion options = Arion options
${options.optionsAsciiDoc} EOF
cat ${options.optionsAsciiDoc} >>$out
'').overrideAttrs (o: { '').overrideAttrs (o: {
# Work around https://github.com/hercules-ci/hercules-ci-agent/issues/168 # Work around https://github.com/hercules-ci/hercules-ci-agent/issues/168
allowSubstitutes = true; allowSubstitutes = true;

View file

@ -41,7 +41,10 @@ dimension "Nixpkgs version" {
} // lib.optionalAttrs enableNixOSTests { } // lib.optionalAttrs enableNixOSTests {
inherit (pkgs) tests; inherit (pkgs) tests;
} // lib.optionalAttrs enableDoc { } // lib.optionalAttrs enableDoc {
inherit (pkgs) doc doc-options doc-options-check; inherit (pkgs)
# FIXME: nixpkgs antora packaging is broken
# doc
doc-options doc-options-check;
} // lib.optionalAttrs isReferenceTarget { } // lib.optionalAttrs isReferenceTarget {
inherit (pkgs.arion-project.haskellPkgs) arion-compose-checked; inherit (pkgs.arion-project.haskellPkgs) arion-compose-checked;
} }

View file

@ -6,6 +6,12 @@ let
inherit (pkgs.haskell.lib) overrideCabal addBuildTools; inherit (pkgs.haskell.lib) overrideCabal addBuildTools;
in in
overrideCabal (addBuildTools (haskellPackages.callCabal2nix "arion-compose" ./.. {}) [pkgs.nix]) (o: o // { overrideCabal (addBuildTools (haskellPackages.callCabal2nix "arion-compose" ./.. {}) [pkgs.nix]) (o: o // {
src = pkgs.lib.sourceByRegex ../. [
".*[.]cabal"
"LICENSE"
"src/?.*"
"README.asciidoc"
];
preCheck = '' preCheck = ''
export NIX_LOG_DIR=$TMPDIR export NIX_LOG_DIR=$TMPDIR
export NIX_STATE_DIR=$TMPDIR export NIX_STATE_DIR=$TMPDIR

View file

@ -36,15 +36,15 @@
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}, },
"nixos-unstable": { "nixos-unstable": {
"branch": "master", "branch": "lib-modules-allow-disable-_modules.args-docs-internal",
"description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
"homepage": "https://github.com/NixOS/nixpkgs", "homepage": "https://github.com/NixOS/nixpkgs",
"owner": "NixOS", "owner": "hercules-ci",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f8232491252438cd70b93554e31fe8238a573636", "rev": "35f40b20607428901e8edace7d4643d4ac11e876",
"sha256": "019bz8dxp9d30ghmi9v0inn0p7mj3mia69lkh5cyivhhp1i0cs5i", "sha256": "0w1ivhzszggq2j4fxbhdppvzj07zkginfnqdpkl6mdzvpwhy8f0d",
"type": "tarball", "type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/f8232491252438cd70b93554e31fe8238a573636.tar.gz", "url": "https://github.com/hercules-ci/nixpkgs/archive/35f40b20607428901e8edace7d4643d4ac11e876.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz", "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz",
"version": "" "version": ""
}, },

View file

@ -25,7 +25,8 @@ loadImages requestedImages = do
isNew i = isNew i =
-- On docker, the image name is unmodified -- On docker, the image name is unmodified
(imageName i <> ":" <> imageTag i) `notElem` loaded (imageName i <> ":" <> imageTag i) `notElem` loaded
-- -- On podman, you automatically get a localhost prefix -- On podman, you used to automatically get a localhost prefix
-- however, since NixOS 22.05, this expected to be part of the name instead
&& ("localhost/" <> imageName i <> ":" <> imageTag i) `notElem` loaded && ("localhost/" <> imageName i <> ":" <> imageTag i) `notElem` loaded
traverse_ loadImage . filter isNew $ requestedImages traverse_ loadImage . filter isNew $ requestedImages

View file

@ -9,7 +9,7 @@
"PATH": "/usr/bin:/run/current-system/sw/bin/", "PATH": "/usr/bin:/run/current-system/sw/bin/",
"container": "docker" "container": "docker"
}, },
"image": "webserver:<HASH>", "image": "localhost/webserver:<HASH>",
"ports": [ "ports": [
"8000:80" "8000:80"
], ],
@ -32,7 +32,7 @@
"images": [ "images": [
{ {
"imageExe": "<STOREPATH>", "imageExe": "<STOREPATH>",
"imageName": "webserver", "imageName": "localhost/webserver",
"imageTag": "<HASH>" "imageTag": "<HASH>"
} }
], ],

View file

@ -12,7 +12,6 @@ let
inherit (pkgs) lib; inherit (pkgs) lib;
composition = lib.evalModules { composition = lib.evalModules {
check = true;
modules = builtinModules ++ modules; modules = builtinModules ++ modules;
}; };
@ -24,6 +23,7 @@ let
_file = ./eval-composition.nix; _file = ./eval-composition.nix;
key = ./eval-composition.nix; key = ./eval-composition.nix;
config._module.args.pkgs = lib.mkIf (pkgs != null) (lib.mkForce pkgs); config._module.args.pkgs = lib.mkIf (pkgs != null) (lib.mkForce pkgs);
config._module.args.check = true;
config.host.nixStorePrefix = hostNixStorePrefix; config.host.nixStorePrefix = hostNixStorePrefix;
config.host.uid = lib.toInt uid; config.host.uid = lib.toInt uid;
}; };

View file

@ -8,6 +8,9 @@ let
in in
{ {
options = { options = {
_module.args = mkOption {
internal = true;
};
project.name = mkOption { project.name = mkOption {
description = '' description = ''
Name of the project. Name of the project.

View file

@ -104,8 +104,8 @@ in
}; };
image.name = mkOption { image.name = mkOption {
type = str; type = str;
default = config.service.name; default = "localhost/" + config.service.name;
defaultText = lib.literalExpression or lib.literalExample "config.service.name"; defaultText = lib.literalExpression or lib.literalExample ''"localhost/" + config.service.name'';
description = '' description = ''
A human readable name for the docker image. A human readable name for the docker image.

View file

@ -20,7 +20,7 @@ let
in in
{ {
name = "arion-test"; name = "arion-test";
machine = { pkgs, lib, ... }: { nodes.machine = { pkgs, lib, ... }: {
environment.systemPackages = [ environment.systemPackages = [
pkgs.arion pkgs.arion
] ++ lib.optional usePodman pkgs.docker; ] ++ lib.optional usePodman pkgs.docker;

View file

@ -30,7 +30,7 @@ recurseIntoAttrs {
testWithPodman = testWithPodman =
if arionTestingFlags.nixosHasPodmanDockerSocket if arionTestingFlags.nixosHasPodmanDockerSocket
then nixosTest (pkgs.callPackage ./arion-test { usePodman = true; }) then nixosTest (import ./arion-test { usePodman = true; inherit pkgs lib; })
else {}; else {};
testBuild = arion.build { testBuild = arion.build {

View file

@ -18,6 +18,7 @@
# ]; # ];
service.ports = [ "9092:9092" ]; service.ports = [ "9092:9092" ];
service.depends_on = [ "zookeeper" ]; service.depends_on = [ "zookeeper" ];
image.name = "localhost/kafka";
image.contents = [ image.contents = [
(pkgs.runCommand "root" { } '' (pkgs.runCommand "root" { } ''
mkdir -p $out/bin mkdir -p $out/bin
@ -41,6 +42,7 @@
# # volume.nocopy = true; # # volume.nocopy = true;
# } # }
# ]; # ];
image.name = "localhost/zookeeper";
image.contents = [ image.contents = [
(pkgs.buildEnv { (pkgs.buildEnv {
name = "root"; name = "root";
@ -51,7 +53,7 @@
}) })
]; ];
image.command = [ image.command = [
"${pkgs.zookeeper.override { jre = pkgs.jdk8_headless; }}/bin/zkServer.sh" "${pkgs.zookeeper}/bin/zkServer.sh"
"--config" "--config"
"${./zookeeper}" "${./zookeeper}"
"start-foreground" "start-foreground"