Zen Browser via Flake Parts (Dendritic Nix)

Hi!

I’ve started using flake parts lately but I kinda jumped into the deep end. :sweat_smile:
I used zen browser when I was previously just using flakes, but now I’m wondering if there is a “proper“ or “standard“ way of adding flake packages when using a dendritic setup.

Could someone inform me of what these standards might be if they exist?
It’d be nice to have a loose guide I could use for any flake I find in the future.

For more info, I followed the vimjoyer video for niri + noctalia shell (Though I didn’t install noctalia, instead opting for waybar, mako, and swaydb. Though that last one may change soon).
I started my flake parts / dendritic nix config around 4 days ago. Previously I had a config that was based around flakes and home manager and I’m glad I switched.

wait, is this supposed to make it different? they still use the same entry-point, right?

and even then, this is all still nix, so you could also still just propagate the package in question by pkgs overlays rather than grab it from the flake inputs everywhere

1 Like

Hello,

I think this might be helpful for you: GitHub - drupol/pkgs-by-name-for-flake-parts: A plugin for flake.parts framework. · GitHub

How I do it is put packages in perSystem and add the inputs' and self' arguments to my NixOS/HM/system-manager evals via withSystem and specialArgs so I can use self'.packages.<package-name>. This also makes it easy to debug my own derivations as I can just do nix build .#<package-name> without rebuilding the whole system.

Or, if you mean consuming another flakes packages, some of this still stands (inputs' and self') so you can use inputs'.<input-name>.packages.<package-name>.

For declaring flake inputs I use flake-file.

I did not use this exactly bc I only just figured it out on my own.
thanks for the help, but my solution does closely match this one so I’ll keep it as the primary solution for now

1 Like

A more concrete example for someone else looking at this topic: puntbestanden/modules/dev/nixpkgs-update-telegram.nix at 4dab45f7ddd1511a5ed70555f6934103639b4b9b · dtomvan/puntbestanden · GitHub

I define a shell script in perSystem, which I then later use in one of my nixos modules. Note that the inputs' and self' arguments aren’t available by default. What I do roughly when I’m instantiating NixOS configs:

{ inputs, withSystem ... }:
let
  system = "x86_64-linux";
in
{
  nixosConfigurations.foobar = inputs.nixpkgs.lib.nixosSystem {
    modules = [
      self.modules.nixos.baz
      (withSystem system ({ pkgs, inputs', self', ... }: {
        # You don't have to do this if you don't customize what `pkgs` means in `perSystem`
        # See https://flake.parts/system.html#approach-2-configure-pkgs-once-in-persystem
        nixpkgs = { inherit pkgs; };
        _module.args = { inherit inputs' self'; };
      })
    ];
  };
}
1 Like