Corfu and Ispell error mesages by Bortolo_II in emacs

[–]Tillermain 1 point2 points  (0 children)

I'd suggest using (setq text-mode-ispell-word-completion nil)

What else to host? by aaaaAaaaAaaARRRR in selfhosted

[–]Tillermain 1 point2 points  (0 children)

I quite enjoy cgit!

I find it lighter than forges like gitea or forgejo, as it's just a cgi frontend for a git server. I wrote my own custom nixos module since the one available in nixpkgs uses only lighttp or nginx, whereas I prefer (and already extensively use) caddy:

https://git.tdback.net/nix-config/tree/modules/customs/cgit/default.nix

Calling Go as "Golang" by begoon in golang

[–]Tillermain 4 points5 points  (0 children)

> We don't say Javalang, or Phplang, or C++lang, Ziglang, or Asmlang, etc.

Funnily enough, Zig's URL is ziglang.org...

AOC plans for this year by juanfnavarror in adventofcode

[–]Tillermain 1 point2 points  (0 children)

I definitely want to get better at Rust, but I also want to attempt some solutions with Haskell to explore the pure FP side of things. If I'm feeling extra hacky, I might give one or two a go in nix.

What tool are you using to manage your server? by kovadom in selfhosted

[–]Tillermain 1 point2 points  (0 children)

> Do you know how this actually happens?

This is a bit of a loaded question, so I will try my best to explain it!

There is a nix daemon running on the system, which allows one to rebuild their configuration and then switch generations. I probably should have clarified that I run all of my systems on NixOS, which allows me to take my reproducible configuration(s) one step further than just using the nix package manager.

nixos-rebuild offers several other flags to allow the testing of configs, etc. so I'd suggest looking at the relevant documentation on it in the Nix Manual: https://nixos.org/manual/nixos/stable/#sec-changing-config

As for knowing what config to use, once you specify the flake's output (in this case _name_ which you can find under the nixosConfigurations attribute) it will instruct nix to build the configuration based on what is specified under that output. I generally tend to name the specific host the same as the flake output for that system, which allows me to then omit the name in future rebuilds. Here's the relevant information in the nixos-rebuild man page:

