From be4f230d157f36a529a7ba9cde6278482f0a11bb Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Wed, 17 Jul 2024 23:41:19 +0200 Subject: [PATCH] deployment.nix: init morph This allows deploying changes to the bornhack screens in a less manual fashion. This builds the same store path, except for the healthcheck-commands.txt injected by morph. --- nix/default.nix | 3 +++ nix/deployment.nix | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 nix/deployment.nix diff --git a/nix/default.nix b/nix/default.nix index 25562a0..d9a44ee 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -79,6 +79,9 @@ rec { rustc pkg-config stdenv.cc + + # Deployment + morph ]); }; } diff --git a/nix/deployment.nix b/nix/deployment.nix new file mode 100644 index 0000000..c4ed288 --- /dev/null +++ b/nix/deployment.nix @@ -0,0 +1,50 @@ +let + nixpkgs = (import ./sources.nix { inherit system; }).nixpkgs; + system = builtins.currentSystem; + pkgs = import nixpkgs { + inherit system; + overlays = [ (import ./overlay.nix) ]; + }; + pkgsAArch64 = import nixpkgs { + localSystem = system; + crossSystem = "aarch64-linux"; + overlays = [ (import ./overlay.nix) ]; + }; + + common = { + # https://github.com/DBCDK/morph/issues/106 + nixpkgs.pkgs = pkgsAArch64; + nixpkgs.localSystem.system = "aarch64-linux"; + + imports = [ ./configuration-cm3.nix ]; + deployment.substituteOnDestination = true; + deployment.targetUser = "root"; + }; +in +{ + network = { + inherit pkgs; + }; + + "screen1" = { config, pkgs, ... }: common // { + deployment.targetHost = "root@n1.screens.wip.bar"; + }; + "screen2" = { config, pkgs, ... }: common // { + deployment.targetHost = "root@n2.screens.wip.bar"; + }; + "screen3" = { config, pkgs, ... }: common // { + deployment.targetHost = "root@n3.screens.wip.bar"; + }; + "screen4" = { config, pkgs, ... }: common // { + deployment.targetHost = "root@n4.screens.wip.bar"; + }; + "screen5" = { config, pkgs, ... }: common // { + deployment.targetHost = "root@n5.screens.wip.bar"; + }; + "screen6" = { config, pkgs, ... }: common // { + deployment.targetHost = "root@n6.screens.wip.bar"; + }; + "screen7" = { config, pkgs, ... }: common // { + deployment.targetHost = "root@n7.screens.wip.bar"; + }; +}