personal nixos repo
Go to file
xenia 0983d7e40c kicad patch needs update so use upstream for now 2024-12-01 23:44:42 -05:00
lib oop 2024-09-20 13:22:36 -04:00
modules updates for 24.11 and other things 2024-12-01 23:17:48 -05:00
pkgs use resholve 2024-11-29 01:40:48 -05:00
support create documentation rendering derivation 2024-04-09 17:24:56 -04:00
.gitignore try 2 2024-10-21 17:31:19 -04:00
LICENSE.txt add readme and license 2024-04-07 18:28:42 -04:00
README.md update readme 2024-12-01 23:25:19 -05:00
TODO.md update todo 2024-10-22 02:45:53 -04:00
default.nix fix non-flake default.nix usage with extra args 2024-11-13 00:46:25 -05:00
flake.lock update deps 2024-12-01 23:18:48 -05:00
flake.nix oops 2024-12-01 23:21:01 -05:00
module.nix updates for 24.11 and other things 2024-12-01 23:17:48 -05:00
overlay.nix kicad patch needs update so use upstream for now 2024-12-01 23:44:42 -05:00
repl-overlay.nix updates for 24.11 and other things 2024-12-01 23:17:48 -05:00

README.md

Table of Contents

dragnpkgs

this is my personal nixos modules and packages repository. while it was designed for my own use, it's also intended to be flexible and reusable enough for general purpose usage. i might consider upstreaming into nixpkgs if there is sufficient interest

usage

dragnpkgs provides a set of nixos modules and a nixpkgs overlay containing custom packages. the modules require the overlay

non-flake

since i use flakes now (sigh!!!) i'm not supporting non-flake usage anymore. if you read the files in the repo there's a way to do it probably

flake

for flake usage, add this repo as an input and don't input nixpkgs at all, since we fully wrap it

{
  inputs = {
    # for nixos-24.11
    dragnpkgs.url = "git+https://git.lain.faith/haskal/dragnpkgs.git?ref=nixos-24.11";

    # for nixos-unstable
    dragnpkgs.url = "git+https://git.lain.faith/haskal/dragnpkgs.git?ref=main";
  };

  outputs = { self, dragnpkgs, ... }: {
    nixosConfigurations.mycomputer = dragnpkgs.lib.nixosSystem {
      ...
    };
  };
}

note that the dragnpkgs module sets a couple defaults -- see module.nix and the inline modules in flake.nix for details

  • disables nixpkgs self-registration in the flake registry and nix path and enables a dragnpkgs-specific registration mechanism for these that is enabled by default, see options.dragnpkgs
  • in flake.nix but not in module.nix: disable channels
  • add lix cache and its keys to substitutors
  • enable experimental features nix-command flakes repl-flake
  • disable the default flake registry. i think it's cringe
  • add a repl overlay that adds some useful utilities to nix repl -- see repl-overlay.nix for details

also note that overriding inputs to the flake won't necessarily work because of the way nixpkgs registers itself with the system. this requires really annoying hacks to get working at all. if you want to depend on dragnpkgs with a different version of nixpkgs (ie not 24.11 or unstable), clone the repo and recreate flake.lock. aren't flakes so cool and fun!!!!

options documentation

documentation for options provided by dragnpkgs

services.ghidra-server

the shared project server for ghidra

example usage:

services.ghidra-server = {
  enable = true;
  host = "your.domain.or.ip";
};

services.ghidra-server.enable

enables the ghidra server service

services.ghidra-server.enableAdminCli (true)

adds a system package for the CLI tool ghidra-svrAdmin, which allows anyone in the ghidra group to administer the server (this corresponds to the server/svrAdmin tool in the stock ghidra distribution)

services.ghidra-server.{package, jdkPackage} (ghidra_headless, openjdk21_headless)

allows overriding the ghidra package and jdk package used for the server

services.ghidra-server.host

the server hostname or IP; this is typically required (by java RMI) for correct operation

services.ghidra-server.basePort (13100)

the server will use 3 consecutive TCP ports starting from this port

services.ghidra-server.directory (ghidra-server)

the root directory for server files, as a subdirectory of /var/lib. this is needed because this option is passed to systemd StateDirectory=

services.ghidra-server.{user,group} (ghidra)

the service user and group

more coming soon(tm)

packages documentation

ghidra_headless

