This repository contains the work I’ve done to package xander1988’s scalable dockapps as Nix derivations.
default.nix is a function.
It needs to be called with these dependencies:
nix-common: https://github.com/nvimtor/nix-commondockappsSource: https://gitlab.com/xander1988/dockappslibdockapp4Source: https://gitlab.com/xander1988/libdockapppkgs: yournixpkgs
It returns an attrset with three outputs:
packages- the package scope of built dockapp derivations.
homeManagerModules- home-manager modules for the dockapps that have one.
lib- the
mkDockappModulebuilder, for authoring your own.
All packages are individually ”callPackageable” within the dockapps/ folder.
You’ll need a Nix package scope with some dependencies in (mkDockapp, libdockapp4, etc.). You can do it yourself or just use the package scope already provided (the packages attribute).
.homeManagerModules holds one module per dockapp that has configurable options, plus a default aggregate that imports all of them. Options live under programs.dockapps.<name>, with cross-app defaults under programs.dockapps.settings.
Each module’s package defaults (via mkDefault) to the matching derivation from .packages, so enabling a dockapp needs nothing more:
{ # inside a home-manager configuration
imports = [ dockapps.homeManagerModules.default ];
programs.dockapps.settings.scale = 2; # applied to every enabled dockapp
programs.dockapps.wmweather = {
enable = true; # package auto-filled
station = "EGCC";
metric = true;
};
}.lib.mkDockappModule is the same builder these modules use; give it a name and an option spec and it returns a home-manager module wiring up a wrapper + config file.
See example/; it uses npins to pin the dependencies. But you can use whatever (flakes, niv, etc.).