diff --git a/nixng/containers/website/default.nix b/nixng/containers/website/default.nix index fa8e1c0..0380b82 100644 --- a/nixng/containers/website/default.nix +++ b/nixng/containers/website/default.nix @@ -17,7 +17,7 @@ }; init.services.apache2 = { ensureSomething.link."documentRoot" = { - src = "${inputs.website.website."x86_64-linux".default}/redalder"; + src = "${inputs.website.website."x86_64-linux"}/redalder"; dst = "/var/www"; }; shutdownOnExit = true; diff --git a/terranix/containers/website/default.nix b/terranix/containers/website/default.nix index 2909566..36c9815 100644 --- a/terranix/containers/website/default.nix +++ b/terranix/containers/website/default.nix @@ -1,4 +1,4 @@ -{ pkgs, elib, vars, ... }: +{ pkgs, elib, vars, config', ... }: let inherit (elib) nfsVolume @@ -10,6 +10,9 @@ in vars = { flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}"; flake_sha = vars.flake_sha; + store_path = builtins.toJSON (builtins.mapAttrs (_: builtins.unsafeDiscardStringContext) { + website = config'.flake.nixngConfigurations.website.config.system.build.toplevel; + }); }; }; } diff --git a/terranix/containers/website/job.hcl b/terranix/containers/website/job.hcl index e4c2ad0..3f8cf0e 100644 --- a/terranix/containers/website/job.hcl +++ b/terranix/containers/website/job.hcl @@ -6,6 +6,12 @@ variable "flake_sha" { type = string } +variable "store_path" { + type = object({ + website = string + }) +} + job "website" { datacenters = [ "homelab-1" ] type = "service" @@ -61,6 +67,7 @@ job "website" { config { nix_flake_ref = "${var.flake_ref}#nixngConfigurations.website.config.system.build.toplevel" nix_flake_sha = var.flake_sha + nix_flake_store_path = var.store_path.website entrypoint = [ "init" ] }