2023-12-26 17:48:59 +01:00
|
|
|
{ lib, config, inputs, pkgs, ... }:
|
|
|
|
let
|
|
|
|
root_host = "grimmauld.de";
|
|
|
|
|
|
|
|
# git add --intent-to-add email.txt ; git update-index --assume-unchanged email.txt
|
|
|
|
root_email = (builtins.elemAt (lib.strings.match "[[:space:]]*([^[:space:]]+)[[:space:]]*" (builtins.readFile ./email.txt)) 0);
|
|
|
|
|
|
|
|
in {
|
|
|
|
imports = [
|
|
|
|
./hardware-configuration.nix
|
|
|
|
];
|
|
|
|
|
2024-01-26 13:45:18 +01:00
|
|
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
|
|
|
services.logrotate.checkConfig = false; # needed or this explodes
|
2024-01-26 10:14:45 +01:00
|
|
|
|
2023-12-26 17:48:59 +01:00
|
|
|
users.users.grimmauld = {
|
|
|
|
isNormalUser = true;
|
|
|
|
description = "grimmauld";
|
|
|
|
extraGroups = [ "wheel" "docker" ];
|
|
|
|
shell = pkgs.xonsh;
|
|
|
|
packages = with pkgs; [
|
|
|
|
hyfetch
|
|
|
|
];
|
|
|
|
openssh.authorizedKeys.keys = (import ./authorizedKeys.nix);
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.xonsh.enable = true;
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
wget
|
2024-01-26 10:14:45 +01:00
|
|
|
vulnix
|
2023-12-26 17:48:59 +01:00
|
|
|
tree
|
|
|
|
git
|
|
|
|
file
|
|
|
|
git-lfs
|
|
|
|
util-linux
|
|
|
|
btop
|
2023-12-29 10:23:10 +01:00
|
|
|
mkpasswd
|
2023-12-26 17:48:59 +01:00
|
|
|
linuxPackages.perf
|
|
|
|
gitea
|
2023-12-31 19:06:33 +01:00
|
|
|
matrix-synapse-tools.synadm
|
|
|
|
matrix-synapse
|
2023-12-26 17:48:59 +01:00
|
|
|
# ffmpeg-full
|
|
|
|
|
|
|
|
pufferpanel
|
|
|
|
(writeShellScriptBin "pufferpanel-nix" "pufferpanel --workDir /var/lib/pufferpanel $@")
|
2024-01-26 10:14:45 +01:00
|
|
|
(writeShellScriptBin "nix-referrers" "nix-store --query --referrers $@")
|
2023-12-26 17:48:59 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
environment.sessionVariables = {
|
|
|
|
NIXPKGS_ALLOW_UNFREE="1";
|
|
|
|
OMP_NUM_THREADS = "4";
|
|
|
|
};
|
|
|
|
|
|
|
|
networking.firewall = {
|
|
|
|
enable = true;
|
2023-12-28 15:32:47 +01:00
|
|
|
allowedTCPPorts = [ 80 443 ];
|
2023-12-26 17:48:59 +01:00
|
|
|
allowPing = true;
|
2023-12-28 15:32:47 +01:00
|
|
|
allowedUDPPortRanges = [];
|
2023-12-26 17:48:59 +01:00
|
|
|
};
|
|
|
|
|
2023-12-28 15:32:47 +01:00
|
|
|
# services.nginx.package = pkgs.nginxStable.override { openssl = pkgs.libressl; };
|
2023-12-26 17:48:59 +01:00
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
recommendedGzipSettings = true;
|
|
|
|
recommendedOptimisation = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
recommendedTlsSettings = true;
|
|
|
|
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
|
|
|
|
|
|
|
|
virtualHosts."${root_host}" = {
|
|
|
|
forceSSL = true;
|
2023-12-28 11:42:42 +01:00
|
|
|
enableACME = lib.mkForce false; # use the cert above, not some weird one that matrix-synapse module supplies
|
2023-12-26 17:48:59 +01:00
|
|
|
useACMEHost = root_host;
|
2023-12-27 20:09:38 +01:00
|
|
|
locations."/" = {
|
|
|
|
root = "/var/www/grimmauld.duckdns.org";
|
|
|
|
};
|
2023-12-26 17:48:59 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
system.stateVersion = "unstable";
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
|
|
boot.tmp.cleanOnBoot = true;
|
|
|
|
zramSwap.enable = true;
|
|
|
|
networking.hostName = "grimmauld-nixos-server";
|
|
|
|
networking.domain = "";
|
|
|
|
services.openssh.enable = true;
|
|
|
|
# users.users.root.openssh.authorizedKeys.keys = (import ./authorizedKeys.nix);
|
|
|
|
}
|