From 7326e0bb2268b214474868b6ae523e6c4da21d92 Mon Sep 17 00:00:00 2001 From: kat witch Date: Fri, 27 Aug 2021 03:54:27 +0100 Subject: [PATCH] Deprecate meta.nix entirely :) --- config/hosts/athame/meta.nix | 17 ----------------- config/hosts/athame/nixos.nix | 13 +++++++++++++ config/hosts/beltane/meta.nix | 20 -------------------- config/hosts/beltane/nixos.nix | 13 +++++++++++++ config/hosts/dummy/meta.nix | 6 ------ config/hosts/ostara/meta.nix | 19 ------------------- config/hosts/ostara/nixos.nix | 13 +++++++++++++ config/hosts/rinnosuke/meta.nix | 6 ------ config/hosts/samhain/meta.nix | 19 ------------------- config/hosts/samhain/nixos.nix | 13 +++++++++++++ config/hosts/to-do/mabon/meta.nix | 21 --------------------- config/hosts/yule/meta.nix | 19 ------------------- config/hosts/yule/nixos.nix | 13 +++++++++++++ default.nix | 8 +++++++- 14 files changed, 72 insertions(+), 128 deletions(-) delete mode 100644 config/hosts/athame/meta.nix delete mode 100644 config/hosts/beltane/meta.nix delete mode 100644 config/hosts/dummy/meta.nix delete mode 100644 config/hosts/ostara/meta.nix delete mode 100644 config/hosts/rinnosuke/meta.nix delete mode 100644 config/hosts/samhain/meta.nix delete mode 100644 config/hosts/to-do/mabon/meta.nix delete mode 100644 config/hosts/yule/meta.nix diff --git a/config/hosts/athame/meta.nix b/config/hosts/athame/meta.nix deleted file mode 100644 index aa1666ba..00000000 --- a/config/hosts/athame/meta.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ config, lib, kw, ... }: with lib; { - deploy.targets.infra = { - tf = { - resources.athame = { - provider = "null"; - type = "resource"; - connection = { - port = head config.network.nodes.athame.services.openssh.ports; - host = config.network.nodes.athame.network.addresses.public.ipv4.address; - }; - }; - }; - }; - network.nodes.athame = { - imports = kw.nodeImport "athame"; - }; -} diff --git a/config/hosts/athame/nixos.nix b/config/hosts/athame/nixos.nix index 5d229924..33ad1ed3 100644 --- a/config/hosts/athame/nixos.nix +++ b/config/hosts/athame/nixos.nix @@ -34,6 +34,19 @@ with lib; services.znc ]; + # Terraform + + deploy.tf = { + resources.athame = { + provider = "null"; + type = "resource"; + connection = { + port = head config.services.openssh.ports; + host = config.network.addresses.public.ipv4.address; + }; + }; + }; + # File Systems and Swap fileSystems = { diff --git a/config/hosts/beltane/meta.nix b/config/hosts/beltane/meta.nix deleted file mode 100644 index db79e8f7..00000000 --- a/config/hosts/beltane/meta.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, lib, kw, ... }: with lib; { - config = { - deploy.targets.beltane = { - tf = { - resources.beltane = { - provider = "null"; - type = "resource"; - connection = { - port = head config.network.nodes.beltane.services.openssh.ports; - host = config.network.nodes.beltane.network.addresses.private.ipv4.address; - }; - }; - }; - }; - network.nodes.beltane = { - imports = kw.nodeImport "beltane"; - }; - }; -} - diff --git a/config/hosts/beltane/nixos.nix b/config/hosts/beltane/nixos.nix index 605f4ead..2c2d908f 100644 --- a/config/hosts/beltane/nixos.nix +++ b/config/hosts/beltane/nixos.nix @@ -23,6 +23,19 @@ with lib; services.zfs ]; + # Terraform + + deploy.tf = { + resources.beltane = { + provider = "null"; + type = "resource"; + connection = { + port = head config.services.openssh.ports; + host = config.network.addresses.private.ipv4.address; + }; + }; + }; + # File Systems and Swap boot.supportedFilesystems = singleton "zfs"; diff --git a/config/hosts/dummy/meta.nix b/config/hosts/dummy/meta.nix deleted file mode 100644 index e872a11a..00000000 --- a/config/hosts/dummy/meta.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ config, lib, kw, ... }: with lib; { - deploy.targets.dummy.enable = false; - network.nodes.dummy = { - imports = kw.nodeImport "dummy"; - }; -} diff --git a/config/hosts/ostara/meta.nix b/config/hosts/ostara/meta.nix deleted file mode 100644 index 4a4eea69..00000000 --- a/config/hosts/ostara/meta.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, lib, kw, ... }: with lib; { - config = { - deploy.targets.ostara = { - tf = { - resources.ostara = { - provider = "null"; - type = "resource"; - connection = { - port = head config.network.nodes.ostara.services.openssh.ports; - host = config.network.nodes.ostara.network.addresses.private.ipv4.address; - }; - }; - }; - }; - network.nodes.ostara = { - imports = kw.nodeImport "ostara"; - }; - }; -} diff --git a/config/hosts/ostara/nixos.nix b/config/hosts/ostara/nixos.nix index fa8c05e8..b925e0eb 100644 --- a/config/hosts/ostara/nixos.nix +++ b/config/hosts/ostara/nixos.nix @@ -10,6 +10,19 @@ with lib; services.kattv ]; + # Terraform + + deploy.tf = { + resources.ostara = { + provider = "null"; + type = "resource"; + connection = { + port = head config.services.openssh.ports; + host = config.network.addresses.private.ipv4.address; + }; + }; + }; + # File Systems and Swap fileSystems = { diff --git a/config/hosts/rinnosuke/meta.nix b/config/hosts/rinnosuke/meta.nix deleted file mode 100644 index 9b760342..00000000 --- a/config/hosts/rinnosuke/meta.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ config, lib, kw, ... }: { - network.nodes.rinnosuke = { - imports = kw.nodeImport "rinnosuke"; - }; -} - diff --git a/config/hosts/samhain/meta.nix b/config/hosts/samhain/meta.nix deleted file mode 100644 index 20c64be4..00000000 --- a/config/hosts/samhain/meta.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, lib, kw, ... }: with lib; { - config = { - deploy.targets.samhain = { - tf = { - resources.samhain = { - provider = "null"; - type = "resource"; - connection = { - port = head config.network.nodes.samhain.services.openssh.ports; - host = config.network.nodes.samhain.network.addresses.private.ipv4.address; - }; - }; - }; - }; - network.nodes.samhain = { - imports = kw.nodeImport "samhain"; - }; - }; -} diff --git a/config/hosts/samhain/nixos.nix b/config/hosts/samhain/nixos.nix index e8c89d2e..976e4e82 100644 --- a/config/hosts/samhain/nixos.nix +++ b/config/hosts/samhain/nixos.nix @@ -24,6 +24,19 @@ in services.zfs ]; + # Terraform + + deploy.tf = { + resources.samhain = { + provider = "null"; + type = "resource"; + connection = { + port = head config.services.openssh.ports; + host = config.network.addresses.private.ipv4.address; + }; + }; + }; + # File Systems and Swap boot.supportedFilesystems = [ "zfs" "xfs" ]; diff --git a/config/hosts/to-do/mabon/meta.nix b/config/hosts/to-do/mabon/meta.nix deleted file mode 100644 index f3ce909e..00000000 --- a/config/hosts/to-do/mabon/meta.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ lib, config, ... }: with lib; { - deploy.targets.mabon = { - nodeNames = lib.singleton "mabon"; - tf = { - resources.mabon = { - provider = "null"; - type = "resource"; - connection = { - port = 62954; - host = "192.168.1.119"; - }; - }; - }; - }; - network.nodes.mabon = { - imports = lib.hostImport "mabon"; - networking = { - hostName = "mabon"; - }; - }; -} diff --git a/config/hosts/yule/meta.nix b/config/hosts/yule/meta.nix deleted file mode 100644 index a5849255..00000000 --- a/config/hosts/yule/meta.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, lib, kw, ... }: with lib; { - config = { - deploy.targets.yule = { - tf = { - resources.yule = { - provider = "null"; - type = "resource"; - connection = { - port = head config.network.nodes.yule.services.openssh.ports; - host = config.network.nodes.yule.network.addresses.private.ipv4.address; - }; - }; - }; - }; - network.nodes.yule = { - imports = kw.nodeImport "yule"; - }; - }; -} diff --git a/config/hosts/yule/nixos.nix b/config/hosts/yule/nixos.nix index 5af503ca..ba8f22df 100644 --- a/config/hosts/yule/nixos.nix +++ b/config/hosts/yule/nixos.nix @@ -17,6 +17,19 @@ with lib; services.zfs ]; + # Terraform + + deploy.tf = { + resources.yule = { + provider = "null"; + type = "resource"; + connection = { + port = head config.services.openssh.ports; + host = config.network.addresses.private.ipv4.address; + }; + }; + }; + # File Systems and Swap boot.supportedFilesystems = singleton "zfs"; diff --git a/default.nix b/default.nix index 78ed7f1f..af8eedfe 100644 --- a/default.nix +++ b/default.nix @@ -50,6 +50,8 @@ let _module.args = { pkgs = lib.mkDefault pkgs; }; + + deploy.targets.dummy.enable = false; }; }; @@ -57,7 +59,11 @@ let eval = lib.evalModules { modules = lib.singleton metaConfig ++ lib.attrValues (removeAttrs xarg.targets [ "common" ]) - ++ lib.attrValues xarg.hosts + ++ (map (host: { + network.nodes.${host} = { + imports = config.lib.kw.nodeImport host; + }; + }) (lib.attrNames xarg.hosts)) ++ lib.singleton ./config/modules/meta/default.nix; specialArgs = {