• 13 Posts
  • 19 Comments
Joined 1 year ago
cake
Cake day: June 11th, 2023

help-circle



  • There’s two ways to create a dev-environment, which is how you should start. Don’t worry about building a project with nix until you get a dev shell with all your (runtime) dependencies. You can do this by creating a shell.nix or use flakes and have an output for devShells.default. You can use mkShell to accomplish this. I would give you a reference config, but I can’t do that at the moment. If you need help with this later reach out and I’ll get something together.

    After that you can work on building it. This involves making a derivation that contains the runtime dependencies of your code, as well as the source itself. If its python, this would include, likely, the entirety of your project. This could be a little tricky, but a lot of people package python code, so there’s things in nixpkgs meant for packages python projects. This article might be helpful, or out-dated: https://nixos.wiki/wiki/Python but it should point to some useful things in nixpkgs to build python projects.

    Then, you can focus on containerization, if you really need it. I don’t know how much you know about nix, but building in nix inherently isolates dependencies away from one another, so if you get the process above working you know it is reproducible. But unlike a container, the above build structure only works on a machine with nix. So if you want to distribute your project as a container, while utiltizing your nix build process, you can look into something like dockerTools from nixpkgs: https://nix.dev/tutorials/nixos/building-and-running-docker-images.html

    Let me know if you have more questions.












  • This is one of those times I would throw my hands up and look at virtualization instead. Containerization with docker/podman is an option. I recall some time ago there was a utility that sort of embeded different distributions within your own, and you could run commands natively on the host machine but in the environment of the VM. I might also be confusing that with VanillaOS or BlendOS features that have that built in to the OS. APX is VanillaOS’s package manager that might be another option, although its getting messy at this point.









  • I’ve been slowly expanding my home manager configuration to consume more and more of my existing dotfiles and programs. Whats awesome is how short it’s taken me to say, convert my neovim config over. It was small anyway, since I never jumped into nvim configuration. But since nix made it so easy to add on plugins, I’ve been having a lot of fun and it’s been easy to iterate upon.

    Eventually I’m going to have to break out my config between my two systems, since I’m starting to install some beefier creative GUI utilities (gimp, blender, inkscape) on my laptop, which I don’t do (or want to do) that creative work on.