This commit is contained in:
2026-02-06 16:13:02 +01:00
parent 387330c227
commit a3bb76364e
2 changed files with 104 additions and 1 deletions

104
README.md Normal file
View File

@@ -0,0 +1,104 @@
# my-pkgs
A Nix flake exposing custom packages, a development shell, checks, and a nixpkgs overlay.
## Packages
| Package | Version | Description |
|----------------|---------|--------------------------------------------------------------|
| `example-a` | 0.1.0 | Example package A |
| `example-b` | 0.1.0 | Example package B |
| `pyzotero` | 1.6.11 | Python API client for the Zotero API |
| `pyzotero-cli` | 0.1.6 | CLI wrapper for pyzotero -- use Zotero from the command line |
## Usage
### Build a package
```bash
# Build the default package
nix build
# Build a specific package
nix build .#example-a
nix build .#pyzotero-cli
```
### Run pyzotero-cli
```bash
# Run directly
nix run .#pyzotero-cli -- --help
# Or build and use
nix build .#pyzotero-cli
./result/bin/zot --help
```
### Use the overlay
Add this flake as an input and apply the overlay to your nixpkgs:
```nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
my-pkgs.url = "";
};
outputs = { nixpkgs, my-pkgs, ... }: {
# Example: use in a NixOS configuration
nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
modules = [
{
nixpkgs.overlays = [ my-pkgs.overlays.default ];
environment.systemPackages = [ pkgs.pyzotero-cli ];
}
];
};
};
}
```
### Enter the development shell
```bash
nix develop
```
The dev shell provides `nixfmt`, `nil` (Nix LSP), and `nix-tree`.
## Checks
Formatting is enforced via `nixfmt-rfc-style`:
```bash
# Run all checks
nix flake check
# Format all files
nixfmt flake.nix pkgs checks devshells overlays
```
## Repository structure
```
flake.nix # Main flake entry point
flake.lock # Pinned flake inputs
pkgs/
default.nix # Package set aggregator
example-a/default.nix
example-b/default.nix
pyzotero/default.nix
pyzotero-cli/default.nix
checks/
default.nix # Formatting check
devshells/
default.nix # Development shell
overlays/
default.nix # Nixpkgs overlay
```
## License
Packages carry their own licenses (see individual `meta.license` attributes).

View File

@@ -2,7 +2,6 @@
{
formatting = pkgs.runCommand "check-formatting" { buildInputs = [ pkgs.nixfmt-rfc-style ]; } ''
cd ${./..}
nixfmt --check flake.nix pkgs checks devshells overlays
touch $out
'';
}