From cf9158ab77cbfa701a60f485d3c2bc8de9a894e0 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 8 May 2023 19:04:26 -0700 Subject: module for homelab --- configs/homelab.toml | 1 + modules/homelab/default.nix | 4 ++++ modules/homelab/domain.nix | 17 +++++++++++++++++ nix/mkSystem.nix | 1 + 4 files changed, 23 insertions(+) create mode 100644 configs/homelab.toml create mode 100644 modules/homelab/default.nix create mode 100644 modules/homelab/domain.nix diff --git a/configs/homelab.toml b/configs/homelab.toml new file mode 100644 index 0000000..1438c74 --- /dev/null +++ b/configs/homelab.toml @@ -0,0 +1 @@ +domain = "fcuny.xyz" diff --git a/modules/homelab/default.nix b/modules/homelab/default.nix new file mode 100644 index 0000000..d60b99f --- /dev/null +++ b/modules/homelab/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + imports = [ ./domain.nix ]; +} diff --git a/modules/homelab/domain.nix b/modules/homelab/domain.nix new file mode 100644 index 0000000..2f0acfa --- /dev/null +++ b/modules/homelab/domain.nix @@ -0,0 +1,17 @@ +{ lib, config, self, ... }: +let + inherit (builtins) readFile fromTOML; +in +{ + options = with lib; { + homelab.domain = mkOption { + type = types.str; + default = null; + description = "Domain"; + }; + }; + + config = { + homelab.domain = (fromTOML (readFile "${self}/configs/homelab.toml")).domain; + }; +} diff --git a/nix/mkSystem.nix b/nix/mkSystem.nix index 9b5fcd5..1403538 100644 --- a/nix/mkSystem.nix +++ b/nix/mkSystem.nix @@ -9,6 +9,7 @@ inputs.nixpkgs.lib.nixosSystem { modules = [ "${self}/modules" "${self}/hosts/${hostname}" + "${self}/modules/homelab" ./private-wireguard.nix { networking.hostName = hostname; -- cgit v1.2.3