Idea: Debian + Nix == stable and funky fresh

I first came across Declarative Package Management in the manual. So I started making these packages based on it.

The install works (nix-env -iA nixpkgs.my-emacs), but nix-env -u doesn’t update changes (adding and removing packages from the paths). Do I need to reinstall my- packages to get updates as well? Does nix-env -u update package definitions (apt update)?

After that I came across zero-to-nix. This approach wasn’t mentioned at all in the quick start, and I came across comments that people shouldn’t use nix-env anymore. Should I create flakes instead of packages, and export their paths to have them available globally?

How do you use Nix to manage your packages? Do you have any examples?

nix-env/nix profile/home-manager?

  • Atemu@lemmy.ml
    link
    fedilink
    arrow-up
    6
    ·
    11 months ago

    That’s a really hacky method and should not be in the manual tbh.

    You should be able to update by “installing” your env again though.

    It’s a bit overkill but for declarative package management under non-NixOS, I use home-manager’s home.packages option. It does essentially this but wraps it in a nice package and home-manager can do a lot of other things too.

    As for flakes: No, you don’t require them to do any of this. They solve an entirely different problem.

    • Lupec@lemm.ee
      link
      fedilink
      arrow-up
      3
      ·
      11 months ago

      I second home-manager, it was my Nix gateway drug and I can’t recommend it enough!

    • drndramrndraOP
      link
      fedilink
      arrow-up
      2
      ·
      11 months ago

      That’s a really hacky method and should not be in the manual tbh.

      That’s why I’m asking, it seemed really odd.

      home-manager

      Thanks, this makes a lot more sense. Any good resources besides the wiki? Is there a way to break down home.packages into smaller chunks for modularity?

      As for flakes: No, you don’t require them to do any of this. They solve an entirely different problem.

      So they’re just to ensure reproducibility?

      • chayleaf@lemmy.ml
        link
        fedilink
        arrow-up
        3
        ·
        11 months ago

        Is there a way to break down home.packages into smaller chunks for modularity?

        home-manager uses the NixOS module system, so you can use everything that comes with it, like imports

        So they’re just to ensure reproducibility?

        That and for easier importing of other people’s Nix code