Looking for good resources for a selfhosted home-server, especially the more advanced stuff
So, I got into NixOS and installed it on a VPS a few days ago. I've previously used yunohost.org (a debian based all-in-one selfhosting solution) and docker-compose. But I (now) really like the Nix(OS) approach, the amount of packaged software and how everything ties together in a clean server configuration.
However... I need a bit more information on the server stuff. Are there nice configurations around which I can incorporate and learn from? Extensive tutorials from other people who run their own services or communities?
I mean the basic stuff isn't a problem. I got Nextcloud and the most important stuff running, a DNS Adblocker, a chat server, nginx etc. But ultimately I'd like to share some services with friends and family. So I need single sign-on (SSO), preferably with an LDAP directory. An email server... And the Wiki and just googling it stop being helpful at this point.
Are there people who share their experience with LDAP/Authentik/Zitadel/Authelia/Keycloak / whatever SSO/Authentication software is packaged in Nix but I can't find anything about from people who actually use it? A comparison of the several available email servers?
Here's mine fwiw - no SSO or LDAP but might add something to what you find. My journey is to move from a NixOS user of 2 years and 1 year 'all in'. I run my own mail server with NixOS.
nixos-mailserver works well for me. The package set runs faultlessly on the smallest OVH vps. NixOS gives me the ability to redeploy anywhere painlessly and the backup need is limited to a dovecot sync. Dovecot sync is neat: with a 2nd identical vps (match configuration.nix) and non functional but services running duplicates all the live mail data with one command.
I am going all in on Rust too. There is a rust based mail server being developed that I might track as a migration in years to come.
Reading material
Learn { NixOS, Nix }
Flake specific
are simply a special entry point for Nix code with a built in pinning system
Wow. Thanks. Guess the "your previous linux knowledge doesn't really apply to NixOS" is correct. I already found the lengthy lists of stuff to read up on... I'll add this to my "read later" list :-D
Stalwart sounds nice, too. Since I'm just setting everything up, maybe I can try both mailservers. I've now had 2 people recommend the simple nixos-mailserver.
Great, please may I ask if you would share other sources worth reading.
I think previous Linux knowledge helps, just less needed for newcomers; NixOS has been described as capturing others' 20 years experience for us to use. Nixos-mailserver is a great example. I used that out of the box and only with user knowledge of NixOS, none of mail tools. Otherwise mail servers are too hard I gathered.
I've found lots more to learn about Nix for development environments.
You might want to use nixos-mailserver first for production - after my research I was gobsmacked at how quickly it went. I relied totally on NixOS. Your milage might vary but I'd be shocked if it takes less than 10 times as long another way.
Uh, just tried to install Stalwart, the Rust mailserver suite. It's nice. But you have to switch to nixos-unstable to get some important features as of now. And then I can't find any resources on how to set it up. Meaning there are no sane defaults floating around on the internet and it's really a chore to learn the internals and come up with a proper config. Maybe the nix-mailserver is a better choice for now.
Good that you tried. Nix simple mailserver is really neat. I am very pleased with it. I feel something like stalwart might take years to mature, but worth watching.
For a mail server, I use https://nixos-mailserver.readthedocs.io/en/latest/index.html . Very easy to set up, and it seems to work. But I do get a lot of anxiety about it because of all the people who say you should never under any circumstances set up your own mail server because of reputation and whatever. Just be aware that although mail-tester.com doesn't ding you for it, you really have to make sure your rDNS entry is set up correctly, and you need your own /64 IPv6 range.
i guess those who say you should not run your own mail server are maybe those who run one, earning money with it?
I am running my own mail server for >15 years now. What you should do:
never under no circumstances? sure, of course yes! but it can be some work to do. but if you do, its in my experience more stable than any provider, paid or unpaid, cloud or not, and you get the most possible privacy (all of your non-internal-only emails are available to at least one other server anyway) and flexibility too, and you have the possibility to proof that the other server lost your email, not yours as they like to just blindly claim by default =D
Thank you. That one already appeared in my search results. Seems like a traditional postfix/dovecot/rspamd setup.
I know. People always say you shouldn't run your own mailserver. I have. For like 10 years or so and I'm fine. Well... I'm more than fine. I really like the idea that my mailbox is stored on an encrypted volume at home and not somewhere in the cloud. Also it comes without any noticeable capacity limit, I got a large harddisk in my NAS/server. It's a bit annoying, though. I forward some email. And some of that goes to a gmail.com account of a friend. It's important first contact and admin mail, so the spam filter isn't super strict. And I got greylisted by gmail for doing that. Once a few spam mails slip through, google will stop talking to you. So I currently can't send mail to gmail users. I have a few free email accounts I use as a relay so I myself can still send mails. But it's annoying. It's part of the reason why I now want to redo my mailserver and have an updated rspamd and stuff. I get why people say you should let other people provide email service to you, but I don't see a proper reason except for it's annoying and frustrating and odds are against you. (Additionally it is a bit complicated to set up reverse pointers and MX records.)
Try posting at https://discourse.nixos.org/
I'm using LLDAP with Authelia on NixOS, it works fine for what I do but it's somewhat limited, haven't used it as an OIDC provider yet but that's on the list.