Adapt website to new Nomad Nix patch

Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
Magic_RB 2023-07-10 21:37:08 +02:00
parent afcdff1b47
commit 2d92a13070
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E
3 changed files with 12 additions and 2 deletions

View file

@ -17,7 +17,7 @@
}; };
init.services.apache2 = { init.services.apache2 = {
ensureSomething.link."documentRoot" = { ensureSomething.link."documentRoot" = {
src = "${inputs.website.website."x86_64-linux".default}/redalder"; src = "${inputs.website.website."x86_64-linux"}/redalder";
dst = "/var/www"; dst = "/var/www";
}; };
shutdownOnExit = true; shutdownOnExit = true;

View file

@ -1,4 +1,4 @@
{ pkgs, elib, vars, ... }: { pkgs, elib, vars, config', ... }:
let let
inherit (elib) inherit (elib)
nfsVolume nfsVolume
@ -10,6 +10,9 @@ in
vars = { vars = {
flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}"; flake_ref = "${vars.flake_host}?rev=${vars.flake_rev}&ref=${vars.flake_ref}";
flake_sha = vars.flake_sha; flake_sha = vars.flake_sha;
store_path = builtins.toJSON (builtins.mapAttrs (_: builtins.unsafeDiscardStringContext) {
website = config'.flake.nixngConfigurations.website.config.system.build.toplevel;
});
}; };
}; };
} }

View file

@ -6,6 +6,12 @@ variable "flake_sha" {
type = string type = string
} }
variable "store_path" {
type = object({
website = string
})
}
job "website" { job "website" {
datacenters = [ "homelab-1" ] datacenters = [ "homelab-1" ]
type = "service" type = "service"
@ -61,6 +67,7 @@ job "website" {
config { config {
nix_flake_ref = "${var.flake_ref}#nixngConfigurations.website.config.system.build.toplevel" nix_flake_ref = "${var.flake_ref}#nixngConfigurations.website.config.system.build.toplevel"
nix_flake_sha = var.flake_sha nix_flake_sha = var.flake_sha
nix_flake_store_path = var.store_path.website
entrypoint = [ "init" ] entrypoint = [ "init" ]
} }