Commit 7020e1e1 authored by Profpatsch's avatar Profpatsch

containers/default: switch to overlay & add hydra result

Thanks to @aszlig for the patch.
parent 3015470d
let
# upstream package set & library
nixpkgs = import <nixpkgs> {};
# our own packages
pkgs = {
sangha = nixpkgs.callPackage ../packages/sangha {};
};
# evaluate the deployment config
eval = import <nixpkgs/nixos> {
configuration = { ... }: {
......@@ -16,21 +7,34 @@ let
org.techcultivation.deploy.database.enable = true;
org.techcultivation.deploy.database.buildDockerImage = true;
# This is a hidden module system attribute that can be used
# to add packages to the default package set.
# We add all packages from above so they can be referenced
# with e.g. `pkgs.sangha` in modules.
_module.args.pkgs = pkgs;
# our own packages
nixpkgs.overlays = [(self: _: {
sangha = self.callPackage ../packages/sangha {};
})];
};
};
};
inherit (eval.config._module.args) pkgs;
# TODO tmp
sanghaPostgresTemplate = eval.config.passthru;
# generated docker image for the sangha postgres server
sanghaPostgresDockerImage = eval.config.generated.dockerImages.sangha;
sanghaPostgresDockerImage = pkgs.runCommand "sangha-docker-image" {
image = eval.config.generated.dockerImages.sanghaPostgres;
}
# produces an output link for hydra
''
mkdir -p "$out/nix-support"
echo "file docker-image $image" \
> "$out/nix-support/hydra-build-products"
'';
in {
inherit sanghaPostgresTemplate pkgs sanghaPostgresDockerImage;
inherit sanghaPostgresTemplate sanghaPostgresDockerImage;
pkgs = { inherit (pkgs) sangha; };
downloads.dockerImages = {
sangha.postgres = sanghaPostgresDockerImage;
};
}
......@@ -146,13 +146,13 @@ in {
# configuration for generating a docker image
dockerConfig = {
generated.dockerImages.sangha =
generated.dockerImages.sanghaPostgres =
let dbDir = "/database";
uidGid = 999;
uidGidStr = toString uidGid;
in pkgs.dockerTools.buildImage {
name = "sangha";
name = "sangha-postgres";
tag = "unstable";
# contents of the docker image
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment