Skip to content

build(nix): add flake with package, app, & devShell - #66

Merged
vyrx-dev merged 1 commit into
vyrx-dev:masterfrom
masterned:nix-flake
Jul 22, 2026
Merged

vyrx-dev merged 1 commit into
vyrx-dev:masterfrom
masterned:nix-flake

Conversation

@masterned

Copy link
Copy Markdown
Contributor

I created a nix flake using flake-parts with a package, app, and devShell.

I added .envrc to enable devenv for automatically loading the devShell for those who use it.

I've tested the tool on my local system. I'm running NixOS unstable. I do not have access to a MacOS device, so I did not add "aarch64-darwin" to the systems array in flake.nix.

@vyrx-dev

Copy link
Copy Markdown
Owner

I can't thank you enough! I switched to Nix two days ago, and this was something I really wanted to do.

Before I merge it, could you please confirm if it's written correctly? I'm asking because I don't really understand how flakes work yet.

Other than that, do you have any tips for someone who's new to Nix?

@masterned

Copy link
Copy Markdown
Contributor Author

I'm pretty sure it's written correctly. When I used nix run on my machine, it ran it without me needing to install it. nix build created the result properly. And, I even tested it in my home-manager config using the instructions I added to the README (slightly modified to match my repo's details), and it worked.
(hopefully we don't run into the dreaded "it works on my machine" situation)

I still have it hosted on my github publicly, so if you want to check it out you can use nix run github:masterned/toofan. It should run straight from there if you have flakes enabled on your system1. As soon as you run a garbage collect, it will be removed from your system.

As for tips for someone just starting out:

  • Vimjoyer on YouTube has some great tutorials if you haven't already checked them out (he has a great one on flakes, what they are, how they work, and how you can use them).
  • Also, don't feel like you have to know how everything works. Nix can be overwhelming at times (there's still a lot of it I don't understand).

Footnotes

  1. If you're on nixos, make sure you have nix.settings.experimental-features = [ "nix-command" "flakes" ];. Otherwise, if you're using home-manager outside of nixos, you can use nix = { package = pkgs.nix; settings.experimental-features = [ "nix-command" "flakes" ]; };. Or if you're just using nix as a package manager, you can add experimental-features = nix-command flakes to either your ~/.config/nix/nix.conf or /etc/nix/nix.conf. ↩

@vyrx-dev

Copy link
Copy Markdown
Owner

nix run github:masterned/toofan yep working

image

@vyrx-dev
vyrx-dev merged commit 54383d0 into vyrx-dev:master Jul 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants