From 479d74e5146a601c2244153e8aa89e723b30cbe5 Mon Sep 17 00:00:00 2001 From: polwex Date: Sat, 7 Sep 2024 00:23:55 +0700 Subject: m --- hosts/cloud/bkk/configuration.nix | 21 ++++++---- hosts/cloud/sing/mail.nix | 73 ---------------------------------- hosts/cloud/sortug/configuration.nix | 4 +- hosts/cloud/sortug/mail.nix | 77 ++++++++++++++++++++++++++++++++++++ hosts/local/fw11/configuration.nix | 7 +++- hosts/local/ohira/configuration.nix | 10 ++--- hosts/local/wayland.nix | 1 - hosts/mac/m1mba/services.nix | 6 ++- 8 files changed, 109 insertions(+), 90 deletions(-) delete mode 100644 hosts/cloud/sing/mail.nix create mode 100644 hosts/cloud/sortug/mail.nix (limited to 'hosts') diff --git a/hosts/cloud/bkk/configuration.nix b/hosts/cloud/bkk/configuration.nix index 9769419..5a37599 100644 --- a/hosts/cloud/bkk/configuration.nix +++ b/hosts/cloud/bkk/configuration.nix @@ -26,12 +26,19 @@ # allowedTCPPorts = [ 993 465 40308 80 443 53 51820 5522 ]; # allowedUDPPorts = [ 993 465 40308 80 443 53 50000 50001 50002 50003 50004 50005 50006 50007 50008 50009 50010 51820 5522 ]; }; - services.ntfy-sh = { - enable = true; - settings = { - base-url = "https://n.urbit.men"; - listen-http = ":8090"; - }; - }; + # services.ntfy-sh = { + # enable = true; + # settings = { + # base-url = "https://n.urbit.men"; + # listen-http = ":8090"; + # }; + # }; system.stateVersion = "24.05"; # Did you read the comment? + environment.systemPackages = with pkgs; [ + tmux + git + lsd + ncdu + ]; + users.users.y.openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM+qXhCHNrSZmy4HEXaFn6xAp1w2GzQBMOfVdbR3E81Q cloudboxes"]; } diff --git a/hosts/cloud/sing/mail.nix b/hosts/cloud/sing/mail.nix deleted file mode 100644 index 1b88877..0000000 --- a/hosts/cloud/sing/mail.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ - config, - pkgs, - ... -}: { - mailserver = { - enable = true; - fqdn = "mail.sortug.com"; - domains = ["sortug.com"]; - - # A list of all login accounts. To create the password hashes, use - # nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' - loginAccounts = { - "zh@sortug.com" = { - hashedPasswordFile = "/home/y/mail.key"; - }; - "jp@sortug.com" = { - hashedPasswordFile = "/home/y/mail.key"; - }; - "th@sortug.com" = { - hashedPasswordFile = "/home/y/mail.key"; - }; - "bd@sortug.com" = { - hashedPasswordFile = "/home/y/mail.key"; - }; - "info@sortug.com" = { - hashedPasswordFile = "/home/y/mail.key"; - }; - "admin@sortug.com" = { - # legal and banking - hashedPasswordFile = "/home/y/mail.key"; - }; - "internal@sortug.com" = { - hashedPasswordFile = "/home/y/mail.key"; - }; - "billing@sortug.com" = { - hashedPasswordFile = "/home/y/mail.key"; - }; - "polwex@sortug.com" = { - hashedPasswordFile = "/home/y/mail2.key"; - }; - "kinode@sortug.com" = { - hashedPasswordFile = "/home/y/mail.key"; - }; - "hosting@sortug.com" = { - hashedPasswordFile = "/home/y/mail.key"; - }; - "support@sortug.com" = { - hashedPasswordFile = "/home/y/mail.key"; - }; - }; - - # Use Let's Encrypt certificates. Note that this needs to set up a stripped - # down nginx and opens port 80. - certificateScheme = "acme-nginx"; - }; - security.acme.acceptTerms = true; - security.acme.defaults.email = "security@sortug.com"; - # services.roundcube = { - # enable = true; - # # this is the url of the vhost, not necessarily the same as the fqdn of - # # the mailserver - # hostName = "mail.sortug.com"; - # extraConfig = '' - # # starttls needed for authentication, so the fqdn required to match - # # the certificate - # $config['smtp_server'] = "tls://${config.mailserver.fqdn}"; - # $config['smtp_user'] = "%u"; - # $config['smtp_pass'] = "%p"; - # ''; - # }; - services.nginx.enable = true; -} diff --git a/hosts/cloud/sortug/configuration.nix b/hosts/cloud/sortug/configuration.nix index d409f83..87dca09 100644 --- a/hosts/cloud/sortug/configuration.nix +++ b/hosts/cloud/sortug/configuration.nix @@ -17,8 +17,7 @@ ./minio.nix # ./coturn.nix ./disk-config.nix - ../sing/mail.nix - # ./mail.nix + ./mail.nix ]; boot = { @@ -92,4 +91,5 @@ }; }; system.stateVersion = "24.05"; # Did you read the comment? + users.users.y.openssh.authorizedKeys.keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM+qXhCHNrSZmy4HEXaFn6xAp1w2GzQBMOfVdbR3E81Q cloudboxes"]; } diff --git a/hosts/cloud/sortug/mail.nix b/hosts/cloud/sortug/mail.nix new file mode 100644 index 0000000..ef10866 --- /dev/null +++ b/hosts/cloud/sortug/mail.nix @@ -0,0 +1,77 @@ +{ + config, + pkgs, + ... +}: { + # services.dovecot2.sieve.extensions = ["fileinto"]; + mailserver = { + enable = true; + fqdn = "mail.sortug.com"; + domains = ["sortug.com" "yago.onl"]; + # workaround + # A list of all login accounts. To create the password hashes, use + # nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' + loginAccounts = { + "zh@sortug.com" = { + hashedPasswordFile = "/home/y/mail.key"; + }; + "jp@sortug.com" = { + hashedPasswordFile = "/home/y/mail.key"; + }; + "th@sortug.com" = { + hashedPasswordFile = "/home/y/mail.key"; + }; + "bd@sortug.com" = { + hashedPasswordFile = "/home/y/mail.key"; + }; + "info@sortug.com" = { + hashedPasswordFile = "/home/y/mail.key"; + }; + "admin@sortug.com" = { + # legal and banking + hashedPasswordFile = "/home/y/mail.key"; + }; + "internal@sortug.com" = { + hashedPasswordFile = "/home/y/mail.key"; + }; + "billing@sortug.com" = { + hashedPasswordFile = "/home/y/mail.key"; + }; + "polwex@sortug.com" = { + hashedPasswordFile = "/home/y/mail.key"; + }; + "kinode@sortug.com" = { + hashedPasswordFile = "/home/y/mail.key"; + }; + "hosting@sortug.com" = { + hashedPasswordFile = "/home/y/mail.key"; + }; + "support@sortug.com" = { + hashedPasswordFile = "/home/y/mail.key"; + }; + "sub@yago.onl" = { + hashedPasswordFile = "/home/y/mail.key"; + }; + }; + + # Use Let's Encrypt certificates. Note that this needs to set up a stripped + # down nginx and opens port 80. + certificateScheme = "acme-nginx"; + }; + security.acme.acceptTerms = true; + security.acme.defaults.email = "security@sortug.com"; + services.roundcube = { + enable = true; + # this is the url of the vhost, not necessarily the same as the fqdn of + # the mailserver + hostName = "mail.sortug.com"; + extraConfig = '' + # starttls needed for authentication, so the fqdn required to match + # the certificate + $config['smtp_server'] = "tls://${config.mailserver.fqdn}"; + $config['smtp_user'] = "%u"; + $config['smtp_pass'] = "%p"; + ''; + }; + services.nginx.enable = true; +} diff --git a/hosts/local/fw11/configuration.nix b/hosts/local/fw11/configuration.nix index bd9aa30..32c27b7 100644 --- a/hosts/local/fw11/configuration.nix +++ b/hosts/local/fw11/configuration.nix @@ -52,12 +52,17 @@ in { # List services that you want to enable: - services.openssh.enable = false; + services.openssh.enable = true; + services.openssh.ports = [5555]; # firmware update services.fwupd.enable = true; services.flatpak.enable = true; + # don't sleep if closed lid; + services.logind.lidSwitchExternalPower = "ignore"; + services.logind.lidSwitchDocked = "ignore"; + services.logind.lidSwitch = "ignore"; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions diff --git a/hosts/local/ohira/configuration.nix b/hosts/local/ohira/configuration.nix index 08ce794..41e058d 100644 --- a/hosts/local/ohira/configuration.nix +++ b/hosts/local/ohira/configuration.nix @@ -124,11 +124,11 @@ # Allow unfree packages nixpkgs.config.allowUnfree = true; - # programs.steam = { - # enable = true; - # remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play - # dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server - # }; + programs.steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + }; # List packages installed in system profile. To search, run: # $ nix search wget diff --git a/hosts/local/wayland.nix b/hosts/local/wayland.nix index 57fd4cc..7b02828 100644 --- a/hosts/local/wayland.nix +++ b/hosts/local/wayland.nix @@ -103,7 +103,6 @@ kompare meld # tmp - grapejuice dosbox ]; diff --git a/hosts/mac/m1mba/services.nix b/hosts/mac/m1mba/services.nix index 52572ac..bbd891c 100644 --- a/hosts/mac/m1mba/services.nix +++ b/hosts/mac/m1mba/services.nix @@ -8,4 +8,8 @@ in { yabai = callPackage ./yabai { inherit (pkgs) yabai; }; -} \ No newline at end of file + + services.tailscale = { + enable = true; + }; +} -- cgit v1.2.3