From bd63433ecc879b79437717943b19f49a7a024dae Mon Sep 17 00:00:00 2001 From: Niten Date: Wed, 3 Mar 2021 23:04:31 +0000 Subject: [PATCH] Added nixops with deployment for russell --- nixops/common.nix | 29 +++++++++++++++++++++++++++++ nixops/russell.nix | 19 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 nixops/common.nix create mode 100644 nixops/russell.nix diff --git a/nixops/common.nix b/nixops/common.nix new file mode 100644 index 0000000..86b948c --- /dev/null +++ b/nixops/common.nix @@ -0,0 +1,29 @@ +let + home-manager-package = builtins.fetchGit { + url = "https://github.com/nix-community/home-manager.git"; + ref = "release-20.09"; + }; + + pkgs = builtins.fetchGit { + url = "https://github.com/NixOS/nixpkgs.git"; + ref = "release-20.09"; + }; + + initialize = import ../initialize.nix; + + host-config = ip: config: + { ... }: { + imports = [ + (initialize { + hostname = config.hostname; + profile = config.profile; + site = config.site; + domain = config.domain; + home-manager-package = home-manager-package; + }) + ]; + + deployment.targetHost = ip; + }; + +in { host-config = host-config; } diff --git a/nixops/russell.nix b/nixops/russell.nix new file mode 100644 index 0000000..5263146 --- /dev/null +++ b/nixops/russell.nix @@ -0,0 +1,19 @@ +let + common = import ./common.nix; + domain = "rus.selby.ca"; + site = "russell"; + + russell-host-config = ip: hostname: profile: + common.host-config ip { + hostname = hostname; + profile = profile; + domain = domain; + site = site; + }; + +in { + network.description = "Russell home network."; + + clunk = russell-host-config "10.0.0.1" "clunk" "server"; + plato = russell-host-config "10.0.0.102" "plato" "server"; +}