Files
Olympus/system/flake.nix
2024-10-18 18:17:47 -05:00

80 lines
2.2 KiB
Nix
Executable File

{
description = "Unified System Configuration";
inputs = {
srvcs.url = "./services";
pckgs.url = "./packages";
prgms.url = "./programs";
diskoConfig.url = "./disko";
impermanenceConfig.url = "./impermanence";
};
outputs = { self, ... }@inputs: {
nixosModule = { config, lib, pkgs, core_inputs, ... }: {
imports = [
./configuration
./configuration/${core_inputs.host}/hardware-configuration.nix
# inputs.diskoConfig.module
# inputs.impermanenceConfig.module
inputs.srvcs.module
inputs.pckgs.module
inputs.prgms.module
./first_boot
];
options = {
sysconfig.opts = {
host = lib.options.mkOption {
type = lib.types.str;
default = null;
};
username = lib.options.mkOption {
type = lib.types.str;
default = "nathan";
};
devices = {
main = lib.options.mkOption {
type = lib.types.str;
default = null;
};
bonus = lib.options.mkOption {
type = lib.types.attrsOf lib.types.str;
default = null;
};
};
};
};
config = {
assertions = [
{
assertion = (config.sysconfig.opts.host != null);
message = "host cannot be null";
}
{
assertion = (config.sysconfig.opts.devices.main != null);
message = "devices.main cannot be null";
}
];
networking.hostName = lib.mkDefault config.sysconfig.opts.host;
#users.users.${config.sysconfig.opts.username} = {
#};
};
};
};
}