The Complete Computing Environment

Arroyo Nix Support

LifeTechEmacsTopicsArcology

,#+ARCOLOGYKEY: cce/arroyo/nix ,#+ARCOLOGYALLOWCRAWL: t

This document collects some support that is shared between Arroyo NixOS Generator and Arroyo Home Manager.

Making arroyo-nix an importable repository

So Arroyo dumps the tangled Nix files in to ~/arroyo-nix/:

ls ~/arroyo-nix
defexpr.nix
files
firefox
hm
home-manager.nix
home-manager.nix~
hosts
lib
networks
nixgl.nix
nixgl-pkg.nix
nixops
nixos
overrides
pkgs
roles
versions.nix

I have a handful of packages I want to export and include here. I have been trying to maintain a branch of nixpkgs containing my changes but it's been awfully difficult to keep it up to date and i haven't had the mental wherewithal to clean the changes up enough to merge in to nixpkgs.

{ pkgs ? import <nixpkgs> {} }:

with pkgs; {
  # The `lib`, `modules`, and `overlay` names are special
  lib = import ./lib { inherit pkgs; }; # functions
  # modules = import ./modules; # NixOS modules
  # overlays = import ./overlays; # nixpkgs overlays

  nixGL = callPackage ./pkgs/nixgl.nix {};
  myEmacs = callPackage ./pkgs/emacs.nix {};
} // (with python3Packages; rec {
  beetcamp = toPythonApplication (callPackage ./pkgs/beetcamp.nix {});
  jisho-api = toPythonModule (callPackage ./pkgs/jisho-api.nix {});
  pnoise = toPythonModule (callPackage ./pkgs/pnoise.nix {});
  qasync = toPythonModule (callPackage ./pkgs/qasync.nix {});
  svgelements = toPythonModule (callPackage ./pkgs/svgelements.nix {});
  hnswlib = toPythonModule (callPackage ./pkgs/hnswlib.nix {});
  vpypePackages = callPackage ./pkgs/vpype/default.nix {
    inherit pnoise;
    inherit svgelements;
    inherit qasync;
    inherit watchfiles;
    inherit hnswlib;
  };
  vpype = vpypePackages.vpype;
  vsketch = vpypePackages.vsketch;
  watchfiles = toPythonModule (callPackage ./pkgs/watchfiles/default.nix {});
})

Arroyo Nix nixpkgs overlay

Arroyo-Nix could be used as an nixpkgs overlay:

self: super:
let
  isReserved = n: n == "lib" || n == "overlays" || n == "modules";
  nameValuePair = n: v: { name = n; value = v; };
  nurAttrs = import ./default.nix { pkgs = super; };

  outAttrs = builtins.listToAttrs
  (map (n: nameValuePair n nurAttrs.${n})
    (builtins.filter (n: !isReserved n)
      (builtins.attrNames nurAttrs))) // {
        lib = (super.lib or {}) // (import ./lib/default.nix { pkgs = super; });
      };
in outAttrs

Arroyo Nix Library Helpers

Arroyo exposes some library helpers which i would like to not just bare-import:

{ pkgs }:

with pkgs.lib; {
  pkgVersions = pkgs.callPackage ../versions.nix {};
  mkKwriteConfig5 = pkgs.callPackage ./kde-configs.nix {};
  mkNixGLWrapper = pkgs.callPackage ./nixgl.nix {};
  mkActivationLocalLink = pkgs.callPackage ./mk_activation_local_link.nix {};
  publicKeys = import ./public-keys.nix;
}

Arroyo NixOS loads this as an overlay

Since arroyo is in my NIX_PATH, i can just import it. home-manager is configured to use the system nixpkgs.

{ pkgs, ... }:

{
  nixpkgs.overlays = [
    (import <arroyo/overlay.nix>)
  ];
}

NEXT figure all this out – probably have flake generation as well here.

NEXT probably need an arroyo-db keyword to note which packages go in default.nix…

and probably one for lib… uagh.

NEXT extract packages from nixpkgs

DONE beets-bandcamp

NEXT libqtolm

NEXT libquotient

NEXT neochat with e2e