feat: streams module (WIP)
This commit is contained in:
parent
dedd95c442
commit
9624a019bd
6 changed files with 342 additions and 2 deletions
91
modules/streams/options.nix
Normal file
91
modules/streams/options.nix
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
args@{ config, lib, pkgs, ... }:
|
||||
{
|
||||
imports = [ ../options.nix ];
|
||||
|
||||
options.aether = {
|
||||
streams = {
|
||||
# INTERNAL
|
||||
_internal.streams-src = lib.mkOption {
|
||||
type = lib.types.pathInStore;
|
||||
description = ''
|
||||
The source repository of (streams).
|
||||
'';
|
||||
};
|
||||
|
||||
_internal.vendorHash = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
The vendor hash to use when finding PHP dependencies.
|
||||
'';
|
||||
};
|
||||
|
||||
# OPTIONS
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
default = pkgs.callPackage ./package.nix {
|
||||
src = config.aether.streams._internal.streams-src;
|
||||
vendorHash = config.aether.streams._internal.vendorHash;
|
||||
inherit (config.aether.streams) addonRepos themeRepos;
|
||||
};
|
||||
description = ''
|
||||
The (streams) package to use.
|
||||
|
||||
The derivation must be built in a precise way to be compatible with
|
||||
this module; see the package.nix file for details.
|
||||
'';
|
||||
};
|
||||
|
||||
subdomain = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = "streams";
|
||||
description = ''
|
||||
The subdomain to host the (streams) instance under.
|
||||
|
||||
If null, then (streams) is hosted at the domain itself.
|
||||
'';
|
||||
};
|
||||
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "streams";
|
||||
description = ''
|
||||
The user to run (streams) with.
|
||||
'';
|
||||
};
|
||||
|
||||
createUser = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to create the (streams) user automatically.
|
||||
'';
|
||||
};
|
||||
|
||||
addonRepos = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.pathInStore;
|
||||
default = [];
|
||||
defaultText = "[ <streams-addons> ]";
|
||||
description = ''
|
||||
A list of repositories containing addons.
|
||||
|
||||
The official addon repository is provided by default.
|
||||
'';
|
||||
};
|
||||
|
||||
themeRepos = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.pathInStore;
|
||||
default = [];
|
||||
description = ''
|
||||
A list of repositories containing themes.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config.assertions = lib.mkIf config.aether.https [
|
||||
{
|
||||
assertion = !(builtins.isNull config.aether.acmeEmail);
|
||||
message = "HTTPS support requires providing a contact email";
|
||||
}
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue