From 00c9e35779cbb298d6395a6e2c2534007a92976f Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Fri, 21 Mar 2025 04:52:46 -0700 Subject: add a ton of VPS upgrades; update website; live life --- nix/modules/configuration.nix | 31 ++- nix/modules/default.nix | 1 + nix/modules/home/default.nix | 1 + nix/modules/home/emacs.nix | 2 +- nix/modules/home/mpd.nix | 14 ++ nix/modules/icecast.nix | 21 ++ nix/modules/inspircd.nix | 539 ++++++++++++++++++++++++++++++++++++++++++ nix/modules/ircd.nix | 12 + nix/modules/maddy.nix | 18 ++ nix/modules/matterbridge.nix | 7 + nix/modules/murmur.nix | 6 +- nix/modules/nginx.nix | 18 +- nix/modules/ngircd.nix | 28 +++ nix/modules/secrets.nix | 1 - nix/modules/znc.nix | 31 +++ 15 files changed, 715 insertions(+), 15 deletions(-) create mode 100644 nix/modules/icecast.nix create mode 100644 nix/modules/inspircd.nix create mode 100644 nix/modules/ircd.nix create mode 100644 nix/modules/maddy.nix create mode 100644 nix/modules/matterbridge.nix create mode 100644 nix/modules/ngircd.nix create mode 100644 nix/modules/znc.nix (limited to 'nix/modules') diff --git a/nix/modules/configuration.nix b/nix/modules/configuration.nix index 732f83c..ad244b8 100644 --- a/nix/modules/configuration.nix +++ b/nix/modules/configuration.nix @@ -1,6 +1,7 @@ { config, pkgs, lib, ... }: { imports = [ + ./matterbridge.nix ./xserver.nix ./ssh.nix ./pipewire.nix @@ -10,14 +11,14 @@ ./cuda.nix ./nginx.nix ./git-daemon.nix - ./postfix.nix - ./dovecot.nix ./ollama.nix ./i2pd.nix ./gitweb.nix ./conduit.nix ./bitcoin.nix ./murmur.nix + ./ngircd.nix + ./znc.nix ]; documentation = { @@ -315,12 +316,28 @@ users.groups.nginx = lib.mkDefault {}; users.groups.git = lib.mkDefault {}; + users.groups.ircd = lib.mkDefault {}; + users.users = { - nginx.group = "nginx"; - nginx.isSystemUser = lib.mkDefault true; - nginx.extraGroups = [ - "acme" - ]; + ngircd = { + isSystemUser = lib.mkDefault true; + extraGroups = [ "acme" "nginx" ]; + }; + + ircd = { + isSystemUser = lib.mkDefault true; + group = "ircd"; + home = "/home/ircd"; + }; + + nginx = { + group = "nginx"; + isSystemUser = lib.mkDefault true; + extraGroups = [ + "acme" + ]; + }; + root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICts6+MQiMwpA+DfFQxjIN214Jn0pCw/2BDvOzPhR/H2 preston@continuity-dell" ]; diff --git a/nix/modules/default.nix b/nix/modules/default.nix index 00a188b..4bd4161 100644 --- a/nix/modules/default.nix +++ b/nix/modules/default.nix @@ -27,6 +27,7 @@ linux-manual man-pages man-pages-posix + iproute2 ]); boot.loader.grub = lib.mkIf config.monorepo.profiles.grub.enable { enable = true; diff --git a/nix/modules/home/default.nix b/nix/modules/home/default.nix index fa18632..72fcc31 100644 --- a/nix/modules/home/default.nix +++ b/nix/modules/home/default.nix @@ -84,6 +84,7 @@ ++ (if config.monorepo.profiles.workstation.enable then (with pkgs; [ open-webui + mumble ]) else []) ++ (if config.monorepo.profiles.lang-js.enable then (with pkgs; [ diff --git a/nix/modules/home/emacs.nix b/nix/modules/home/emacs.nix index 4358ca3..71e234c 100644 --- a/nix/modules/home/emacs.nix +++ b/nix/modules/home/emacs.nix @@ -3,7 +3,7 @@ programs.emacs = { enable = lib.mkDefault config.monorepo.profiles.graphics.enable; - package = pkgs.emacs29-pgtk; + package = pkgs.emacs30-pgtk; extraConfig = '' (setq debug-on-error t) (org-babel-load-file diff --git a/nix/modules/home/mpd.nix b/nix/modules/home/mpd.nix index 087b19a..3ab9d2d 100644 --- a/nix/modules/home/mpd.nix +++ b/nix/modules/home/mpd.nix @@ -24,6 +24,20 @@ always_on "yes" # prevent MPD from disconnecting all listeners when playback is stopped. tags "yes" # httpd supports sending tags to listening streams. } +audio_output { + type "shout" + encoding "ogg" + name "my cool stream" + host "localhost" + port "8000" + mount "/example.ogg" + user "source" + password "" + + bitrate "64" + format "44100:16:1" + description "Nullring public radio" +} ''; }; } diff --git a/nix/modules/icecast.nix b/nix/modules/icecast.nix new file mode 100644 index 0000000..0cef018 --- /dev/null +++ b/nix/modules/icecast.nix @@ -0,0 +1,21 @@ +{ lib, config, ... }: +{ + services.icecast = { + enable = lib.mkDefault config.monorepo.profiles.server.enable; + listen.address = "0.0.0.0"; + extraConfig = '' + + 0 + /stream.m3u + 3600 + + + +
+ + +''; + }; + admin.password = "changeme"; +} diff --git a/nix/modules/inspircd.nix b/nix/modules/inspircd.nix new file mode 100644 index 0000000..bf3e9ba --- /dev/null +++ b/nix/modules/inspircd.nix @@ -0,0 +1,539 @@ +{ lib, config, ... }: +{ + services.inspircd = { + enable = lib.mkDefault config.monorepo.profiles.server.enable; + modules = [ "ssl_openssl" ]; + config = '' + + + + + + + + + + + #hash="sha256" + + # diepass: Password for opers to use if they need to shutdown (die) + # a server. + diepass="" + + # restartpass: Password for opers to use if they need to restart + # a server. + restartpass=""> + + + + +#-#-#-#-#-#-#-#-#-#-#-#- CIDR CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#- +# # +# CIDR configuration allows detection of clones and applying of # +# throttle limits across a CIDR range. (A CIDR range is a group of # +# IPs, for example, the CIDR range 192.168.1.0-192.168.1.255 may be # +# represented as 192.168.1.0/24). This means that abuse across an ISP # +# is detected and curtailed much easier. Here is a good chart that # +# shows how many IPs the different CIDRs correspond to: # +# http://en.wikipedia.org/wiki/CIDR#Prefix_aggregation # +# # + + + + + +#-#-#-#-#-#-#-#-#-#-#-#-#-#-# DNS SERVER -#-#-#-#-#-#-#-#-#-#-#-#-#-#-# +# If these values are not defined, InspIRCd uses the default DNS resolver +# of your system. + + + +# An example of using an IPv6 nameserver +# + +#-#-#-#-#-#-#-#-#-#-#-#-#-#-# PID FILE -#-#-#-#-#-#-#-#-#-#-#-#-#-#-# +# # +# Define the path to the PID file here. The PID file can be used to # +# rehash the ircd from the shell or to terminate the ircd from the # +# shell using shell scripts, perl scripts, etc... and to monitor the # +# ircd's state via cron jobs. If this is a relative path, it will be # +# relative to the configuration directory, and if it is not defined, # +# the default of 'inspircd.pid' is used. # +# # + +# + +#-#-#-#-#-#-#-#-#-#-#-#-#- BANLIST LIMITS #-#-#-#-#-#-#-#-#-#-#-#-#-#-# +# # +# Use these tags to customise the ban limits on a per channel basis. # +# The tags are read from top to bottom, and any tag found which # +# matches the channels name applies the banlimit to that channel. # +# It is advisable to put an entry with the channel as '*' at the # +# bottom of the list. If none are specified or no maxbans tag is # +# matched, the banlist size defaults to 64 entries. # +# # + + + + +#-#-#-#-#-#-#-#-#-#-#- DISABLED FEATURES -#-#-#-#-#-#-#-#-#-#-#-#-#-# +# # +# This tag is optional, and specifies one or more features which are # +# not available to non-operators. # +# # +# For example you may wish to disable NICK and prevent non-opers from # +# changing their nicknames. # +# Note that any disabled commands take effect only after the user has # +# 'registered' (e.g. after the initial USER/NICK/PASS on connection) # +# so for example disabling NICK will not cripple your network. # +# # +# You can also define if you want to disable any channelmodes # +# or usermodes from your users. # +# # +# `fakenonexistant' will make the ircd pretend that nonexistant # +# commands simply don't exist to non-opers ("no such command"). # +# # +# + + +#-#-#-#-#-#-#-#-#-#-#-#-#-#-#- RTFM LINE -#-#-#-#-#-#-#-#-#-#-#-#-#-# +# # +# Just remove this... Its here to make you read ALL of the config # +# file options ;) # + +# + + + +#-#-#-#-#-#-#-#-#-#-#-#-#- SERVER OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#-# +# # +# Settings to define which features are usable on your server. # +# # + + + + # suffixpart: What (if anything) users' part message + # should be suffixed with. + suffixpart=""" + + # fixedquit: Set all users' quit messages to this value. + #fixedquit="" + + # fixedpart: Set all users' part messages in all channels + # to this value. + #fixedpart="" + + # syntaxhints: If enabled, if a user fails to send the correct parameters + # for a command, the ircd will give back some help text of what + # the correct parameters are. + syntaxhints="no" + + # cyclehosts: If enabled, when a user gets a host set, it will cycle + # them in all their channels. If not, it will simply change their host + # without cycling them. + cyclehosts="yes" + + # cyclehostsfromuser: If enabled, the source of the mode change for + # cyclehosts will be the user who cycled. This can look nicer, but + # triggers anti-takeover mechanisms of some obsolete bots. + cyclehostsfromuser="no" + + # ircumsgprefix: Use undernet-style message prefixing for NOTICE and + # PRIVMSG. If enabled, it will add users' prefix to the line, if not, + # it will just message the user normally. + ircumsgprefix="no" + + # announcets: If set to yes, when the timestamp on a channel changes, all users + # in the channel will be sent a NOTICE about it. + announcets="yes" + + # allowmismatch: Setting this option to yes will allow servers to link even + # if they don't have the same "optionally common" modules loaded. Setting this to + # yes may introduce some desyncs and unwanted behaviour. + allowmismatch="no" + + # defaultbind: Sets the default for tags without an address. Choices are + # ipv4 or ipv6; if not specified, IPv6 will be used if your system has support, + # falling back to IPv4 otherwise. + defaultbind="auto" + + # hostintopic: If enabled, channels will show the host of the topic setter + # in the topic. If set to no, it will only show the nick of the topic setter. + hostintopic="yes" + + # pingwarning: If a server does not respond to a ping within x seconds, + # it will send a notice to opers with snomask +l informing that the server + # is about to ping timeout. + pingwarning="15" + + # serverpingfreq: How often pings are sent between servers (in seconds). + serverpingfreq="60" + + # defaultmodes: What modes are set on a empty channel when a user + # joins it and it is unregistered. + defaultmodes="nt" + + # moronbanner: This is the text that is sent to a user when they are + # banned from the server. + moronbanner="You're banned! Email abuse@example.com with the ERROR line below for help." + + # exemptchanops: exemptions for channel access restrictions based on prefix. + exemptchanops="nonick:v flood:o" + + # invitebypassmodes: This allows /invite to bypass other channel modes. + # (Such as +k, +j, +l, etc.) + invitebypassmodes="yes" + + # nosnoticestack: This prevents snotices from 'stacking' and giving you + # the message saying '(last message repeated X times)'. Defaults to no. + nosnoticestack="no" + + # welcomenotice: When turned on, this sends a NOTICE to connecting users + # with the text Welcome to ! after successful registration. + # Defaults to yes. + welcomenotice="yes"> + + +#-#-#-#-#-#-#-#-#-#-#-# PERFORMANCE CONFIGURATION #-#-#-#-#-#-#-#-#-#-# +# # + + + +#-#-#-#-#-#-#-#-#-#-#-# SECURITY CONFIGURATION #-#-#-#-#-#-#-#-#-#-#-# +# # + +