Almost every NixOS tutorial I encounter, be that blog or video, says to use Flakes and Home Manager. While that definitely speaks to the value of these tools, I find myself, instinctually, wanting to avoid them. I’ve attempted to get them working multiple time, and encountered more issues than they solved, for me. I interpret this to mean my knowledge and/or use case of NixOS is not ready for me to use these tools effectively. On top of that, something about a set of files that could all be put into a single unified config appeals to me (which flakes/hm can probably do too, but hopefully to get my vibe).

My reasoning aside, this has made me curious if there is some way for me to “backport” all these configs I encounter into my set of more default style configs. The primary goal I have that lead me to this is rootless Podman and declaring my containers in the config. If anyone has any guidance or resources you could point me to it would be much appreciated.

  • mat@linux.community
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 days ago

    What makes a flake config a flake config is simply the flake.nix entry point. So, technically if you read that file to see what file it loads for the nixosConfiguration you want to “port”, you should be able to just go directly from that file and bypass the flake.nix. For the longest time, my own flake simply forwarded to my configuration.nix.

    However, depending on your needs of course, but using flakes even at a basic level can be very useful and I’d 100% encourage doing a basic setup for someone starting out. The main feature here is being able to lock your dependencies (including nixpkgs) to a specific commit, which means you will always get the same resulting setup (not depending on when you installed it, like it does without flakes). But, you know better than me the requirements of your own setup :)

    • Arkhive@piefed.blahaj.zoneOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 days ago

      Lots of good suggestions from people, and replying individually was going to be a mess. Please see the comment I added.

    • Oinks@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      2 days ago

      If you just want pinning you can also use npins, and it doesn’t do any of the annoying other things Flakes do like copying the entire repository to the Nix store or failing to import unstaged or gitignored files.