id: task-196 title: Add NixOS packaging support status: Done assignee: [] created_date: '2025-07-17' updated_date: '2025-07-17' labels: [] dependencies: []
Description
Enable NixOS users to install backlog.md through the NixOS package manager by creating Nix flake packaging
Acceptance Criteria
- [x] Create flake.nix with proper derivation for building backlog.md
- [x] Package builds successfully in NixOS environment using nix build
- [x] CLI tool works correctly when run via nix run
- [x] Documentation includes NixOS installation instructions
- [x] Flake follows Nix community best practices
Implementation Plan
- Research NixOS flake structure and best practices for Bun projects
- Create flake.nix with proper inputs and derivation
- Configure build process for Bun compilation
- Set up proper install phase and meta information
- Generate flake.lock via nix flake lock
- Test package builds and functionality
- Update documentation with NixOS installation instructions
Implementation Notes
Successfully implemented NixOS packaging support using Nix flakes. Created a complete flake.nix that:
Approach taken:
- Used
stdenv.mkDerivationwith Bun and Node.js 20 as build inputs - Dynamically reads version from package.json using
builtins.fromJSON - Follows Nix community best practices with proper meta information
- Includes dev shell for development environment
Features implemented:
- Complete Nix flake with nixpkgs and flake-utils inputs
- Proper build process that runs CSS build and CLI compilation
- Version embedding using
--defineflag during build - Development shell with all necessary dependencies
- Package available via
nix runandnix build
Technical decisions:
- Used
--frozen-lockfilefor reproducible builds - Embedded version at build time using
__EMBEDDED_VERSION__define - Updated package.json version to 1.5.0 for proper versioning
- Added NixOS installation command to README.md
Modified files:
flake.nix- Created complete Nix flake definitionflake.lock- Generated lockfile for reproducible buildspackage.json- Updated version to 1.5.0README.md- Added NixOS installation instructions