Cola Gang Industries

Unstructured tech for the curious

Okay! First, thank you for swinging by, and I do hope you find this helpful. Second, many thanks to the /r/NixOS peeps for the feedback. Third, even though we are all children of Chaos, fighting high entropy is in our nature. In order to bring a smidge of order to this thing, the damn files were pushed to the Codeberg repo. Every time we finish a part of the series, I’ll push the final configs to Codeberg so you can just clone or copy. I am following along myself with a fresh NixOS install, so the code (can you call that code?) is known to work. I guess. Obviously, if I do something stupid, you are more than welcome to open a pull request.

The configs we’re written so far are in the part1 directory for your viewing pleasure(?). I did some refactoring, and I'll change the previous posts to reflect that.


Previously, on NixOS for the confused: We created a basic flake.nix file, did some home-manager things, and tweaked the configuration.nix a little. This part is a very brief intro to nixpkgs.

No better place to start than the NixOS package search. The Nix packages repository contains more than 80 fucking thousand packages, and, chances are you will find what you need there. The same page will let you search for options (more on this in a bit), and, to a certain extent, Flakes. Let’s focus on the packages, though.


Enough teasing! Let’s get to it. Today, we’ll create a very barebones flake that will do two things:

  1. Handle our main configuration.nix ;

  2. Install and handle our home-manager stuff.

I know you don’t care too much about these technicalities, but some context is needed. What in tarnation is configuration.nix and/or home-manager? Well, dear reader, let’s explore!


Click here for Part 0.

Okay, what are we even trying to do here? Well, reader, we are trying to go from zero to non-zero proficiency. There’s a whole lot of clever peeps out there who can literally perform arcane incantations with NixOS and summon ancient spirits to do their profane bidding. I’m not one of those. The point here is to get to a point where we have a functional environment to work with, without having to risk invoking the wrong otherworldly entity. We’ll be wrangling Flakes to get there. What are Flakes, you ask? Who gives a shit. Act like a true pro and just copy and paste stuff from the internet.

We’ll write our flake.nix , write some modules for our stuff, dump all that to a git repo over at Codeberg because, honestly, fuck GitHub. You can GitHub, though. Lots of things we’ll be doing are coming directly from there. I won’t be mad. Any git thingy will do (Coming soon! Hosting your own git thingy with Gitea!)

Where were we? Oh, yeah. So, a good place to start flakin’ and Nixin’ is to steal someone else’s work. I stumbled upon this repo that just happens to be maintained by a fellow compatriot. Go take a gander, read the Hopefully you won’t understand fuck all: that’s what we want.

Right! Here’s what we need to do:

  1. Create a git repo somewhere.

  2. In your NixOS, mkdir flakies(or whatever the hell you want to call the directory holding your flakes)

  3. Make that repo the remote (for example, git remote add origin

  4. Wait for the next part!

Listen, you ain’t gotta use git for this. You can very well write your flake.nix directly on your machine. You’ll get shit done, but it won’t be as awesome. At the end of the day, all we need is a directory with a flake.nix file in it.

Don’t have git installed on your brand new NixOS? Jesus Christ.

You can get it system-wide by adding something like this to your /etc/nixos/configuration.nix:

environment.systemPackages = with pkgs; [
        gitMinimal  ];

Or, you can be smart, nix-shell git, and let the flakes take care of it:

$ nix-shell -p gitMinimal

Oops! Forgot your text editor? Me, too! Again, two options:

environment.systemPackages = with pkgs; [
        neovim  ];

Or... nix-shell -p neovim

Obviously, if you forgot both:

environment.systemPackages = with pkgs; [

Or... nix-shell -p gitMinimal neovim

If you don't like vi/vim/Neovim, I can't help you there bud. Ok, ok. Just replace neovim with whatever editor you fancy.

As long as you have a way to write your flake.nix or pull it from a git repo, you're good.

Changed the /etc/nixos/configuration.nix? Don't forget to rebuild your system with sudo nixos-rebuild switch

Stick around for part 0.7, Cola Gang! With any luck, we'll get from ugly terminal to this:

Hi! Saying that a lot of folks on Mastodon were begging me to write some stuff about NixOS would be a lie. It was one person. Maybe two. No matter, though: we’re doing it anyway. In this series of n parts, I’m going to try and document my bumbling forays into NixOS territory.

“Cool!”, you say. And, yes, it is pretty “cool.” Before we start, however, let me establish some rules of engagement:

  • I assume NixOS is installed;
  • Flakes are going to be used;
  • Home Manager is going to happen;
  • There might be some colorful language, so reader discretion is advised;
  • I’m not going to fuck with making my own derivations, elaborate software building , etc;
  • This is just me documenting the journey from confused to typical NixOS enjoyer.

What will we do, then?

  • Get a cool Flake going to bootstrap our stuff;
  • Setup a sweet environment with Hyprland;
  • Blow up that Hyprland environment, start over with AwesomeWM;
  • Get some shit installed for our hardware hacking exploring needs;
  • Mount a goddamned NFS share in, like, 3 lines of .nix;
  • Install a whole FPGA toolchain in, like, 7 lines of .nix;
  • Manage UDEV nonsense in, like, 1 line of .nix because we want USB devices without sudo-ing everywhere.

Sounds pretty good, eh? Let’s get to it. All the cool kids are Nix-ing these days, and you don’t want to miss out. REMEMBER, though: I don’t really know what I’m doing; and that’s the best way to learn.

And, oh… Obviously this thing is getting pushed to RSS and to the Fediverse for your reading pleasure.

Part I coming soon. Let's do that NixOS!

Enter your email to subscribe to updates.