2024-04-23 22:16:35 +00:00
|
|
|
---
|
|
|
|
gitea: none
|
|
|
|
include_toc: true
|
|
|
|
---
|
|
|
|
|
2024-04-07 22:28:42 +00:00
|
|
|
# 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
|
|
|
|
|
2024-10-22 01:44:22 +00:00
|
|
|
dragnpkgs provides a set of nixos modules and a nixpkgs overlay containing custom packages. the
|
|
|
|
modules require the overlay
|
|
|
|
|
|
|
|
### non-flake
|
2024-04-07 22:28:42 +00:00
|
|
|
|
|
|
|
```nix
|
|
|
|
{config, lib, pkgs, ...}:
|
|
|
|
{
|
|
|
|
imports = [
|
2024-10-22 01:44:22 +00:00
|
|
|
/path/to/dragnpkgs/module.nix
|
2024-04-07 22:28:42 +00:00
|
|
|
];
|
2024-10-22 01:44:22 +00:00
|
|
|
|
|
|
|
nixpkgs.overlays = [ (import /path/to/dragnpkgs/overlay.nix) ];
|
2024-04-07 22:28:42 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2024-10-22 01:44:22 +00:00
|
|
|
for standalone nix on other distros, use `~/.config/nixpkgs/overlays.nix` to enable the dragnpkgs
|
|
|
|
overlay
|
|
|
|
```nix
|
|
|
|
[ (import <dragnpkgs/overlay.nix>) ]
|
2024-04-23 18:14:23 +00:00
|
|
|
```
|
|
|
|
|
2024-10-22 01:44:22 +00:00
|
|
|
### flake
|
|
|
|
|
|
|
|
for flake usage, point your `nixpkgs` to this repo
|
|
|
|
|
2024-04-23 18:14:23 +00:00
|
|
|
```nix
|
|
|
|
{
|
2024-10-22 01:44:22 +00:00
|
|
|
inputs = {
|
|
|
|
# for nixos-24.05
|
|
|
|
nixpkgs.url = "git+https://git.lain.faith/haskal/dragnpkgs.git?ref=nixos-24.05";
|
|
|
|
|
|
|
|
# for nixos-unstable
|
|
|
|
nixpkgs.url = "git+https://git.lain.faith/haskal/dragnpkgs.git?ref=main";
|
|
|
|
};
|
2024-04-23 18:14:23 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2024-10-22 01:44:22 +00:00
|
|
|
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.05 or unstable), clone the
|
|
|
|
repo and recreate `flake.lock`. aren't flakes so cool and fun!!!!
|
2024-04-23 18:14:23 +00:00
|
|
|
|
2024-04-10 16:29:18 +00:00
|
|
|
## options documentation
|
2024-04-09 20:51:38 +00:00
|
|
|
|
|
|
|
documentation for options provided by dragnpkgs
|
|
|
|
|
|
|
|
|
|
|
|
### [`services.ghidra-server`](./modules/ghidra-server)
|
|
|
|
the shared project server for [ghidra](https://ghidra-sre.org)
|
|
|
|
|
|
|
|
example usage:
|
|
|
|
```nix
|
|
|
|
services.ghidra-server = {
|
|
|
|
enable = true;
|
|
|
|
host = "your.domain.or.ip";
|
|
|
|
};
|
|
|
|
```
|
|
|
|
|
|
|
|
#### services.ghidra-server.enable
|
|
|
|
|
|
|
|
enables the ghidra server service
|
|
|
|
|
2024-10-22 06:44:35 +00:00
|
|
|
#### services.ghidra-server.enableAdminCli (`true`)
|
2024-04-09 20:51:38 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
2024-10-22 06:44:35 +00:00
|
|
|
#### services.ghidra-server.{package, jdkPackage} (`ghidra_headless`, `openjdk21_headless`)
|
2024-04-09 20:51:38 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2024-04-23 19:22:28 +00:00
|
|
|
#### services.ghidra-server.directory (`ghidra-server`)
|
2024-04-09 20:51:38 +00:00
|
|
|
|
2024-04-23 19:22:28 +00:00
|
|
|
the root directory for server files, as a subdirectory of `/var/lib`. this is needed because this
|
|
|
|
option is passed to systemd `StateDirectory=`
|
2024-04-09 20:51:38 +00:00
|
|
|
|
|
|
|
#### services.ghidra-server.{user,group} (`ghidra`)
|
|
|
|
|
|
|
|
the service user and group
|
|
|
|
|
|
|
|
|
|
|
|
### more coming soon(tm)
|
|
|
|
|
2024-04-10 16:29:18 +00:00
|
|
|
## packages documentation
|
|
|
|
|
2024-04-23 22:40:11 +00:00
|
|
|
### [`ghidra_headless`](./default.nix)
|
2024-04-10 16:29:18 +00:00
|
|
|
|
2024-10-22 06:44:35 +00:00
|
|
|
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
|
2024-04-07 22:28:42 +00:00
|
|
|
|
2024-07-02 03:40:18 +00:00
|
|
|
### [`ghidra`](./pkgs/ghidra-xenia/build.nix)
|
|
|
|
|
2024-10-22 06:44:35 +00:00
|
|
|
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
|
2024-07-02 03:40:18 +00:00
|
|
|
|
2024-07-02 08:23:56 +00:00
|
|
|
### [`kicad`](./pkgs/kicad-xenia/default.nix)
|
|
|
|
|
|
|
|
preview version of kicad with my patches
|
|
|
|
|
2024-04-25 06:33:47 +00:00
|
|
|
### [`ocamlPackages.ppx_unicode`](./pkgs/ocaml/ppx_unicode)
|
|
|
|
|
|
|
|
opinionated ppx for string literals: <https://git.lain.faith/haskal/ppx_unicode>
|
|
|
|
|
2024-04-23 22:40:11 +00:00
|
|
|
### [`ocamlPackages.xlog`](./pkgs/ocaml/xlog)
|
2024-04-23 19:22:28 +00:00
|
|
|
|
|
|
|
logging for cats, in ocaml: <https://git.lain.faith/haskal/xlog>
|
|
|
|
|
2024-04-23 22:41:31 +00:00
|
|
|
### [`python312Packages.feedvalidator` or `feedvalidator`](./pkgs/python/feedvalidator)
|
2024-04-23 22:15:09 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
```bash
|
|
|
|
feedvalidator --base "https://my-base-url/atom.xml" path/to/atom.xml
|
|
|
|
```
|
|
|
|
|
2024-05-30 20:01:42 +00:00
|
|
|
### [`outer-wilds-text-adventure`](./pkgs/games/outer-wilds-text-adventure)
|
|
|
|
|
2024-05-30 21:45:25 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
```bash
|
|
|
|
export ALSA_PLUGIN_DIR=$(nix eval -f '<nixpkgs>' --raw pipewire)/lib/alsa-lib
|
|
|
|
```
|
2024-05-30 20:01:42 +00:00
|
|
|
|
2024-04-15 19:57:00 +00:00
|
|
|
## lib documentation
|
|
|
|
|
2024-04-23 22:40:11 +00:00
|
|
|
### [`fetchFromSteam`](./lib/fetchsteam)
|
2024-04-15 19:57:00 +00:00
|
|
|
|
|
|
|
a fetcher that downloads binaries from [Steam](https://store.steampowered.com/) using
|
|
|
|
[DepotDownloader](https://github.com/SteamRE/DepotDownloader). this is intended for game servers
|
|
|
|
that are distributed via Steam. use [SteamDB](https://steamdb.info) to get the needed IDs.
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
|
|
|
|
```nix
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2024-07-04 03:53:56 +00:00
|
|
|
### [`fetchb4`](./lib/fetchb4)
|
|
|
|
|
|
|
|
A fetcher that uses `b4` to download patchsets from <https://lore.kernel.org> so that they can be applied in `boot.kernelPatches`
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
|
|
|
|
```nix
|
|
|
|
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
|
|
|
|
|
2024-04-23 22:40:11 +00:00
|
|
|
### [`mkNginxServer`](./lib/dev-nginx)
|
2024-04-23 22:37:49 +00:00
|
|
|
|
|
|
|
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:
|
|
|
|
```nix
|
|
|
|
pkgs.mkNginxServer {
|
|
|
|
siteConfig = ''
|
|
|
|
location / {
|
|
|
|
root path/to/development_site_root;
|
|
|
|
error_page 404 /404.html;
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2024-05-14 23:04:14 +00:00
|
|
|
### [`gitSource`](./lib/git-source)
|
|
|
|
|
|
|
|
for development package nix files, computes the source set of files tracked by git at the given root
|
|
|
|
path
|
|
|
|
|
2024-06-05 04:34:50 +00:00
|
|
|
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
|
|
|
|
|
2024-05-14 23:04:14 +00:00
|
|
|
example:
|
|
|
|
```nix
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
# ...
|
|
|
|
src = gitSource { root = ./.; };
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2024-09-14 19:56:09 +00:00
|
|
|
### [`makeSquashFs`](./lib/make-squashfs)
|
|
|
|
|
|
|
|
builds a squashfs image from the given derivations
|
|
|
|
|
|
|
|
example
|
|
|
|
```nix
|
|
|
|
makeSquashFs {
|
|
|
|
filename = "my-image"; # optional
|
|
|
|
storeContents = [ foo bar ];
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### [`makeHpcDist`](./lib/make-hpc-dist)
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2024-04-23 22:44:21 +00:00
|
|
|
## 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)
|
|
|
|
|
2024-04-07 22:28:42 +00:00
|
|
|
## licensing
|
|
|
|
|
|
|
|
this repository is NOT licensed under a "standard" FOSS license. instead, it uses
|
|
|
|
[CC-BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en). this means, in
|
|
|
|
particular that commercial use is forbidden. if you are, for whatever reason, interested in using
|
|
|
|
this code commercially, please contact me
|