feat: add offline search
This commit is contained in:
parent
707cbcca9e
commit
04407a5726
6 changed files with 130 additions and 11 deletions
25
flake.nix
25
flake.nix
|
|
@ -65,6 +65,8 @@
|
|||
arkenfox-userjs.url = "github:arkenfox/user.js";
|
||||
arkenfox-userjs.flake = false;
|
||||
|
||||
search.url = "github:NuschtOS/search";
|
||||
|
||||
ghostty.url = "git+ssh://git@github.com/ghostty-org/ghostty";
|
||||
};
|
||||
|
||||
|
|
@ -115,7 +117,28 @@
|
|||
};
|
||||
|
||||
legacyPackages = pkgs;
|
||||
|
||||
packages =
|
||||
let
|
||||
modules = [
|
||||
{ name = "My stuff"; }
|
||||
];
|
||||
mkName = name: "${name} Search";
|
||||
mkSearch = name: value: inputs'.search.packages.mkSearch {
|
||||
urlPrefix = "file://${self}/flake.nix";
|
||||
title = mkName name;
|
||||
optionsJSON = "${(pkgs.nixosOptionsDoc { inherit (value) options; warningsAreErrors = false; }).optionsJSON}/share/doc/nixos/options.json";
|
||||
};
|
||||
serveSearch = name: value:
|
||||
pkgs.writeShellApplication {
|
||||
name = mkName name;
|
||||
text = ''
|
||||
xdg-open http://127.0.0.1:8080
|
||||
static-web-server -p 8080 -d ${mkSearch name value}
|
||||
'';
|
||||
runtimeInputs = with pkgs; [ static-web-server xdg-utils ];
|
||||
};
|
||||
in
|
||||
pkgs.lib.mapAttrs serveSearch self.nixosConfigurations;
|
||||
};
|
||||
|
||||
flake = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue