feat: add offline search

This commit is contained in:
Moritz Böhme 2024-11-22 19:47:22 +01:00
parent 707cbcca9e
commit 04407a5726
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
6 changed files with 130 additions and 11 deletions

View file

@ -339,6 +339,24 @@
"type": "github"
}
},
"flake-utils_4": {
"inputs": {
"systems": "systems_6"
},
"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"
}
},
"ghostty": {
"inputs": {
"nixpkgs-stable": "nixpkgs-stable",
@ -789,6 +807,32 @@
"type": "github"
}
},
"ixx_2": {
"inputs": {
"flake-utils": [
"search",
"flake-utils"
],
"nixpkgs": [
"search",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729958008,
"narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=",
"owner": "NuschtOS",
"repo": "ixx",
"rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"ref": "v0.0.6",
"repo": "ixx",
"type": "github"
}
},
"master": {
"locked": {
"lastModified": 1729839280,
@ -1033,6 +1077,22 @@
"type": "github"
}
},
"nixpkgs_10": {
"locked": {
"lastModified": 1692934111,
"narHash": "sha256-9EEE59v/esKNMR5zKbLRV9NoRPYvERw5jHQOnfr47bk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1e44a037bbf4fcaba041436e65e87be88f3f495b",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1725194671,
@ -1147,16 +1207,16 @@
},
"nixpkgs_9": {
"locked": {
"lastModified": 1692934111,
"narHash": "sha256-9EEE59v/esKNMR5zKbLRV9NoRPYvERw5jHQOnfr47bk=",
"lastModified": 1731676054,
"narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1e44a037bbf4fcaba041436e65e87be88f3f495b",
"rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
@ -1318,10 +1378,31 @@
"nur": "nur",
"pre-commit-hooks": "pre-commit-hooks_2",
"river": "river",
"search": "search",
"stable": "stable",
"timers": "timers"
}
},
"search": {
"inputs": {
"flake-utils": "flake-utils_4",
"ixx": "ixx_2",
"nixpkgs": "nixpkgs_9"
},
"locked": {
"lastModified": 1731874326,
"narHash": "sha256-FVodEap6GQT/1DSG5KOcpsrKXfG9gMNObQxW+HNJnW8=",
"owner": "NuschtOS",
"repo": "search",
"rev": "64832c4cf885350ad0e63a27fd7055bcfc7955f6",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"stable": {
"locked": {
"lastModified": 1729691686,
@ -1428,10 +1509,25 @@
"type": "github"
}
},
"systems_7": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"timers": {
"inputs": {
"naersk": "naersk",
"nixpkgs": "nixpkgs_9",
"nixpkgs": "nixpkgs_10",
"utils": "utils"
},
"locked": {
@ -1471,7 +1567,7 @@
},
"utils": {
"inputs": {
"systems": "systems_6"
"systems": "systems_7"
},
"locked": {
"lastModified": 1692799911,

View file

@ -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 = {

View file

@ -21,7 +21,6 @@
webis.enable = true;
impermanence.enable = true;
};
terminal.package = pkgs.kitty;
programs.exercism.enable = true;
services.mullvad.enable = true;
};

View file

@ -6,6 +6,7 @@ with lib;
{
options.my.terminal = {
package = mkOption {
description = "Terminal emulator package to use. Gets converted to path of bin automatically.";
type = types.package;
apply = lib.getExe;
};

View file

@ -10,7 +10,7 @@ let
cfg = config.my.programs.python;
pythonVersions = map (version: "3${toString version}") (range 8 13);
pythonVersions = map (version: "3${toString version}") (range 9 13);
enabledVersions = filterAttrs (_: value: value.enable) cfg.versions;
pythonPackages = version: attrNames pkgs."python${version}Packages";

View file

@ -15,10 +15,10 @@ in
enable = mkEnableOption "river";
keyboardLayouts = mkOption {
type = types.listOf types.str;
description = "list of keyboard layouts";
description = "List of keyboard layouts.";
default = [ "us" "de" ];
};
nvidiaSupport = mkEnableOption "nvidiaSupport";
nvidiaSupport = mkEnableOption "nvidia gpu support";
};
config = mkIf cfg.enable {