fmt: directly access the inputs inside each machine.

This allows us to move the inputs to teh individual applications, making them more server agnostic.
This commit is contained in:
silver 2023-07-21 21:56:19 +01:00
parent 4c99464bc4
commit cfddc32424
5 changed files with 18 additions and 32 deletions

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ...}: with lib; { config, pkgs, lib, inputs, ...}: with lib;
let let
cfg = config.services.skynet_email; cfg = config.services.skynet_email;
@ -16,6 +16,7 @@
./dns.nix ./dns.nix
./acme.nix ./acme.nix
./nginx.nix ./nginx.nix
inputs.simple-nixos-mailserver.nixosModule
]; ];
options.services.skynet_email = { options.services.skynet_email = {

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, inputs, ... }:
with lib; with lib;
let let
cfg = config.services.skynet_games_minecraft; cfg = config.services.skynet_games_minecraft;
@ -12,6 +12,7 @@
../dns.nix ../dns.nix
../firewall.nix ../firewall.nix
../nginx.nix ../nginx.nix
inputs.arion.nixosModules.arion
]; ];
options.services.skynet_games_minecraft = { options.services.skynet_games_minecraft = {

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, inputs, ... }:
with lib; with lib;
let let
cfg = config.services.ldap_backend; cfg = config.services.ldap_backend;
@ -9,6 +9,7 @@
../acme.nix ../acme.nix
../dns.nix ../dns.nix
../nginx.nix ../nginx.nix
inputs.skynet_ldap_backend.nixosModule."x86_64-linux"
]; ];
options.services.ldap_backend = { options.services.ldap_backend = {

View file

@ -22,18 +22,7 @@
skynet_website.url = "gitlab:compsoc%2Fskynet/website?host=gitlab.skynet.ie"; skynet_website.url = "gitlab:compsoc%2Fskynet/website?host=gitlab.skynet.ie";
}; };
outputs = { self, nixpkgs, outputs = { self, nixpkgs, ... } @inputs: {
# 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 {
# https://github.com/zhaofengli/colmena # https://github.com/zhaofengli/colmena
# colmena apply --on agentjones # colmena apply --on agentjones
# colmena apply --on @dns # colmena apply --on @dns
@ -41,7 +30,7 @@
colmena = { colmena = {
meta = { meta = {
nixpkgs = import nixpkgs { nixpkgs = import nixpkgs {
system = system; system = "x86_64-linux";
overlays = []; overlays = [];
}; };
specialArgs = { specialArgs = {
@ -50,13 +39,7 @@
}; };
# installed for each machine # installed for each machine
defaults = { defaults = import ./machines/_base.nix ;
imports = [
./machines/_base.nix
# for the secrets
agenix.nixosModule
];
};
# firewall machiene # firewall machiene
agentjones = import ./machines/agentjones.nix; agentjones = import ./machines/agentjones.nix;
@ -71,13 +54,10 @@
galatea = import ./machines/galatea.nix; galatea = import ./machines/galatea.nix;
# Game host # Game host
optimus.imports = [./machines/optimus.nix arion.nixosModules.arion]; optimus = import ./machines/optimus.nix;
# LDAP host # LDAP host
kitt.imports = [ kitt = import ./machines/kitt.nix;
./machines/kitt.nix
skynet_ldap_backend.nixosModule.${system}
];
# Gitlab # Gitlab
glados = import ./machines/glados.nix; glados = import ./machines/glados.nix;
@ -86,7 +66,7 @@
wheatly = import ./machines/wheatly.nix; wheatly = import ./machines/wheatly.nix;
# email # email
gir.imports = [ ./machines/gir.nix simple-nixos-mailserver.nixosModule]; gir = import ./machines/gir.nix;
# backup 1 # backup 1
neuromancer = import ./machines/neuromancer.nix; neuromancer = import ./machines/neuromancer.nix;

View file

@ -1,9 +1,12 @@
{ pkgs, modulesPath, config, options, ... }: { pkgs, modulesPath, config, options, inputs, ... }:
{ {
imports = [ imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix") (modulesPath + "/virtualisation/proxmox-lxc.nix")
# for the secrets
inputs.agenix.nixosModule
# every sever may need the firewall config stuff # every sever may need the firewall config stuff
../applications/firewall.nix ../applications/firewall.nix