workhorse: fix 20.03

This commit is contained in:
Ingolf Wagner 2020-05-16 14:49:55 +02:00
parent 67b59d050c
commit 6278b53e94
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
3 changed files with 38 additions and 26 deletions

View file

@ -13,11 +13,12 @@ in {
# lvm volume group
# ----------------
boot.initrd.luks.devices = [{
name = "vg";
device = "/dev/sda2";
preLVM = true;
}];
boot.initrd.luks.devices = {
vg = {
device = "/dev/sda2";
preLVM = true;
};
};
# NTFS support
# ------------

View file

@ -93,17 +93,17 @@ in {
# https://docs.nextcloud.com/server/stable/admin_manual/maintenance/backup.html
# https://docs.nextcloud.com/server/stable/admin_manual/maintenance/upgrade.html
# use snapshots in case of a rollback
nixpkgs.config.packageOverrides = super: {
nextcloud = super.nextcloud.overrideAttrs (old: rec {
name = "nextcloud-${version}";
version = "18.0.1";
src = super.fetchurl {
url =
"https://download.nextcloud.com/server/releases/nextcloud-18.0.1.tar.bz2";
sha256 = "1h0rxpdssn1hc65k41zbvww9r4f79vbd9bixc9ri5n7hp0say3vp";
};
});
};
#nixpkgs.config.packageOverrides = super: {
# nextcloud = super.nextcloud.overrideAttrs (old: rec {
# name = "nextcloud-${version}";
# version = "18.0.1";
# src = super.fetchurl {
# url =
# "https://download.nextcloud.com/server/releases/nextcloud-18.0.1.tar.bz2";
# sha256 = "1h0rxpdssn1hc65k41zbvww9r4f79vbd9bixc9ri5n7hp0say3vp";
# };
# });
#};
networking.firewall.allowedTCPPorts = [ 80 ];
networking.firewall.allowedUDPPorts = [ 80 ];
@ -147,6 +147,16 @@ in {
# nextcloud setup
services.nextcloud = {
enable = true;
package = pkgs.nextcloud18;
#package = pkgs.nextcloud.overrideAttrs (old: rec {
# name = "nextcloud-${version}";
# version = "18.0.1";
# src = pkgs.fetchurl {
# url =
# "https://download.nextcloud.com/server/releases/nextcloud-18.0.1.tar.bz2";
# sha256 = "1h0rxpdssn1hc65k41zbvww9r4f79vbd9bixc9ri5n7hp0say3vp";
# };
#});
autoUpdateApps.enable = true;
nginx.enable = true;
hostName = "nextcloud.ingolf-wagner.de";

View file

@ -71,27 +71,28 @@ in {
# tor setup
boot.initrd.secrets = {
"/etc/tor/onion/bootup" = /var/lib/tor/onion/bootup;
"/etc/tor/tor.rc" = (pkgs.writeText "tor.rc" ''
DataDirectory /etc/tor
SOCKSPort 127.0.0.1:9050 IsolateDestAddr
SOCKSPort 127.0.0.1:9063
HiddenServiceDir /etc/tor/onion/bootup
HiddenServicePort ${toString cfg.port} 127.0.0.1:${toString cfg.port}
'');
};
boot.initrd.extraUtilsCommands = ''
copy_bin_and_libs ${pkgs.tor}/bin/tor
'';
boot.initrd.network.postCommands = ''
boot.initrd.network.postCommands = let
torRc = (pkgs.writeText "tor.rc" ''
DataDirectory /etc/tor
SOCKSPort 127.0.0.1:9050 IsolateDestAddr
SOCKSPort 127.0.0.1:9063
HiddenServiceDir /etc/tor/onion/bootup
HiddenServicePort ${toString cfg.port} 127.0.0.1:${toString cfg.port}
'');
in ''
echo "tor: preparing onion folder"
# have to do this otherwise tor does not want to start
chmod -R 700 /etc/tor
echo "tor: starting tor"
tor -f /etc/tor/tor.rc --verify-config
tor -f /etc/tor/tor.rc &
tor -f ${torRc} --verify-config
tor -f ${torRc} &
'';
# ssh setup