Compare commits
5 commits
3f5c5c8d1b
...
5a4a317459
Author | SHA1 | Date | |
---|---|---|---|
5a4a317459 | |||
5885a850bf | |||
4f3ff236a4 | |||
50a4954704 | |||
00c926e45b |
9 changed files with 133 additions and 9 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, config, ... }:
|
{ lib, pkgs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./common.nix
|
./common.nix
|
||||||
|
@ -15,8 +15,7 @@
|
||||||
nixd
|
nixd
|
||||||
];
|
];
|
||||||
|
|
||||||
# fix for wsl, `prefer` does not work if your SSH_ASKPASS is empty/unset
|
variables.SSH_ASKPASS_REQUIRE = "prefer";
|
||||||
variables.SSH_ASKPASS_REQUIRE = if config.programs.ssh.enableAskPassword then "prefer" else "never";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
|
@ -30,7 +29,11 @@
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
nix-ld.enable = true;
|
nix-ld.enable = true;
|
||||||
ssh.startAgent = true;
|
ssh = {
|
||||||
|
startAgent = true;
|
||||||
|
enableAskPassword = true;
|
||||||
|
askPassword = lib.mkDefault "${pkgs.curses-ssh-askpass}"; # see exprs/curses-ssh-askpass.nix
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
|
|
15
exprs/curses-ssh-askpass.nix
Normal file
15
exprs/curses-ssh-askpass.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pinentry-curses,
|
||||||
|
writeShellScript,
|
||||||
|
}:
|
||||||
|
writeShellScript "curses-ssh-askpass" ''
|
||||||
|
if [ -z ''${1+x} ]; then
|
||||||
|
prompt="GETPIN"
|
||||||
|
else
|
||||||
|
prompt="SETDESC $1\nGETPIN"
|
||||||
|
fi
|
||||||
|
|
||||||
|
pin=$(echo -e "$prompt" | ${lib.getExe pinentry-curses} -T /dev/pts/0 | grep D | tr -d '\n')
|
||||||
|
echo "''${pin:2}"
|
||||||
|
''
|
|
@ -1,5 +1,6 @@
|
||||||
inputs: final: prev: {
|
inputs: final: prev: {
|
||||||
idea-ultimate-fixed = prev.callPackage ./idea-fixed.nix { };
|
idea-ultimate-fixed = prev.callPackage ./idea-fixed.nix { };
|
||||||
|
curses-ssh-askpass = prev.callPackage ./curses-ssh-askpass.nix { };
|
||||||
|
|
||||||
vencord = prev.vencord.overrideAttrs (old: rec {
|
vencord = prev.vencord.overrideAttrs (old: rec {
|
||||||
version = "${old.version}+git.${inputs.vencord.shortRev}";
|
version = "${old.version}+git.${inputs.vencord.shortRev}";
|
||||||
|
|
|
@ -84,4 +84,16 @@
|
||||||
|
|
||||||
systemd.services."${backend}-mc-${name}".serviceConfig.TimeoutSec = "300";
|
systemd.services."${backend}-mc-${name}".serviceConfig.TimeoutSec = "300";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mkFrpPassthrough = name: port: {
|
||||||
|
services.frp.settings.proxies = [
|
||||||
|
{
|
||||||
|
inherit name;
|
||||||
|
type = "tcp";
|
||||||
|
localIp = "localhost";
|
||||||
|
localPort = port;
|
||||||
|
remotePort = port;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
{ config, ... }:
|
{ config, _utils, ... }:
|
||||||
|
let
|
||||||
|
frp = _utils.mkFrpPassthrough "immich" config.services.immich.port;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
cfTunnels."im.uku.moe" = "http://localhost:${builtins.toString config.services.immich.port}";
|
imports = [ frp ];
|
||||||
|
|
||||||
services.immich = {
|
services.immich = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
25
systems/vesuvio/certificates.nix
Normal file
25
systems/vesuvio/certificates.nix
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{ config, ... }:
|
||||||
|
{
|
||||||
|
security.acme = {
|
||||||
|
acceptTerms = true;
|
||||||
|
defaults = {
|
||||||
|
email = "acme@uku.moe";
|
||||||
|
webroot = "/var/lib/acme/acme-challenge";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts = {
|
||||||
|
"acme.uku3lig.net" = {
|
||||||
|
serverAliases = [
|
||||||
|
"*.uku3lig.net"
|
||||||
|
"*.uku.moe"
|
||||||
|
];
|
||||||
|
|
||||||
|
locations."/.well-known/acme-challenge".root = config.security.acme.defaults.webroot;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# /var/lib/acme/acme-challenge must be writable by the ACME user and readable by the Nginx user.
|
||||||
|
# The easiest way to achieve this is to add the Nginx user to the ACME group.
|
||||||
|
users.users.nginx.extraGroups = [ "acme" ];
|
||||||
|
}
|
|
@ -1,8 +1,10 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./certificates.nix
|
||||||
./frp.nix
|
./frp.nix
|
||||||
./hetzner.nix
|
./hetzner.nix
|
||||||
|
./nginx.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
@ -10,8 +12,16 @@
|
||||||
traceroute
|
traceroute
|
||||||
];
|
];
|
||||||
|
|
||||||
services.openssh = {
|
services = {
|
||||||
ports = [ 4269 ];
|
nginx.enable = true;
|
||||||
openFirewall = true;
|
openssh = {
|
||||||
|
ports = [ 4269 ];
|
||||||
|
openFirewall = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
80
|
||||||
|
443
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
35
systems/vesuvio/mail.nix
Normal file
35
systems/vesuvio/mail.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{ config, ... }:
|
||||||
|
let
|
||||||
|
certName = "mail.c.uku3lig.net";
|
||||||
|
certLocation = config.security.acme.certs.${certName}.directory;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
security.acme.certs.${certName} = {
|
||||||
|
group = config.services.maddy.group;
|
||||||
|
extraLegoRenewFlags = [ "--reuse-key" ]; # soopyc said its more secure
|
||||||
|
};
|
||||||
|
|
||||||
|
services.maddy = {
|
||||||
|
enable = true;
|
||||||
|
hostname = "mx1.uku3lig.net";
|
||||||
|
primaryDomain = "uku3lig.net";
|
||||||
|
localDomains = [
|
||||||
|
"$(primary_domain)"
|
||||||
|
"uku.moe"
|
||||||
|
];
|
||||||
|
|
||||||
|
tls = {
|
||||||
|
loader = "file";
|
||||||
|
certificates = [
|
||||||
|
{
|
||||||
|
certPath = "${certLocation}/fullchain.pem";
|
||||||
|
keyPath = "${certLocation}/key.pem";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
config = ''
|
||||||
|
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
20
systems/vesuvio/nginx.nix
Normal file
20
systems/vesuvio/nginx.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
services.nginx.virtualHosts = {
|
||||||
|
# immich
|
||||||
|
"im.uku.moe" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:2283";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
client_max_body_size 5000M;
|
||||||
|
proxy_read_timeout 600s;
|
||||||
|
proxy_send_timeout 600s;
|
||||||
|
send_timeout 600s;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue