Something went wrong. Try again.
sqlite-backed shell history
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104{ description = "sqlite-backed shell history";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs, }: let supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f nixpkgs.legacyPackages.${system});
stinkpotPackage = { lib, buildGoModule, }: buildGoModule { pname = "stinkpot"; version = "0.1.0"; src = lib.cleanSource ./.; vendorHash = "sha256-IVPACl1oWnBKGzcXvG5gzev8MwhzIKNI7zwEKJjhFc8="; env.CGO_ENABLED = "0"; ldflags = [ "-s" "-w" ]; meta = { description = "sqlite-backed shell history"; mainProgram = "stinkpot"; license = lib.licenses.mit; platforms = lib.platforms.unix; }; }; in { formatter = forAllSystems (pkgs: pkgs.alejandra);
packages = forAllSystems (pkgs: rec { stinkpot = pkgs.callPackage stinkpotPackage {}; default = stinkpot; });
overlays.default = final: _prev: { stinkpot = final.callPackage stinkpotPackage {}; };
homeManagerModules.stinkpot = { config, lib, pkgs, ... }: let cfg = config.programs.stinkpot; in { options.programs.stinkpot = { enable = lib.mkEnableOption "stinkpot, a tiny sqlite-backed shell history";
package = lib.mkOption { type = lib.types.package; default = self.packages.${pkgs.stdenv.hostPlatform.system}.default; description = "The stinkpot package to use."; };
enableBashIntegration = lib.hm.shell.mkBashIntegrationOption { inherit config; extraDescription = "Bind `ctrl-r` to open the stinkpot search and record commands into stinkpot."; }; enableFishIntegration = lib.hm.shell.mkFishIntegrationOption { inherit config; extraDescription = "Bind 'ctrl-r' to open the stinkpot search and record commands into stinkpot."; }; };
config = lib.mkIf cfg.enable { home.packages = [cfg.package];
programs.bash.initExtra = lib.mkIf cfg.enableBashIntegration '' eval "$(${lib.getExe cfg.package} init)" ''; programs.fish.interactiveShellInit = lib.mkIf cfg.enableFishIntegration '' ${lib.getExe cfg.package} init fish | source ''; }; }; homeManagerModules.default = self.homeManagerModules.stinkpot;
devShells = forAllSystems (pkgs: { default = pkgs.mkShell { packages = [ pkgs.go pkgs.gopls pkgs.gotools pkgs.go-tools pkgs.litecli ]; }; }); };}