From a3bb76364e9ff979f929ab5b813b172e4786c4f3 Mon Sep 17 00:00:00 2001 From: Luis Eduardo Bueso de Barrio Date: Fri, 6 Feb 2026 16:13:02 +0100 Subject: [PATCH] README --- README.md | 104 +++++++++++++++++++++++++++++++++++++++++++++ checks/default.nix | 1 - 2 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..c9bbaa3 --- /dev/null +++ b/README.md @@ -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). diff --git a/checks/default.nix b/checks/default.nix index 2905e24..742b251 100644 --- a/checks/default.nix +++ b/checks/default.nix @@ -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 ''; }