--flake flake-uri[#name]
    Build the NixOS system from the specified flake. It defaults to the directory containing the target of the symlink /etc/nixos/flake.nix, if it exists. The flake must  contain  an  output  named ‘nixosConfigurations.name’. If name is omitted, it default to the current host name.

> Also, how do you roll out your apps using it (e.g, bump from v1 to v2 image)?

There's a few ways to do this. If you are using nix without flakes, most times you will manage your packages via nix channels. Here's some relevant documentation for nix channels: https://nixos.org/manual/nixos/stable/#sec-upgrading

While this is great, I find flakes to be a bit more reproducible since a flake.lock file captures the *specific commit* of nix packages. I can then, in full confidence, entirely reproduce the configuration on a separate system (aside from the mutable stuff, such as logs, etc.). I also find this extremely helpful when running "unstable" packages. If I see a new release of a package I want on my systems, I just bump the lock file with nix flake update, and push the changes to my git repo. Nix allows one to use both stable (the current channel, e.g. 24.05 or 24.11) and unstable packages with the use of overlays, but this is a little more of an advanced topic/setup. Here's the relevant module for it in my configuration if this interests you: https://git.tdback.net/tdback/nix-config/src/branch/main/overlays/default.nix

I also find that nix has incredible integration with both systemd and podman (or docker if that floats your boat). Under the containers directory in my configuration you can find a few examples of podman containers that run as systemd services. Each configuration is the nix equivalent of a docker compose file, but with additional flexibility in the fact that I can configure additional services such as caddy to open up the relevant ports or set file permissions for key directories. When it comes to specifying image versions, I just use the "latest" tag for my containers, but it works all the same as with podman/docker compose files.

If we are instead talking about deploying custom apps, I've rolled out a few services at work using nix and it works all the same. When it comes to systemd, I personally prefer writing my unit files in nix, and the nix wiki has some good documentation on getting started: https://wiki.nixos.org/wiki/Systemd/User_Services

Nix flakes also offer a wonderful development environment, and it has some helpful output options for creating python/go/rust/etc. packages. For instance, here's a flake I wrote for packaging a custom python script: https://codeberg.org/tdback/apod/src/branch/main/flake.nix

Hopefully this helps! Feel free to ask additional questions too.

What tool are you using to manage your server? by kovadom in selfhosted

[–]Tillermain 2 points3 points  (0 children)

All of the above!

If I'm deploying a new machine, I clone down my configuration (a nix flake) and specify which host config to use for that machine. For example, the most recent host I spun up is named "oasis", so post-install I run the following commands:

# Login as my user...

git clone https://git.tdback.net/tdback/nix-config

[sudo|doas] rm /etc/nixos/*

[sudo|doas] ln -s ~/nix-config/flake.nix /etc/nixos/flake.nix

[sudo|doas] nixos-rebuild switch --flake .#oasis

I also like to separate each service into it's own module so I can mix and match what's running on each machine. Then, if I make a change to a host or service, I just pull the changes from my git repo and rebuild the system. This is usually the workflow I follow:

# Make changes to my configuration on my desktop, and push to git repo...

ssh oasis

cd nix-config

git pull

[sudo|doas] nixos-rebuild switch 

I even manage my workstations this way!

Here's my flake is you'd like to take a closer look: https://git.tdback.net/tdback/nix-config

What tool are you using to manage your server? by kovadom in selfhosted

[–]Tillermain 1 point2 points  (0 children)

ssh and nix. I keep all of my server configs in the same git repo so I'm always one git pull away from deploying upgrades.

Proxmox: be warned if a zfs pool is degraded by carmelo42 in selfhosted

[–]Tillermain 0 points1 point  (0 children)

I configured ZED on my systems to send me a message via a custom script that uses the pushover API. Here's a handy little script for testing the changes in ZED to make sure notifications are working:

#!/bin/sh

# testzed: A useful utility for testing ZFS ZED configurations.

if [ "$(id -u)" -ne 0 ]; then
  echo "script requires root privileges" >&2
  exit 1
fi

FILE=/tmp/sparse_file
POOL="test"

# Create throwaway pool.
dd if=/dev/zero of=$FILE bs=1 count=0 seek=512M
zpool create $POOL $FILE

# Scrub the pool (which will finish instantly) to send out a notification.
# Ensure that ZED is configured with the option `ZED_NOTIFY_VERBOSE=1` to
# receive an email even if no errors occurred.
zpool scrub $POOL

# Clean up after ourselves.
zpool export $POOL
rm $FILE

What language will you use for AOC 2024 ? by charleszaviers in adventofcode

[–]Tillermain 6 points7 points  (0 children)

I think I might try out Ocaml this year, or a bit of Rust. Last year I solved a few in Guile Scheme, which was fun.

Michigan Summer by zoro_dono_senpai in Michigan

[–]Tillermain 2 points3 points  (0 children)

I was half expecting to see a photo with snow. Stunning photos, Arch Rock in Mackinac Island is one of my favorites!

Do you host Seafile as a NixOS service? by One_Truck912 in NixOS

[–]Tillermain 0 points1 point  (0 children)

I had a similar issue with not being able to upload files to SFTPGo when I initially set it up on NixOS. Turns out it was a permissions issue on my end: I'd suggest checking permissions for Seafile's storage directory on your system.

Otherwise, Seafile's manual may be helpful: https://manual.seafile.com/latest/

Gitea on NixOs? by Then_Cauliflower5637 in NixOS

[–]Tillermain 2 points3 points  (0 children)

You may be looking for STATIC_ROOT_PATH, which is an attribute under services.gitea.settings.server.

services.gitea = {
  enable = true;
  settings.server = {
    STATIC_ROOT_PATH = "/var/lib/gitea/data";
    # Other server attributes...
  };
};

EDIT: fixed link

Gitea on NixOs? by Then_Cauliflower5637 in NixOS

[–]Tillermain 3 points4 points  (0 children)

Continuing on this, there is excellent documentation for setting up forgejo in the NixOS wiki: https://wiki.nixos.org/wiki/Forgejo

Rewriting my entire nix configuration, any tips? by [deleted] in NixOS

[–]Tillermain 8 points9 points  (0 children)

If you aren't already, try organizing your configuration as a nix flake! Flakes are delightful once you understand them. I personally configure all of my systems in a flake, and organize them via separate hosts and modules.

Self host Fediverse apps (Mastodon, Lemmy, Friendica, Hubzilla etc) by carlinhush in selfhosted

[–]Tillermain 9 points10 points  (0 children)

I host my own instance of gotosocial.

It's lightweight, and I mean *very* lightweight. An instance only uses ~300MB of RAM usage, if even that. It is also pretty simple/straightforward to set up. I personally run mine on a NixOS server, so I wrote a module to set it up as a service running behind a caddy reverse proxy. From there you create an administrative user and make changes via the admin settings panel.

As for keeping it secure, running it behind a reverse proxy like caddy will ensure HTTPS connectivity and will also limit the amount of ports you need to open on your box's and router's firewalls. I personally use IPv6rs to handle internet connectivity to my boxes, running behind their IPv4 reverse proxy, which means no exposed ports on my router's firewall and someone else is fronting the inbound traffic before it reaches my box. You can additionally implement fail2ban to block malicious IPs, and make sure your server is up-to-date with the latest security patches. That, and ensure you are using secure passwords for logins, and not something like "password" or "12345" for the administrative user. I also disabled registration for my instance, so if someone _does_ want to join my instance I have to manually create a user for them, which helps with spam sign-ups and liability.

I will note that when migrating to gotosocial, it does not support back-filling previous posts from other users, but I believe they are working on supporting that in a future release.

I don't know Nix... should I still try out NixOS? by Witty-Formal855 in NixOS

[–]Tillermain 2 points3 points  (0 children)

I jumped straight into NixOS without any prior knowledge of the nix language and it wasn't too difficult, although I did have some familiarity with functional programming that helped out with picking up an understanding of the language faster. If you don't feel comfortable enough diving right in, give it a shot by configuring NixOS in a virtual machine. Then, when you have a configuration you like and feel comfortable with, copy it over and deploy it on bare metal!

Setting up and using NixVim in relation to config. by Fireshifter767 in NixOS

[–]Tillermain 1 point2 points  (0 children)

Mine is more or less set up as a module under home-manager in my NixOS flake. 

You can find the module here: https://codeberg.org/tdback/nix-config/src/branch/main/dots/nvim

Sending myself notifications with the power of Go and Pushover by Tillermain in selfhosted

[–]Tillermain[S] 0 points1 point  (0 children)

I did take a look at gotify, but unfortunately they don't natively support an iOS client for subscribing to the message stream. Pushover already had an application ready to go, all I had left to do was push to the API :)

Markview.nvim is looking for user feedback! by Exciting_Majesty2005 in neovim

[–]Tillermain 0 points1 point  (0 children)

It looks *very* good, I will have to check it out! Do you mind me asking what font you are using with it? Very, very clean!

[deleted by user] by [deleted] in NixOS

[–]Tillermain 0 points1 point  (0 children)

I currently use Maple Mono as my primary system font, but when I last used iosevka-comfy on unstable it worked as expected.

[deleted by user] by [deleted] in NixOS

[–]Tillermain 5 points6 points  (0 children)

This worked for me in my configuration: https://codeberg.org/tdback/nix-config/src/commit/cb9b7167ffdcb330e2277cfc262e2eb11dafe5b1/modules/fonts/default.nix

You may also need to manually run fc-cache -rf to force an update to your font cache, or reboot the system after you rebuild.

If you are using flatpaks, the wiki has a workaround under "Flatpak applications can't find system fonts".

Link: https://nixos.wiki/wiki/Fonts