105 lines
2.3 KiB
Markdown
105 lines
2.3 KiB
Markdown
# 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).
|