+/config

my dotfiles and nix configuration

git clone https://git.julia.blue/+/config

Julia RyanAdd awawausb438751b

main
802 B27 linesraw
1{ config, lib, pkgs, ... }:
2let
3  opts = {
4    enable = lib.mkEnableOption ''
5      Firefox webusb support extension
6    '';
7  };
8  cfg = config.programs.awawausb;
9in
10{
11  options.programs.awawausb = opts;
12  config = lib.mkIf cfg.enable {
13    home = {
14      # TODO: might need udev rules to do anything useful with this? in which case move
15      # to a nixos module and use the /etc native extension path
16      packages = [ pkgs.awawausb ];
17
18      file.".mozilla/native-messaging-hosts/awawausb_native_stub.json".text = builtins.toJSON {
19        name = "awawausb_native_stub";
20        description = "Allows WebUSB extension to access USB devices";
21        path = "${lib.getExe pkgs.awawausb}";
22        type = "stdio";
23        allowed_extensions = [ "awawausb@arcanenibble.com" ];
24      };
25    };
26  };
27}