diff --git a/arion-compose.cabal b/arion-compose.cabal index 2437373..3aa58b0 100644 --- a/arion-compose.cabal +++ b/arion-compose.cabal @@ -29,7 +29,7 @@ source-repository head location: https://github.com/hercules-ci/arion common common - build-depends: base >=4.12.0.0 && <4.15 + build-depends: base >=4.12.0.0 && <4.17 , aeson , aeson-pretty , async diff --git a/docs/modules/ROOT/partials/NixOSOptions.adoc b/docs/modules/ROOT/partials/NixOSOptions.adoc index 14efd31..3ba49a3 100644 --- a/docs/modules/ROOT/partials/NixOSOptions.adoc +++ b/docs/modules/ROOT/partials/NixOSOptions.adoc @@ -233,7 +233,7 @@ Type:: string Default:: + ---- -{"_type":"literalExpression","text":"config.service.name"} +{"_type":"literalExpression","text":"\"localhost/\" + config.service.name"} ---- diff --git a/docs/options.nix b/docs/options.nix index b4c2a8f..d78b4c1 100644 --- a/docs/options.nix +++ b/docs/options.nix @@ -8,10 +8,12 @@ let options = eval.options; }; -in (pkgs.writeText "agent-options" '' +in (pkgs.runCommand "agent-options.adoc" { } '' + cat >$out <>$out '').overrideAttrs (o: { # Work around https://github.com/hercules-ci/hercules-ci-agent/issues/168 allowSubstitutes = true; diff --git a/nix/ci.nix b/nix/ci.nix index 58e62e4..d545ef6 100644 --- a/nix/ci.nix +++ b/nix/ci.nix @@ -41,7 +41,10 @@ dimension "Nixpkgs version" { } // lib.optionalAttrs enableNixOSTests { inherit (pkgs) tests; } // 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 { inherit (pkgs.arion-project.haskellPkgs) arion-compose-checked; } diff --git a/nix/haskell-arion-compose.nix b/nix/haskell-arion-compose.nix index 239d476..3b95767 100644 --- a/nix/haskell-arion-compose.nix +++ b/nix/haskell-arion-compose.nix @@ -6,6 +6,12 @@ let inherit (pkgs.haskell.lib) overrideCabal addBuildTools; in overrideCabal (addBuildTools (haskellPackages.callCabal2nix "arion-compose" ./.. {}) [pkgs.nix]) (o: o // { + src = pkgs.lib.sourceByRegex ../. [ + ".*[.]cabal" + "LICENSE" + "src/?.*" + "README.asciidoc" + ]; preCheck = '' export NIX_LOG_DIR=$TMPDIR export NIX_STATE_DIR=$TMPDIR diff --git a/nix/sources.json b/nix/sources.json index 116fd19..d73c3d0 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -36,15 +36,15 @@ "url_template": "https://github.com///archive/.tar.gz" }, "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", "homepage": "https://github.com/NixOS/nixpkgs", - "owner": "NixOS", + "owner": "hercules-ci", "repo": "nixpkgs", - "rev": "f8232491252438cd70b93554e31fe8238a573636", - "sha256": "019bz8dxp9d30ghmi9v0inn0p7mj3mia69lkh5cyivhhp1i0cs5i", + "rev": "35f40b20607428901e8edace7d4643d4ac11e876", + "sha256": "0w1ivhzszggq2j4fxbhdppvzj07zkginfnqdpkl6mdzvpwhy8f0d", "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///archive/.tar.gz", "version": "" }, diff --git a/src/haskell/lib/Arion/Images.hs b/src/haskell/lib/Arion/Images.hs index da2ad3c..9869d33 100644 --- a/src/haskell/lib/Arion/Images.hs +++ b/src/haskell/lib/Arion/Images.hs @@ -25,7 +25,8 @@ loadImages requestedImages = do isNew i = -- On docker, the image name is unmodified (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 traverse_ loadImage . filter isNew $ requestedImages diff --git a/src/haskell/testdata/Arion/NixSpec/arion-compose.json b/src/haskell/testdata/Arion/NixSpec/arion-compose.json index 83d62fc..972db6f 100644 --- a/src/haskell/testdata/Arion/NixSpec/arion-compose.json +++ b/src/haskell/testdata/Arion/NixSpec/arion-compose.json @@ -9,7 +9,7 @@ "PATH": "/usr/bin:/run/current-system/sw/bin/", "container": "docker" }, - "image": "webserver:", + "image": "localhost/webserver:", "ports": [ "8000:80" ], @@ -32,7 +32,7 @@ "images": [ { "imageExe": "", - "imageName": "webserver", + "imageName": "localhost/webserver", "imageTag": "" } ], diff --git a/src/nix/eval-composition.nix b/src/nix/eval-composition.nix index e76d7e5..db8b55c 100644 --- a/src/nix/eval-composition.nix +++ b/src/nix/eval-composition.nix @@ -12,7 +12,6 @@ let inherit (pkgs) lib; composition = lib.evalModules { - check = true; modules = builtinModules ++ modules; }; @@ -24,6 +23,7 @@ let _file = ./eval-composition.nix; key = ./eval-composition.nix; config._module.args.pkgs = lib.mkIf (pkgs != null) (lib.mkForce pkgs); + config._module.args.check = true; config.host.nixStorePrefix = hostNixStorePrefix; config.host.uid = lib.toInt uid; }; diff --git a/src/nix/modules/composition/composition.nix b/src/nix/modules/composition/composition.nix index fa46617..37d2854 100644 --- a/src/nix/modules/composition/composition.nix +++ b/src/nix/modules/composition/composition.nix @@ -8,6 +8,9 @@ let in { options = { + _module.args = mkOption { + internal = true; + }; project.name = mkOption { description = '' Name of the project. diff --git a/src/nix/modules/service/image.nix b/src/nix/modules/service/image.nix index 1f1e755..8700396 100644 --- a/src/nix/modules/service/image.nix +++ b/src/nix/modules/service/image.nix @@ -104,8 +104,8 @@ in }; image.name = mkOption { type = str; - default = config.service.name; - defaultText = lib.literalExpression or lib.literalExample "config.service.name"; + default = "localhost/" + config.service.name; + defaultText = lib.literalExpression or lib.literalExample ''"localhost/" + config.service.name''; description = '' A human readable name for the docker image. diff --git a/tests/arion-test/default.nix b/tests/arion-test/default.nix index fa87ed2..9c7a14a 100644 --- a/tests/arion-test/default.nix +++ b/tests/arion-test/default.nix @@ -20,7 +20,7 @@ let in { name = "arion-test"; - machine = { pkgs, lib, ... }: { + nodes.machine = { pkgs, lib, ... }: { environment.systemPackages = [ pkgs.arion ] ++ lib.optional usePodman pkgs.docker; diff --git a/tests/default.nix b/tests/default.nix index 978585e..70012ac 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -30,7 +30,7 @@ recurseIntoAttrs { testWithPodman = if arionTestingFlags.nixosHasPodmanDockerSocket - then nixosTest (pkgs.callPackage ./arion-test { usePodman = true; }) + then nixosTest (import ./arion-test { usePodman = true; inherit pkgs lib; }) else {}; testBuild = arion.build { diff --git a/tests/nixos-virtualization-arion-test/arion-compose.nix b/tests/nixos-virtualization-arion-test/arion-compose.nix index 1965fa6..4597f81 100644 --- a/tests/nixos-virtualization-arion-test/arion-compose.nix +++ b/tests/nixos-virtualization-arion-test/arion-compose.nix @@ -18,6 +18,7 @@ # ]; service.ports = [ "9092:9092" ]; service.depends_on = [ "zookeeper" ]; + image.name = "localhost/kafka"; image.contents = [ (pkgs.runCommand "root" { } '' mkdir -p $out/bin @@ -41,6 +42,7 @@ # # volume.nocopy = true; # } # ]; + image.name = "localhost/zookeeper"; image.contents = [ (pkgs.buildEnv { name = "root"; @@ -51,7 +53,7 @@ }) ]; image.command = [ - "${pkgs.zookeeper.override { jre = pkgs.jdk8_headless; }}/bin/zkServer.sh" + "${pkgs.zookeeper}/bin/zkServer.sh" "--config" "${./zookeeper}" "start-foreground"