Skip to content

nvimtor/dockapps.nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dockapps.nix

This repository contains the work I’ve done to package xander1988’s scalable dockapps as Nix derivations.

How to use this

default.nix is a function.

It needs to be called with these dependencies:

  1. nix-common: https://github.com/nvimtor/nix-common
  2. dockappsSource: https://gitlab.com/xander1988/dockapps
  3. libdockapp4Source: https://gitlab.com/xander1988/libdockapp
  4. pkgs: your nixpkgs

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 mkDockappModule builder, for authoring your own.

Packages

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).

Home-manager modules

.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;
  };
}

Authoring your own module

.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.

Example

See example/; it uses npins to pin the dependencies. But you can use whatever (flakes, niv, etc.).

About

xander1988's scalable dockapps as Nix derivations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages