Logo

dev-resources.site

for different kinds of informations.

I use NixOS for my home-server, and you should too!

Published at
4/22/2024
Categories
nixos
linux
homeserver
homelab
Author
jasper-clarke
Categories
4 categories in total
nixos
open
linux
open
homeserver
open
homelab
open
Author
13 person written this
jasper-clarke
open
I use NixOS for my home-server, and you should too!

As we covered in my last post, NixOS is a amazing Linux distribution for creating stable and declared environments. Now while this is amazing for a desktop setup, it is also perfect for a home-server or home-lab.

Let's take a look at a few ways NixOS makes setting up a home-server so much smoother!

Self Hosting Services

NixOS has gained many integrations from a wide variety of services over the years but here are a few you will probably be interested in.

Jellyfin

Jellyfin Banner

Out of the box NixOS provides options to easily setup a Jellyfin instance on your computer, just add the following to your configuration.nix

services.jellyfin = {
  enable = true;
  dataDir = "/home/your-user/jellyfin/data";
  user = "your-user";
};
Enter fullscreen mode Exit fullscreen mode

It is that easy to spin up a fresh instance of Jellyfin and there are even more options all found on search.nixos.org

Vaultwarden

Vaulwarden banner

Never before has it been this easy to setup Vaultwarden, a fork of the Bitwarden server with all the features of a paid Bitwarden account!

services.vaultwarden = {
  enable = true;
  dbBackend = "postgresql";
  # Store your variables like admin password here
  environmentFile = "/home/your-user/vaultwarden/.env";
  config = {
    SIGNUPS_ALLOWED = false;
    DOMAIN = "https://vaultwarden.example.com";
  };
};
Enter fullscreen mode Exit fullscreen mode

There are even more options than these though so again make sure to checkout search.nixos.org

Nextcloud

Nextcloud Banner

Here we are the big boy himself, Nextcloud.
Of course like all the other popular self hosted services Nextcloud has a large variety of options to get your services up and running.

services.nextcloud = {
  enable = true;
  home = "/home/your-user/nextcloud";
  https = true;
  hostname = "nextcloud.example.com";
  settings = {
    trusted_domains = [
      "talk.nextcloud.example.com"
      "files.nextcloud.example.com"
    ];
  };
};
Enter fullscreen mode Exit fullscreen mode

And for the final time those are just a fraction of the available options to configure Nextcloud through NixOS, so if you need to configure anything else make sure to check out search.nixos.org/nextcloud.

So have I convinced you yet? NixOS really is the easiest way to manage all of your software on your desktop and home-server!

But what about Docker, there are some things that NixOS hasn't packaged yet so how do I use those or any of my other docker services?
Well do not worry, NixOS again makes it super simple to setup docker and even setup Nvidia Toolkit support for containers that want GPU utilization.

virtualisation.docker = {
  enable = true;
  # This option is deprecated and will be replaced 
  # soon but the new option doesn't seem to work 
  # properly yet so you can just use this.
  enableNvidia = true;
};

user.users.your-user = {
  # ...
  extraGroups = [ "docker" ];
  # ...
};
Enter fullscreen mode Exit fullscreen mode

Just like that your ready for anything docker to come, and for those who need to configure docker a bit more, maybe put it in rootless mode, can check out the options on search.nixos.org

Wrapping Up

Well that was easy wasn't it, just a few lines of code and a rebuild later and you could have all of these services up and at it!
This is all well but how do you actually get NixOS and set everything up in the first place?

That is exactly what I'm going to help you do, two weeks from now I'll be getting a new home-server and in a new post, or maybe series of posts, I'll go over everything I do to setup NixOS on my system, so make sure to follow me to stay tuned for those!

Another little promotion but if you are interested in NixOS, your just getting started or even if you are more experienced user, I have a documentation site where I publicly write about tons of issues I come across on my journey through NixOS and exactly how I fixed them.

As well I have a ton of resources linked for learning how to get started with NixOS so make sure to check it out at docs.windswept.digital

nixos Article's
30 articles in total
Favicon
How to Set Up Kanata on NixOS: A Step-by-Step Guide
Favicon
NixOS - A Unique Linux Distribution
Favicon
NixOS Full Disk Encryption with USB/SD-Card/Password Unlock
Favicon
Choosing my distro: Ubuntu, NixOS, Elementary OS or Pop!_OS
Favicon
Nix first steps
Favicon
OpenResty on NixOS for an API Gateway
Favicon
Why Consider NixOS for Your Environment?
Favicon
Managing NixOS on DigitalOcean with Colmena
Favicon
I Changed My Mind - NixOS is NOT the Best Linux
Favicon
Backup GitHub Repositories with gidek
Favicon
Packing Custom Fonts for NixOS
Favicon
Managing NixOS Secrets via SOPS, sops-nix and opsops
Favicon
Running NixOS Guests on QEMU
Favicon
Archiving PostgreSQL Backups on NixOS
Favicon
The Ultimate NixOS Homelab Guide - Flakes, Modules and Fail2Ban w/ Cloudflare
Favicon
The radical concept of NixOS and why I love it!
Favicon
The Ultimate NixOS Homelab Guide - The Install
Favicon
The One Man Stack
Favicon
I use NixOS for my home-server, and you should too!
Favicon
This distro finally fixes Linux
Favicon
Running a Terraria Dedicated Server on NixOS
Favicon
NixOS on Raspberry Pi 4 with Encrypted Filesystem
Favicon
Day 7: Uninstalling NixOS from my Macbook Pro
Favicon
Nixpkgs: A community-maintained package lock file for all of Unix
Favicon
Writing a (Nix-Friendly) Hello World Web App in Haskell with Scotty
Favicon
Kick the Mix-ups to the Curb: Nix the Tricks and Juggle Go Projects like a Pro
Favicon
Day 6: Making rEFInd Look Good
Favicon
Day 5: NixOS & Git - version control for config.nix
Favicon
Day 4: (Re)Installing NixOS on my Macbook Pro
Favicon
Day 3: Fighting with network interfaces

Featured ones: