forked from Fediversity/Fediversity
closes #93. note that this includes classes: - `nixos` - `nixosTest` - `nixops4Resource` - `nixops4Deployment` .. and my (made-up, as per the [docs](https://ryantm.github.io/nixpkgs/module-system/module-system/#module-system-lib-evalModules-param-class)): - `nix-unit` - `package` .. while i did not manage to cover: - service tests, given `pkgs.nixosTest` seemed to not actually like `_class = "nixosTest"` (?!) ... nor #93's mentioned destructured arguments for that matter, as per Fediversity/Fediversity#93 (comment) - let me know if that is still desired as well. Reviewed-on: Fediversity/Fediversity#398 Reviewed-by: Valentin Gagarin <valentin.gagarin@tweag.io> Co-authored-by: Kiara Grouwstra <kiara@procolix.eu> Co-committed-by: Kiara Grouwstra <kiara@procolix.eu>
68 lines
1.9 KiB
Nix
68 lines
1.9 KiB
Nix
{ lib, config, ... }:
|
|
|
|
let
|
|
inherit (lib) mkOption;
|
|
inherit (lib.types) types;
|
|
|
|
in
|
|
{
|
|
_class = "nixos";
|
|
|
|
imports = [
|
|
./garage
|
|
./mastodon
|
|
./pixelfed
|
|
./peertube
|
|
];
|
|
|
|
options = {
|
|
fediversity = {
|
|
domain = mkOption {
|
|
type = types.str;
|
|
description = ''
|
|
root domain for the Fediversity services
|
|
|
|
For instance, if this option is set to `foo.example.com`, then
|
|
Pixelfed might be under `pixelfed.foo.example.com`.
|
|
'';
|
|
};
|
|
|
|
temp = mkOption {
|
|
description = "options that are only used while developing; should be removed eventually";
|
|
default = { };
|
|
type = types.submodule {
|
|
options = {
|
|
cores = mkOption {
|
|
description = "number of cores; should be obtained from NixOps4";
|
|
type = types.int;
|
|
};
|
|
|
|
## NOTE: In practice, we will want to plug our services to a central
|
|
## authentication service, eg. LDAP. In the meantime, for the demo
|
|
## effect (and for testing, tbh), we need a way to inject an initial
|
|
## user into our services.
|
|
initialUser = {
|
|
username = mkOption {
|
|
type = types.str;
|
|
description = "Username of the initial user";
|
|
};
|
|
displayName = mkOption {
|
|
type = types.str;
|
|
description = "Name of the initial user, for humans";
|
|
default = config.fediversity.temp.initialUser.name;
|
|
};
|
|
email = mkOption {
|
|
type = types.str;
|
|
description = "Email of the initial user";
|
|
};
|
|
passwordFile = mkOption {
|
|
type = types.path;
|
|
description = "Path to a file containing the initial user's password";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|