a variant of ghidra which does not have a dependency on any jdk, intended to reduce closure size for server operation with a headless jdk (in particular, the ghidra-server nixos module uses ghidra_headless with openjdk21_headless by default

ghidra

a version of ghidra that uses a split derivation, lib contains the core ghidra distribution, doc contains all the documentation elements, and out contains the bin folder, icons, and desktop file. only out has a dependency on the build jdk, so lib and doc can be used with reduced closure size

kicad

preview version of kicad with my patches

ocamlPackages.ppx_unicode

opinionated ppx for string literals: https://git.lain.faith/haskal/ppx_unicode

ocamlPackages.xlog

logging for cats, in ocaml: https://git.lain.faith/haskal/xlog

ocamlPackages.systemd-ml

libsystemd implementation in native ocaml: https://git.lain.faith/haskal/systemd-ml

ocamlPackages.ocaml-manual

the ocaml html docs package from opam

python312Packages.feedvalidator or feedvalidator

the W3C atom/RSS feed validator library, https://github.com/w3c/feedvalidator

this package comes with an additional CLI bin, feedvalidator, which is a simple wrapper around the library that enables CLI usage

usage

usage: feedvalidator [-h] [-b BASE] file

W3C feedvalidator

positional arguments:
  file                  File to validate

options:
  -h, --help            show this help message and exit
  -b BASE, --base BASE  Base URL of document

example

feedvalidator --base "https://my-base-url/atom.xml" path/to/atom.xml

outer-wilds-text-adventure

nix packaging for the Outer Wilds text adventure game. it should work by default on NixOS. if using the nix package manager on a non-NixOS computer, you also need the following when using pipewire or another ALSA plugin that lives in a separate package

export ALSA_PLUGIN_DIR=$(nix eval -f '<nixpkgs>' --raw pipewire)/lib/alsa-lib

eta

Generic tool for monitoring ETA and progress of an arbitrary process.

https://github.com/aioobe/eta

zbasefind

Command line tool to guess the base address of a raw firmware binary (zoomer edition).

https://git.lain.faith/haskal/zbasefind.git

cado-nfs

Cado-NFS, An Implementation of the Number Field Sieve Algorithm

https://gitlab.inria.fr/cado-nfs/cado-nfs

lib documentation

fetchFromSteam

a fetcher that downloads binaries from Steam using DepotDownloader. this is intended for game servers that are distributed via Steam. use SteamDB to get the needed IDs.

Usage:

pkgs.fetchFromSteam {
  name = "..."; # optional
  appId = "...";
  depot = {
    depotId = "...";
    manifestId = "...";
    beta = "..."; # optional
  };

  additionalDepots = [
    # same format as the main `depot`
    # use this to include eg the steamworks redistributable depot
  ];

  hash = pkgs.lib.fakeHash;
}

fetchb4

A fetcher that uses b4 to download patchsets from https://lore.kernel.org so that they can be applied in boot.kernelPatches

Usage:

pkgs.fetchb4 {
  msgid = "2024042069.1337-example@example";
  hash = pkgs.lib.fakeHash;

  # optional args
  version = "3"; # default: latest
  single_message = true; # default: false
}

note that not specifying a version may make cause future invocations to return different output if a newer version is sent to the thread

mkNginxServer

creates a shell script that launches nginx in the foreground as the current user. the nginx is configured to run an http server on localhost:8080 with the given siteConfig

example:

pkgs.mkNginxServer {
  siteConfig = ''
    location / {
      root path/to/development_site_root;
      error_page 404 /404.html;
    }
  '';
}

gitSource

for development package nix files, computes the source set of files tracked by git at the given root path

arguments:

  • root: the root of the git repo, where .git is located
  • subdir, optional: a subdirectory within the git repo. if provided, only files in this subdirectory will go into the final source set

example:

stdenv.mkDerivation {
  # ...
  src = gitSource { root = ./.; };
}

makeSquashFs

builds a squashfs image from the given derivations

example

makeSquashFs {
  filename = "my-image"; # optional
  storeContents = [ foo bar ];
}

makeHpcDist

create a packaged nix distribution with the given packages in it for weird HPC systems. go read the source to find out what it does; i don't recommend using this if you're not me

development

structure of this repo

  • default.nix: the top level NixOS module, which can also be interpreted as a plain nix file outside of NixOS for access to just the nixpkgs overlay. this contains all definitions for packages, library functions, and NixOS modules
  • lib/: library functions (ie functions that get added to the overlay) go here
  • modules/: NixOS modules go here
  • pkgs/: packages that get added to the overlay go here
  • support/: WIP support tools (eg generating documentation)

licensing

this repository is NOT licensed under a "standard" FOSS license. instead, it uses CC-BY-NC-SA 4.0. this means, in particular that commercial use is forbidden. if you are, for whatever reason, interested in using this code commercially, please contact me