diff options
Diffstat (limited to 'machines')
-rw-r--r-- | machines/profpatsch/base-server.nix | 15 | ||||
-rw-r--r-- | machines/profpatsch/base.nix | 10 | ||||
-rw-r--r-- | machines/profpatsch/haku.nix | 25 |
3 files changed, 43 insertions, 7 deletions
diff --git a/machines/profpatsch/base-server.nix b/machines/profpatsch/base-server.nix index 893df1ae..9d0a6819 100644 --- a/machines/profpatsch/base-server.nix +++ b/machines/profpatsch/base-server.nix @@ -1,7 +1,7 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: let - sshPort = 6879; + cfg = config.vuizvui.user.profpatsch.server; in { @@ -9,6 +9,13 @@ in ./base.nix ]; + options.vuizvui.user.profpatsch.server.sshPort = lib.mkOption { + description = "ssh port"; + # TODO: replace with types.intBetween https://github.com/NixOS/nixpkgs/pull/27239 + type = with lib.types; addCheck int (x: x >= 0 && x <= 65535); + default = 6879; + }; + config = { boot.cleanTmpDir = true; @@ -17,13 +24,13 @@ in services.openssh = { enable = true; - listenAddresses = [ { addr = "0.0.0.0"; port = sshPort; } ]; + listenAddresses = [ { addr = "0.0.0.0"; port = cfg.sshPort; } ]; }; networking.firewall = { enable = true; allowPing = true; - allowedTCPPorts = [ sshPort ]; + allowedTCPPorts = [ cfg.sshPort ]; }; }; diff --git a/machines/profpatsch/base.nix b/machines/profpatsch/base.nix index 7a450d2e..5c4082f0 100644 --- a/machines/profpatsch/base.nix +++ b/machines/profpatsch/base.nix @@ -14,7 +14,7 @@ in programs.bash = { loginShellInit = '' - alias c='vim /etc/nixos/configuration.nix' + alias c='vim /root/vuizvui/machines/profpatsch' alias nsp='nix-shell -p' alias nrs='nixos-rebuild switch' alias tad='tmux attach -d' @@ -33,6 +33,14 @@ in myPkgs.vim # slight improvement over vi ]; + i18n = { + defaultLocale = "en_US.UTF-8"; + # TODO + # extraLocales = { + # LC_TIME = "de_DE.UTF-8"; #"en_DK.UTF-8"; + # }; + }; + # Nobody wants mutable state. :) users.mutableUsers = false; diff --git a/machines/profpatsch/haku.nix b/machines/profpatsch/haku.nix index c94484aa..64e1472d 100644 --- a/machines/profpatsch/haku.nix +++ b/machines/profpatsch/haku.nix @@ -4,6 +4,8 @@ let myLib = import ./lib.nix { inherit pkgs lib; }; myPkgs = import ./pkgs.nix { inherit pkgs lib myLib; }; + warpspeedPort = 1338; + myKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNMQvmOfon956Z0ZVdp186YhPHtSBrXsBwaCt0JAbkf/U/P+4fG0OROA++fHDiFM4RrRHH6plsGY3W6L26mSsCM2LtlHJINFZtVILkI26MDEIKWEsfBatDW+XNAvkfYEahy16P5CBtTVNKEGsTcPD+VDistHseFNKiVlSLDCvJ0vMwOykHhq+rdJmjJ8tkUWC2bNqTIH26bU0UbhMAtJstWqaTUGnB0WVutKmkZbnylLMICAvnFoZLoMPmbvx8efgLYY2vD1pRd8Uwnq9MFV1EPbkJoinTf1XSo8VUo7WCjL79aYSIvHmXG+5qKB9ed2GWbBLolAoXkZ00E4WsVp9H philip@nyx"; in @@ -14,7 +16,6 @@ in ]; config = { - boot.loader.grub.device = "/dev/sda"; fileSystems = { "/" = { @@ -29,6 +30,7 @@ in environment.systemPackages = with pkgs; [ rtorrent # bittorrent client + mktorrent # torrent file creator pkgs.vuizvui.profpatsch.warpspeed # trivial http file server ]; @@ -51,6 +53,15 @@ in }; }; + systemd.services.warpspeed = + let user = config.users.users.rtorrent; + in { + description = "internally served public files (see nginx)"; + wantedBy = [ "default.target" ]; + environment = { PORT = toString warpspeedPort; }; + script = "${pkgs.vuizvui.profpatsch.warpspeed}/bin/warpspeed ${user.home}/public"; + serviceConfig.User = config.users.users.rtorrent.name; + }; services.nginx = { enable = true; @@ -58,13 +69,23 @@ in forceSSL = true; enableACME = true; locations."/pub/" = { - proxyPass = "http://localhost:1338/"; + proxyPass = "http://localhost:${toString warpspeedPort}/"; }; locations."/".root = pkgs.writeTextDir "index.html" ''hello world''; serverAliases = [ "lojbanistan.de" ]; }; }; + services.mlmmj = { + enable = true; + listDomain = "cz.profpatsch.de"; + mailLists = [ "worship" ]; + }; + services.postfix = { + # mostly configured by mlmmj + hostname = "cz.profpatsch.de"; + postmasterAlias = "mail@profpatsch.de"; + }; networking = { hostName = "haku"; |