feat(selfhost/nextcloud): setting up the f*** nextcloud

This commit is contained in:
Raphael 2025-06-23 17:07:47 +02:00
parent a1bc1e4074
commit e881327e72
4 changed files with 67 additions and 4 deletions

View file

@ -49,10 +49,13 @@
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ nix.settings = {
download-buffer-size = 16777216;
experimental-features = [
"nix-command" "nix-command"
"flakes" "flakes"
]; ];
};
programs = { programs = {
zsh.enable = true; zsh.enable = true;

View file

@ -9,6 +9,7 @@
../../services/discord.nix ../../services/discord.nix
../../services/games.nix ../../services/games.nix
../../services/web.nix ../../services/web.nix
../../services/self_host.nix
]; ];
networking = { networking = {
@ -19,6 +20,9 @@
}; };
service = { service = {
selfhost = {
nextcloud = true;
};
forty_two.irc = true; forty_two.irc = true;
web.portefolio = true; web.portefolio = true;
minecraft = { minecraft = {

26
services/self_host.nix Normal file
View file

@ -0,0 +1,26 @@
{ inputs, config, pkgs, lib, ... }:
let
nextcloud = import ./self_host/nextcloud.nix {
inherit inputs config pkgs lib;
};
cfg = config.service.selfhost;
in
{
imports = [
nextcloud
];
config = {
services.nginx = {
enable = true;
};
};
options.service.selfhost = {
nextcloud = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Enable the nextcloud";
};
};
}

View file

@ -0,0 +1,30 @@
{ config, pkgs, lib, ... }:
let
cfg = config.service.selfhost.nextcloud;
dataDir = "/mnt/data/nextcloud";
in
{
environment.systemPackages = with pkgs; [
php
];
services = {
nextcloud = {
enable = true;
https = true;
package = pkgs.nextcloud31;
hostName = "nextcloud.enium.eu";
datadir = "/mnt/data/nextcloud/";
config = {
adminpassFile = "/etc/nextcloud-pass.txt";
adminuser = "OwnedByTheEniumTeam";
dbtype = "sqlite";
};
};
nginx.virtualHosts."nextcloud.enium.eu".enableACME = true;
nginx.virtualHosts."nextcloud.enium.eu".forceSSL = true;
nginx.virtualHosts."nextcloud.enium.eu".locations."~ \.php$".extraConfig = ''
fastcgi_pass unix:/run/phpfpm-nextcloud.sock;
'';
};
}