diff --git a/README.md b/README.md index 3c1e24d..c807c31 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,32 @@ Safety notes: - Installer creates timestamped backups before replacing files. - `boo uninstall` can restore your previous Ghostty config when a backup exists. +## Install with Nix + +```bash +nix profile install github:Ansub/boo +boo doctor fix +``` + +Or as a flake input in your config: + +```nix +# flake.nix +inputs.boo.url = "github:Ansub/boo"; +``` + +```nix +# Add boo to packages +environment.systemPackages = [ inputs.boo.packages.${system}.default ]; + +# Source shell integration (home-manager) +programs.zsh.initExtra = '' + source "${inputs.boo.packages.${system}.default}/shell/boo.zsh" +''; +``` + +Run `boo doctor fix` once after install to bootstrap `~/.config/boo/`. + ## Verify It Worked ```bash diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c375b0c --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1773476965, + "narHash": "sha256-Laaj25PvGeoP5SPhMfMGxvWqM6ZjZ6LdUeEhP6b3czY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f82ce7af0b79ac154b12e27ed800aeb97413723c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f58af66 --- /dev/null +++ b/flake.nix @@ -0,0 +1,22 @@ +{ + description = "Boo — a CLI for managing Ghostty + Zsh terminal themes"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + boo = pkgs.callPackage ./package.nix { }; + in + { + packages = { + default = boo; + boo = boo; + }; + } + ); +} diff --git a/package.nix b/package.nix new file mode 100644 index 0000000..615219f --- /dev/null +++ b/package.nix @@ -0,0 +1,43 @@ +{ lib, stdenvNoCC, makeWrapper, bash, coreutils, gnused, gnugrep, gawk, findutils }: + +stdenvNoCC.mkDerivation { + pname = "boo"; + version = "0-unstable"; + + src = lib.fileset.toSource { + root = ./.; + fileset = lib.fileset.unions [ + ./bin + ./art + ./themes + ./shell + ./configs + ./scripts + ]; + }; + + nativeBuildInputs = [ makeWrapper ]; + + installPhase = '' + runHook preInstall + + # Preserve repo layout at $out so bin/boo's fallback paths + # (../themes, ../art, ../shell, ../configs) resolve correctly + mkdir -p $out/bin + cp -r art themes shell configs scripts $out/ + + install -Dm755 bin/boo $out/bin/boo + wrapProgram $out/bin/boo \ + --prefix PATH : ${lib.makeBinPath [ bash coreutils gnused gnugrep gawk findutils ]} + + runHook postInstall + ''; + + meta = { + description = "CLI for managing Ghostty + Zsh terminal themes, fonts, and splash art"; + homepage = "https://github.com/Ansub/boo"; + license = lib.licenses.mit; + platforms = lib.platforms.unix; + mainProgram = "boo"; + }; +}