Compare commits
2 Commits
8748015acc
...
8d623692c7
Author | SHA1 | Date | |
---|---|---|---|
8d623692c7 | |||
9ee8585716 |
@ -19,6 +19,14 @@
|
||||
generateNixosSystem = name: nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
({ ... }: {
|
||||
/*
|
||||
Make the contents of the flake availiable to modules.
|
||||
Useful for having the monitoring server scraping the
|
||||
target config from all other servers automatically.
|
||||
*/
|
||||
_module.args._nixfiles = self;
|
||||
})
|
||||
./configuration/common
|
||||
({ ... }: {
|
||||
nixpkgs.overlays = [
|
||||
|
@ -1,12 +0,0 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
networking.hostName = "mail-1";
|
||||
|
||||
clerie.monitoring = {
|
||||
enable = true;
|
||||
id = "208";
|
||||
pubkey = "s2GT9iYQmuiwkZ04KzSqqlIEbUJ6CT6i4htCjWYt2xs=";
|
||||
nixos = false;
|
||||
};
|
||||
}
|
@ -1,9 +1,19 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{ config, pkgs, lib, _nixfiles, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
hosts = (import ../../lib/hosts.nix { inherit pkgs; }).hosts;
|
||||
hosts = _nixfiles.nixosConfigurations // {
|
||||
"mail-1".config = {
|
||||
networking.hostName = "mail-1";
|
||||
clerie.monitoring = {
|
||||
enable = true;
|
||||
id = "208";
|
||||
pubkey = "s2GT9iYQmuiwkZ04KzSqqlIEbUJ6CT6i4htCjWYt2xs=";
|
||||
nixos = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
monitoringHosts = filterAttrs (name: host:
|
||||
attrByPath ["clerie" "monitoring" "enable"] false host.config)
|
||||
|
@ -1,26 +0,0 @@
|
||||
{ pkgs ? import ../pkgs {} }:
|
||||
|
||||
with pkgs.lib;
|
||||
|
||||
rec {
|
||||
hostsDir = ../hosts;
|
||||
|
||||
hostNames = attrNames (
|
||||
filterAttrs (
|
||||
name: type: type == "directory"
|
||||
) (
|
||||
builtins.readDir hostsDir
|
||||
)
|
||||
);
|
||||
|
||||
hosts = listToAttrs (
|
||||
map (
|
||||
hostName: nameValuePair hostName (
|
||||
import (pkgs.path + "/nixos") {
|
||||
configuration = import (hostsDir + "/${hostName}/configuration.nix");
|
||||
system = "x86_64-linux";
|
||||
}
|
||||
)
|
||||
) hostNames
|
||||
);
|
||||
}
|
Loading…
Reference in New Issue
Block a user