Profpatsch
This is Profpatsch's personal monorepo (home-repo), extracted from the TVL depot using git-filter-repo to contain only the users/Profpatsch subtree and its dependencies.
License
This code is licensed under the MIT License (see LICENSE). The license remains unchanged from the original TVL depot for now.
Structure
users/Profpatsch/- Main user directory with projects and utilitiesnix/- Shared Nix infrastructure (buildGo, writeExecline, …)third_party/- External dependenciesmachines/- NixOS machine configurations (not part of the package tree)
How the package tree is laid out
Two rules, and no filesystem traversal:
-
<dir>/default.nix— this directory is a package. It is a function taking{ depot, pkgs, lib, ... }and returning a derivation (or an attribute set of them). -
<dir>/packages.nix— this directory is a namespace. It lists its contents explicitly, oneimportper entry.
A directory that no packages.nix names is not in the package tree. That
is what keeps scratch directories, build outputs, rendered websites and
vendored sources out of it, without needing any ignore-markers.
To find out where an attribute comes from, follow the imports starting at
default.nix — depot.users.Profpatsch.git-blimey is
users/packages.nix → users/Profpatsch/packages.nix →
users/Profpatsch/git-blimey/default.nix.
To add a package: write <name>/default.nix, then add one line to the
parent packages.nix:
my-thing = import ./my-thing args;
Three file names are reserved and are not packages:
module.nix— a NixOS module, imported by path frommachines/.packages.nix— the namespace file described above..source-forge— display metadata for the source browser (see below).
.source-forge
An optional, per-directory file telling the source browser at
https://sources.profpatsch.de how that directory should be displayed. It
has no effect on the package tree or on any build. See man source-forge
(section FILES) for the full syntax; in short, shortcut = <path> adds an
extra entry to the directory's listing pointing further down the tree, and
description = <html> is a short phrase describing the directory the file
sits in, shown on its entry wherever it is listed (in the root, it is the
project's blurb instead).
Shortcuts only ever add links, so no such file can hide part of the tree.
Installation
Install packages directly from this repository using Nix flakes. The source browser at https://sources.profpatsch.de serves the tree as a flake tarball, so no git server round-trip is needed:
# Install a package
nix profile install https://sources.profpatsch.de/Profpatsch.tar.gz#<package-name>
# Run without installing
nix run https://sources.profpatsch.de/Profpatsch.tar.gz#<package-name>
The .tar.gz extension tells Nix to fetch it as a tarball flake.
Building
All packages are built using Nix:
# Using flakes (recommended)
nix build .#<package-name>
# Traditional Nix
nix-build -A users.Profpatsch.<package-name>
# Enter a development shell
nix develop # with flakes
nix-shell # traditional
Development
This is experimental code optimized for "f***ing around in order to find out". Most code is "do not try at work" unless noted otherwise.