• tinkling4938@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    2 days ago

    So I’ve only been using nix about a year and only used flakes. I use in two ways.

    First, I have my main nix flake. Most everything is controlled from that. It has several outputs from full blown nixos builds per host or some home manager builds for non-nixos systems.

    Third-party flakes I use as inputs to my own flake then use the override system to inject them into nixpkgs. Then I just install whatever like normal from nixpkgs. I can either override an existing pkg (neovim nightly replaces regular neovim for me), or you can just add as a new package to nixpkgs by using a different attribute name.

    Second way is for projects with their own repo. I’ll add a project flake that has a devshell with direnv so as soon as I enter that directory it sets up a sort of virtual environment just for that project. You can add outputs to it so others can use as a third-party flake.

    My main starting point was https://github.com/Misterio77/nix-config for this design.