From cfddc324240836282ed1f775e2d6aadcb222ed89 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Fri, 21 Jul 2023 21:56:19 +0100 Subject: [PATCH] fmt: directly access the inputs inside each machine. This allows us to move the inputs to teh individual applications, making them more server agnostic. --- applications/email.nix | 3 ++- applications/games/minecraft.nix | 3 ++- applications/ldap/ldap_backend.nix | 3 ++- flake.nix | 36 +++++++----------------------- machines/_base.nix | 5 ++++- 5 files changed, 18 insertions(+), 32 deletions(-) diff --git a/applications/email.nix b/applications/email.nix index e7dfcd1..0789f4d 100644 --- a/applications/email.nix +++ b/applications/email.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ...}: with lib; +{ config, pkgs, lib, inputs, ...}: with lib; let cfg = config.services.skynet_email; @@ -16,6 +16,7 @@ ./dns.nix ./acme.nix ./nginx.nix + inputs.simple-nixos-mailserver.nixosModule ]; options.services.skynet_email = { diff --git a/applications/games/minecraft.nix b/applications/games/minecraft.nix index 87c4b39..c8cdf8b 100644 --- a/applications/games/minecraft.nix +++ b/applications/games/minecraft.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, inputs, ... }: with lib; let cfg = config.services.skynet_games_minecraft; @@ -12,6 +12,7 @@ ../dns.nix ../firewall.nix ../nginx.nix + inputs.arion.nixosModules.arion ]; options.services.skynet_games_minecraft = { diff --git a/applications/ldap/ldap_backend.nix b/applications/ldap/ldap_backend.nix index beba010..a6832ce 100644 --- a/applications/ldap/ldap_backend.nix +++ b/applications/ldap/ldap_backend.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, lib, inputs, ... }: with lib; let cfg = config.services.ldap_backend; @@ -9,6 +9,7 @@ ../acme.nix ../dns.nix ../nginx.nix + inputs.skynet_ldap_backend.nixosModule."x86_64-linux" ]; options.services.ldap_backend = { diff --git a/flake.nix b/flake.nix index 3b727df..272e82d 100644 --- a/flake.nix +++ b/flake.nix @@ -22,18 +22,7 @@ skynet_website.url = "gitlab:compsoc%2Fskynet/website?host=gitlab.skynet.ie"; }; - outputs = { self, nixpkgs, - # these are the nixos modules from otehr projects - agenix, - arion, - simple-nixos-mailserver, - skynet_ldap_backend, - skynet_ldap_frontend, - ... - }@inputs: - let - system = "x86_64-linux"; - in { + outputs = { self, nixpkgs, ... } @inputs: { # https://github.com/zhaofengli/colmena # colmena apply --on agentjones # colmena apply --on @dns @@ -41,22 +30,16 @@ colmena = { meta = { nixpkgs = import nixpkgs { - system = system; + system = "x86_64-linux"; overlays = []; }; specialArgs = { - inherit inputs; - }; + inherit inputs; + }; }; # installed for each machine - defaults = { - imports = [ - ./machines/_base.nix - # for the secrets - agenix.nixosModule - ]; - }; + defaults = import ./machines/_base.nix ; # firewall machiene agentjones = import ./machines/agentjones.nix; @@ -71,13 +54,10 @@ galatea = import ./machines/galatea.nix; # Game host - optimus.imports = [./machines/optimus.nix arion.nixosModules.arion]; + optimus = import ./machines/optimus.nix; # LDAP host - kitt.imports = [ - ./machines/kitt.nix - skynet_ldap_backend.nixosModule.${system} - ]; + kitt = import ./machines/kitt.nix; # Gitlab glados = import ./machines/glados.nix; @@ -86,7 +66,7 @@ wheatly = import ./machines/wheatly.nix; # email - gir.imports = [ ./machines/gir.nix simple-nixos-mailserver.nixosModule]; + gir = import ./machines/gir.nix; # backup 1 neuromancer = import ./machines/neuromancer.nix; diff --git a/machines/_base.nix b/machines/_base.nix index 7f63535..c45fab3 100644 --- a/machines/_base.nix +++ b/machines/_base.nix @@ -1,9 +1,12 @@ -{ pkgs, modulesPath, config, options, ... }: +{ pkgs, modulesPath, config, options, inputs, ... }: { imports = [ (modulesPath + "/virtualisation/proxmox-lxc.nix") + # for the secrets + inputs.agenix.nixosModule + # every sever may need the firewall config stuff ../applications/firewall.nix