diff --git a/nix/configuration/flakes/zsh-histdb/flake.lock b/nix/configuration/flakes/zsh-histdb/flake.lock new file mode 100644 index 0000000..b3604a4 --- /dev/null +++ b/nix/configuration/flakes/zsh-histdb/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": 1734875076, + "narHash": "sha256-Pzyb+YNG5u3zP79zoi8HXYMs15Q5dfjDgwCdUI5B0nY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1807c2b91223227ad5599d7067a61665c52d1295", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "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/nix/configuration/flakes/zsh-histdb/flake.nix b/nix/configuration/flakes/zsh-histdb/flake.nix new file mode 100644 index 0000000..f831ce1 --- /dev/null +++ b/nix/configuration/flakes/zsh-histdb/flake.nix @@ -0,0 +1,34 @@ +{ + description = "A slightly better history for zsh"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = + { + self, + nixpkgs, + flake-utils, + ... + }: + let + out = + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + # Maybe pkgs = import nixpkgs { inherit system; }; ? + appliedOverlay = self.overlays.default pkgs pkgs; + in + { + packages = rec { + default = zsh-histdb; + zsh-histdb = appliedOverlay.zsh-histdb; + }; + }; + in + flake-utils.lib.eachDefaultSystem out + // { + overlays.default = final: prev: { + zsh-histdb = final.callPackage ./package.nix { }; + }; + }; +} diff --git a/nix/configuration/flakes/zsh-histdb/package.nix b/nix/configuration/flakes/zsh-histdb/package.nix new file mode 100644 index 0000000..6a43797 --- /dev/null +++ b/nix/configuration/flakes/zsh-histdb/package.nix @@ -0,0 +1,28 @@ +# unpackPhase +# patchPhase +# configurePhase +# buildPhase +# checkPhase +# installPhase +# fixupPhase +# installCheckPhase +# distPhase +{ + stdenv, + pkgs, + sqlite, + ... +}: +stdenv.mkDerivation { + name = "zsh-histdb"; + src = pkgs.fetchgit { + url = "https://github.com/larkery/zsh-histdb.git"; + rev = "90a6c104d0fcc0410d665e148fa7da28c49684eb"; + sha256 = "sha256-vtG1poaRVbfb/wKPChk1WpPgDq+7udLqLfYfLqap4Vg="; + }; + buildInputs = [ sqlite ]; + installPhase = '' + mkdir -p $out/share/zsh/plugins/zsh-histdb + cp -r $src/histdb-* $src/*.zsh $src/db_migrations $out/share/zsh/plugins/zsh-histdb/ + ''; +}