Merge pull request #27 from fsr/ftp

This commit is contained in:
Tassilo Tanneberger 2023-03-31 15:36:05 +02:00 committed by GitHub
commit a6ece02b03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 19 deletions

View file

@ -14,23 +14,6 @@
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt; formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
nixosConfigurations = { nixosConfigurations = {
birne = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./hosts/birne/configuration.nix
./modules/base.nix
./modules/autoupdate.nix
./modules/desktop.nix
./modules/printing.nix
./modules/wifi.nix
./modules/options.nix
{
fsr.enable_office_bloat = true;
}
];
};
sanddorn = nixpkgs.lib.nixosSystem { sanddorn = nixpkgs.lib.nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
modules = [ modules = [
@ -42,8 +25,6 @@
./hosts/sanddorn/configuration.nix ./hosts/sanddorn/configuration.nix
./modules/infoscreen.nix ./modules/infoscreen.nix
./modules/base.nix ./modules/base.nix
./modules/autoupdate.nix
./modules/wifi.nix
./modules/desktop.nix ./modules/desktop.nix
./modules/options.nix ./modules/options.nix
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix" "${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"

21
modules/ftp.nix Normal file
View file

@ -0,0 +1,21 @@
{ config, pkgs, ... }:
let
domain = "ftp.${config.fsr.domain}";
in
{
services.nginx.virtualHosts."${domain}" = {
enableACME = true;
forceSSL = true;
root = "/srv/ftp";
extraConfig = ''
autoindex on;
'';
locations."~/(klausuren|uebungen|skripte|abschlussarbeiten)".extraConfig = ''
allow 141.30.0.0/16;
allow 141.76.0.0/16;
allow 172.16.0.0/16;
deny all;
'';
};
}