78 lines
2.1 KiB
Nix
Executable File
78 lines
2.1 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
|
|
# inputs.diskoConfig.module
|
|
# inputs.impermanenceConfig.module
|
|
inputs.srvcs.module
|
|
inputs.pckgs.module
|
|
inputs.prgms.module
|
|
];
|
|
|
|
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} = {
|
|
|
|
#};
|
|
};
|
|
};
|
|
|
|
};
|
|
|
|
}
|