51 lines
1.7 KiB
Nix
51 lines
1.7 KiB
Nix
{ lib, ... }:
|
|
let
|
|
systemsDir = ../../../systems;
|
|
isIgnoredSystemDir = name: lib.hasPrefix "_" name || lib.hasPrefix "." name;
|
|
systemNames = lib.attrNames (
|
|
lib.filterAttrs
|
|
(name: type:
|
|
type == "directory"
|
|
&& !isIgnoredSystemDir name
|
|
&& builtins.pathExists (systemsDir + "/${name}/cfg.nix"))
|
|
(builtins.readDir systemsDir)
|
|
);
|
|
in with lib; {
|
|
options.usercfg = import ./user.nix {inherit lib;};
|
|
options.syscfg = {
|
|
hostname = mkOption { type = types.str; };
|
|
type = mkOption {
|
|
type = types.enum [ "nixos" "macos" "home" ];
|
|
default = "nixos";
|
|
};
|
|
system = mkOption {
|
|
type = types.enum [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
|
default = "x86_64-linux";
|
|
description = "Nix platform used to evaluate this host.";
|
|
};
|
|
defaultUser = mkOption { type = types.str; };
|
|
make = import ./make.nix {inherit lib;};
|
|
net = import ./net.nix {inherit lib;};
|
|
users = mkOption {
|
|
type = types.listOf (types.submodule { options = import ./user.nix {inherit lib;}; });
|
|
default = [ ];
|
|
};
|
|
peers = mkOption {
|
|
default = map (name: import (systemsDir + "/${name}/cfg.nix")) systemNames;
|
|
};
|
|
server = mkOption {
|
|
type = types.oneOf [ types.bool (types.submodule { options = import ./server.nix {inherit lib;}; }) ];
|
|
default = false;
|
|
};
|
|
monitoring = mkOption {
|
|
type = types.submodule { options = import ./monitoring.nix { inherit lib; }; };
|
|
default = { };
|
|
};
|
|
media = mkOption {
|
|
type = types.submodule { options = import ./media.nix { inherit lib; }; };
|
|
default = {};
|
|
};
|
|
extra = import ./extra.nix {inherit lib;};
|
|
};
|
|
}
|