mirror of
https://git.gay/xqtc/nixos-config
synced 2024-11-26 04:53:54 +01:00
Add nextcloud and some other stuff
This commit is contained in:
parent
5dea678ae1
commit
96fdaf151b
|
@ -73,6 +73,11 @@
|
|||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
boot.kernelModules = ["v4l2loopback"];
|
||||
boot.extraModulePackages = with config.boot.kernelPackages; [v4l2loopback];
|
||||
boot.extraModprobeConfig = ''
|
||||
options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
|
||||
'';
|
||||
|
||||
networking.hostName = "asmodeus"; # Define your hostname.
|
||||
# Pick only one of the below networking options.
|
||||
|
@ -105,6 +110,8 @@
|
|||
services.xserver.videoDrivers = ["nvidia"];
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
virtualisation.libvirtd.enable = true;
|
||||
programs.virt-manager.enable = true;
|
||||
|
||||
# Configure keymap in X11
|
||||
services.xserver.xkb.layout = "us";
|
||||
|
@ -163,6 +170,8 @@
|
|||
jellyfin
|
||||
jellyfin-web
|
||||
jellyfin-ffmpeg
|
||||
|
||||
v4l-utils
|
||||
];
|
||||
|
||||
#programs.nix-ld.enable = true;
|
||||
|
@ -181,6 +190,9 @@
|
|||
services.jellyfin.enable = true;
|
||||
services.jellyfin.user = "xqtc";
|
||||
|
||||
services.ollama.enable = true;
|
||||
services.ollama.acceleration = "cuda";
|
||||
|
||||
#services.calibre-web = {
|
||||
# enable = true;
|
||||
# user = "xqtc";
|
||||
|
@ -215,7 +227,7 @@
|
|||
|
||||
services.tailscale.enable = true;
|
||||
# Open ports in the firewall.
|
||||
networking.firewall.allowedTCPPorts = [2234 8096 8080 8082];
|
||||
networking.firewall.allowedTCPPorts = [2234 4747 8096 8080 8082];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
|
|
@ -16,6 +16,7 @@ with lib; {
|
|||
./uptime.nix
|
||||
./networking.nix
|
||||
./git.nix
|
||||
./nextcloud.nix
|
||||
./docker.nix
|
||||
./nfs.nix
|
||||
../../gc.nix
|
||||
|
|
130
hosts/x86_64-linux/beleth/nextcloud.nix
Normal file
130
hosts/x86_64-linux/beleth/nextcloud.nix
Normal file
|
@ -0,0 +1,130 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
"${fetchTarball {
|
||||
url = "https://github.com/onny/nixos-nextcloud-testumgebung/archive/fa6f062830b4bc3cedb9694c1dbf01d5fdf775ac.tar.gz";
|
||||
sha256 = "0gzd0276b8da3ykapgqks2zhsqdv4jjvbv97dsxg0hgrhb74z0fs";
|
||||
}}/nextcloud-extras.nix"
|
||||
];
|
||||
|
||||
services.nextcloud = {
|
||||
webserver = "caddy";
|
||||
};
|
||||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
identMap = ''
|
||||
# ArbitraryMapName systemUser DBUser
|
||||
superuser_map root postgres
|
||||
superuser_map postgres postgres
|
||||
# Let other names login as themselves
|
||||
superuser_map /^(.*)$ \1
|
||||
'';
|
||||
authentication = pkgs.lib.mkOverride 10 ''
|
||||
#type database DBuser auth-method optional_ident_map
|
||||
local sameuser all peer map=superuser_map
|
||||
'';
|
||||
};
|
||||
|
||||
services.nextcloud = {
|
||||
enable = true;
|
||||
package = pkgs.nextcloud29;
|
||||
hostName = "cloud.heroin.trade";
|
||||
https = true;
|
||||
|
||||
database.createLocally = true;
|
||||
config = {
|
||||
dbtype = "pgsql";
|
||||
adminpassFile = "/etc/nx_pass";
|
||||
};
|
||||
configureRedis = true;
|
||||
maxUploadSize = "4G";
|
||||
phpOptions."opcache.interned_strings_buffer" = "32";
|
||||
|
||||
extraApps = {
|
||||
inherit
|
||||
(config.services.nextcloud.package.packages.apps)
|
||||
contacts
|
||||
calendar
|
||||
notes
|
||||
previewgenerator
|
||||
;
|
||||
recognize = pkgs.fetchNextcloudApp {
|
||||
sha256 = "sha256-7qp9UbUcMwBNdGixaR0BAigMAtlyCAN39WxqHbsFVGE=";
|
||||
url = "https://github.com/nextcloud/recognize/releases/download/v7.0.0/recognize-7.0.0.tar.gz";
|
||||
license = "agpl3Only";
|
||||
};
|
||||
};
|
||||
extraAppsEnable = true;
|
||||
|
||||
settings = {
|
||||
maintenance_window_start = 100;
|
||||
default_phone_region = "DE";
|
||||
log_type = "file";
|
||||
enabledPreviewProviders = [
|
||||
"OC\\Preview\\BMP"
|
||||
"OC\\Preview\\GIF"
|
||||
"OC\\Preview\\JPEG"
|
||||
"OC\\Preview\\Krita"
|
||||
"OC\\Preview\\MarkDown"
|
||||
"OC\\Preview\\MP3"
|
||||
"OC\\Preview\\OpenDocument"
|
||||
"OC\\Preview\\PNG"
|
||||
"OC\\Preview\\TXT"
|
||||
"OC\\Preview\\XBitmap"
|
||||
"OC\\Preview\\HEIC"
|
||||
"OC\\Preview\\Font"
|
||||
"OC\\Preview\\HEIC"
|
||||
"OC\\Preview\\Illustrator"
|
||||
"OC\\Preview\\Movie"
|
||||
"OC\\Preview\\MSOffice2003"
|
||||
"OC\\Preview\\MSOffice2007"
|
||||
"OC\\Preview\\MSOfficeDoc"
|
||||
"OC\\Preview\\PDF"
|
||||
"OC\\Preview\\Photoshop"
|
||||
"OC\\Preview\\Postscript"
|
||||
"OC\\Preview\\StarOffice"
|
||||
"OC\\Preview\\SVG"
|
||||
"OC\\Preview\\TIFF"
|
||||
"OC\\Preview\\EMF"
|
||||
];
|
||||
};
|
||||
|
||||
secretFile = "/etc/nx_sc_opt";
|
||||
};
|
||||
|
||||
# Execute `nextcloud-occ preview:generate-all` before running this timer!
|
||||
systemd.timers."nextcloud-previewgenerator" = {
|
||||
wantedBy = ["timers.target"];
|
||||
timerConfig = {
|
||||
OnBootSec = "15m";
|
||||
OnUnitActiveSec = "15m";
|
||||
Unit = "nextcloud-previewgenerator.service";
|
||||
};
|
||||
};
|
||||
systemd.services."nextcloud-previewgenerator" = {
|
||||
script = ''
|
||||
${config.services.nextcloud.occ}/bin/nextcloud-occ preview:pre-generate
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "root";
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# previewgenerator
|
||||
ghostscript
|
||||
ffmpeg-headless
|
||||
# recognize
|
||||
gnumake
|
||||
nodejs_20
|
||||
nodejs_20.pkgs.node-pre-gyp
|
||||
python3
|
||||
util-linux
|
||||
];
|
||||
}
|
Loading…
Reference in a new issue