arroyo/arroyo-nix.org

5.7 KiB
Raw Permalink Blame History

Arroyo Nix Support

,#+ARCOLOGY_KEY: cce/arroyo/nix ,#+ARCOLOGY_ALLOW_CRAWL: 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;
let
 dbot = callPackage ./pkgs/drawingbot.nix {};
in {
  # The `lib`, `modules`, and `overlay` names are special
  lib = import ./lib { inherit pkgs; }; # functions
  # modules = import ./modules; # NixOS modules
  # overlays = import ./overlays; # nixpkgs overlays
  overlays = [
    (import ./overlay.nix)
  ];

  nixGL = callPackage ./pkgs/nixgl.nix {};
  myEmacs = callPackage ./pkgs/emacs.nix {};
  arroyo-emacs = callPackage ./pkgs/emacs.nix {};

  cpmtools = callPackage ./pkgs/cpmtools.nix {};

  drawingbot-free = dbot;
  drawingbot-premium = (dbot.override {
    name = "drawingbotv3-premium";
  }).overrideAttrs (old: old // {
    src = /home/rrix/sync/DrawingBotV3-Premium-1.6.9-beta-linux.deb;
    meta.license = lib.licenses.unfree;
  });

  koreader = callPackage ./pkgs/koreader.nix { unpatched = pkgs.koreader; };
  homestuck = callPackage ./pkgs/homestuck-collection/default.nix {};

} // (with python3Packages; rec {
  bandcamp-dl = toPythonApplication (callPackage ./pkgs/bandcamp-dl.nix {});
  beetcamp = toPythonApplication (callPackage ./pkgs/beetcamp.nix {});
  jisho-api = toPythonModule (callPackage ./pkgs/jisho-api.nix {});

  vpypePackages = callPackage ./pkgs/vpype/default.nix {
    inherit pnoise;
    inherit svgelements;
    inherit qasync;
    inherit watchfiles;
    inherit hnswlib;
  };
  vpype = vpypePackages.vpype;
  vsketch = vpypePackages.vsketch;
  pnoise = toPythonModule (callPackage ./pkgs/pnoise.nix {});
  qasync = toPythonModule (callPackage ./pkgs/qasync.nix {});
  svgelements = toPythonModule (callPackage ./pkgs/svgelements.nix {});
  hnswlib = toPythonModule (callPackage ./pkgs/hnswlib.nix {});
  # watchfiles = toPythonModule (callPackage ./pkgs/watchfiles/default.nix {});

  feediverse = toPythonModule (callPackage ./pkgs/feediverse.nix {});

  inaturalist-to-sqlite = toPythonModule (callPackage ./pkgs/inaturalist-to-sqlite.nix {});
  twitter-to-sqlite = toPythonModule (callPackage ./pkgs/twitter-to-sqlite.nix {});

  matrix-feedbot = toPythonModule (callPackage ./pkgs/feedbot.nix {});

  arcology = toPythonModule (callPackage /home/rrix/org/arcology-fastapi/default.nix {});

  morph-wrapper = toPythonModule (callPackage /home/rrix/Code/morph-wrapper/default.nix {});

  passthroughbrowser = toPythonModule (callPackage ./pkgs/passthroughbrowser.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">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

  • State "DONE" from "NEXT" [2022-10-28 Fri 10:42]

NEXT libqtolm

NEXT libquotient

NEXT neochat with e2e