mirror of
https://github.com/Nickiel12/nicks-nix-config.git
synced 2024-11-22 20:59:32 -08:00
moved services out of container
This commit is contained in:
parent
808f983f9b
commit
394931e026
4 changed files with 17 additions and 59 deletions
|
@ -5,8 +5,8 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(import ./hardware-configuration.nix)
|
(import ./hardware-configuration.nix)
|
||||||
(import ./containers/nextcloud.nix)
|
|
||||||
(import ./modules/nginx.nix)
|
(import ./modules/nginx.nix)
|
||||||
|
(import ./modules/nextcloud.nix)
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
|
|
|
@ -1,48 +1,17 @@
|
||||||
|
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
containers.nextcloud = {
|
|
||||||
autoStart = true;
|
|
||||||
privateNetwork = true;
|
|
||||||
# The host address is the address of the parent machine from inside the container
|
|
||||||
hostAddress = "192.168.100.10";
|
|
||||||
# The local address field is the "inside the container" address of this machine
|
|
||||||
# Or what it says when you run 'ip a' inside the container
|
|
||||||
localAddress = "192.168.100.11";
|
|
||||||
# These are the same as above, but for ipv6
|
|
||||||
hostAddress6 = "fc00::1";
|
|
||||||
localAddress6 = "fc00::2";
|
|
||||||
|
|
||||||
# allowed filepaths and container-internal mount points
|
|
||||||
# I believe "hostPath" is the system-wide, non-conatainer path
|
|
||||||
bindMounts = {
|
|
||||||
"/Aurora/nextcloud" = {
|
|
||||||
hostPath = "/Aurora/nextcloud";
|
|
||||||
isReadOnly = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# If, when you nix-container root-login and systemctl status nextcloud-setup says the
|
|
||||||
# password files are unreadable, log in as root and `chown nextcloud:nextcloud` the password files
|
|
||||||
config = { config, pkgs, ... }: {
|
|
||||||
|
|
||||||
# A lot of this nextcloud configuration was pulled from this post:
|
|
||||||
# https://jacobneplokh.com/how-to-setup-nextcloud-on-nixos/
|
|
||||||
services.nextcloud = {
|
services.nextcloud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.nextcloud25;
|
package = pkgs.nextcloud25;
|
||||||
enableBrokenCiphersForSSE = false;
|
enableBrokenCiphersForSSE = false;
|
||||||
|
|
||||||
|
nginx.recommendedHttpHeaders = true;
|
||||||
https = true;
|
https = true;
|
||||||
hostName = "192.168.100.10";
|
hostName = "files.nickiel.net";
|
||||||
home = "/Aurora/nextcloud";
|
home = "/Aurora/nextcloud";
|
||||||
|
|
||||||
autoUpdateApps = {
|
autoUpdateApps.enable = true;
|
||||||
enable = true;
|
|
||||||
startAt = "05:00:00";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
overwriteProtocol = "https";
|
overwriteProtocol = "https";
|
||||||
|
@ -50,6 +19,9 @@
|
||||||
"10.0.0.183"
|
"10.0.0.183"
|
||||||
"files.nickiel.net"
|
"files.nickiel.net"
|
||||||
];
|
];
|
||||||
|
trustedProxies = [
|
||||||
|
"files.nickiel.net"
|
||||||
|
];
|
||||||
|
|
||||||
dbtype = "pgsql";
|
dbtype = "pgsql";
|
||||||
dbuser = "nextcloud";
|
dbuser = "nextcloud";
|
||||||
|
@ -86,17 +58,4 @@
|
||||||
requires = ["postgresql.service"];
|
requires = ["postgresql.service"];
|
||||||
after = ["postgresql.service"];
|
after = ["postgresql.service"];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# Container nixos state configurations
|
|
||||||
system.stateVersion = "22.05";
|
|
||||||
networking.firewall = {
|
|
||||||
enable = true;
|
|
||||||
allowedTCPPorts = [ 80 ];
|
|
||||||
};
|
|
||||||
# Manually configure nameserver. Using resolved inside the container seems to fail
|
|
||||||
# currently
|
|
||||||
environment.etc."resolv.conf".text = "nameserver 1.1.1.1";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
|
@ -1,6 +1,11 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
security.acme = {
|
||||||
|
acceptTerms = true;
|
||||||
|
defaults.email = "nicholasyoungsumner@gmail.com";
|
||||||
|
};
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
commonHttpConfig = ''
|
commonHttpConfig = ''
|
||||||
|
@ -19,8 +24,7 @@
|
||||||
|
|
||||||
"jellyfin.nickiel.net" = {
|
"jellyfin.nickiel.net" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
sslCertificate = "/Aurora/nickiel.net.pem";
|
enableACME = true;
|
||||||
sslCertificateKey = "/Aurora/nickiel.net.key";
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://127.0.0.1:8096/";
|
proxyPass = "http://127.0.0.1:8096/";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
|
@ -28,15 +32,10 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#"files.nickiel.net" = {
|
"files.nickiel.net" = {
|
||||||
# forceSSL = true;
|
forceSSL = true;
|
||||||
# sslCertificate = "/Aurora/nickiel.net.pem";
|
enableACME = true;
|
||||||
# sslCertificateKey = "/Aurora/nickiel.net.key";
|
};
|
||||||
# locations."/" = {
|
|
||||||
# proxyPass = "http://192.168.100.11:80";
|
|
||||||
# proxyWebsockets = true;
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue