mirror of https://gitlab.crans.org/nounous/nixos
First attempt at a service configuration
parent
1c0c29b862
commit
8ffb2cee36
|
|
@ -38,6 +38,7 @@
|
||||||
./modules
|
./modules
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
];
|
];
|
||||||
|
additionalPackages = [ ./pkgs ];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
apprentix = nixosSystem {
|
apprentix = nixosSystem {
|
||||||
|
|
@ -47,7 +48,7 @@
|
||||||
|
|
||||||
belenios = nixosSystem {
|
belenios = nixosSystem {
|
||||||
specialArgs = inputs;
|
specialArgs = inputs;
|
||||||
modules = [ ./hosts/vm/belenios ] ++ baseModules;
|
modules = [ ./hosts/vm/belenios ] ++ baseModules ++ additionalPackages;
|
||||||
};
|
};
|
||||||
|
|
||||||
collabora = nixosSystem {
|
collabora = nixosSystem {
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,18 @@
|
||||||
{ lib, config, ... }:
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.belenios;
|
cfg = config.services.belenios;
|
||||||
|
|
||||||
inherit (lib) mkEnableOption mkOption mkIf;
|
configFile = lib.writeText "beleniosserver.conf" cfg.config;
|
||||||
|
|
||||||
|
inherit (lib) mkEnableOption mkPackageOption mkOption mkIf;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.services.belenios = {
|
options.services.belenios = {
|
||||||
enable = mkEnableOption "Whether to enable the Belenios Web server.";
|
enable = mkEnableOption "Whether to enable the Belenios Web server.";
|
||||||
|
|
||||||
|
package = mkPackageOption pkgs "belenios";
|
||||||
|
|
||||||
config = mkOption {
|
config = mkOption {
|
||||||
types = lib.types.str;
|
types = lib.types.str;
|
||||||
description = ''
|
description = ''
|
||||||
|
|
@ -124,6 +129,23 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
systemd.services.belenios = {};
|
users.users.belenios = {
|
||||||
|
description = "Belenios Web server service user";
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "belenios";
|
||||||
|
};
|
||||||
|
users.groups.belenios = { };
|
||||||
|
|
||||||
|
systemd.services.belenios = {
|
||||||
|
description = "Belenios Web server service";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "network.target" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${cfg.package}/bin/belenios-server -c ${configFile}";
|
||||||
|
Restart = "always";
|
||||||
|
User = "belenios";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue