1
Fork 0

Set up passff in favour of browserpass

This also introduces a custom `satellite.toggles` module.
This commit is contained in:
Matei Adriel 2023-11-13 04:03:14 +01:00
parent eca258cdfc
commit 6aea9045c7
No known key found for this signature in database
6 changed files with 94 additions and 67 deletions

View file

@ -12,10 +12,13 @@ in
enable = true;
};
home.packages = lib.mkIf config.programs.wofi.enable [
pkgs.wofi-pass
];
# Enable runner integration
home.packages = lib.lists.optional config.programs.wofi.enable pkgs.wofi-pass;
# Enable the firefox extension
home.file.".mozilla/native-messaging-hosts/passff.json".source =
lib.mkIf config.programs.firefox.enable
"${pkgs.passff-host}/lib/mozilla/native-messaging-hosts/passff.json";
programs.browserpass.enable = config.programs.firefox.enable;
satellite.persistence.at.data.apps.pass.directories = [ storePath ];
}

View file

@ -1,7 +1,7 @@
{ config, pkgs, inputs, ... }:
{ config, lib, pkgs, inputs, ... }:
let
# {{{ Global extensions
extensions = with inputs.firefox-addons.packages.${pkgs.system}; [
extensions = with inputs.firefox-addons.packages.${pkgs.system}; ([
buster-captcha-solver
# REASON: returns 404 for now
# bypass-paywalls-clean
@ -21,8 +21,10 @@ let
ublock-origin
unpaywall
user-agent-string-switcher
browserpass # Password store support
];
] ++
# Password store support
lib.lists.optional config.programs.password-store.enable passff
);
# }}}
in
{
@ -47,11 +49,15 @@ in
userContent = builtins.readFile ./userContent.css;
# }}}
# {{{ Extensions
extensions = with inputs.firefox-addons.packages.${pkgs.system}; extensions ++ [
extensions =
with inputs.firefox-addons.packages.${pkgs.system};
with lib.lists; flatten [
extensions
# List of profile-specific extensions
[
augmented-steam # Adds more info to steam
blocktube # Lets you block youtube channels
dearrow # Crowdsourced clickbait remover 💀
firenvim # summon a nvim instance inside the browser
lovely-forks # displays forks on github
octolinker # github import to link thingy
octotree # github file tree
@ -61,6 +67,9 @@ in
sponsorblock # skip youtube sponsors
vimium-c # vim keybinds
youtube-shorts-block
]
# summons a nvim instance inside the browser
(optional config.satellite.toggles.neovim.enable firenvim)
];
# }}}
# {{{ Search engines

View file

@ -137,9 +137,12 @@ let
in
{
# {{{ Basic config
# Do not manage neovim via nix
# Do not manage neovim via the default home manager module
programs.neovim.enable = false;
# We still want other modules to know that we are using neovim!
satellite.toggles.neovim.enable = true;
xdg.configFile.nvim.source = config.satellite.dev.path "dotfiles/neovim";
home.sessionVariables.EDITOR = "nvim";
@ -150,7 +153,9 @@ in
];
# }}}
# {{{ Firenvim
home.file.".mozilla/native-messaging-hosts/firenvim.json".text =
home.file.".mozilla/native-messaging-hosts/firenvim.json" =
lib.mkIf config.programs.firefox.enable {
text =
let
# God knows what this does
# https://github.com/glacambre/firenvim/blob/87c9f70d3e6aa2790982aafef3c696dbe962d35b/autoload/firenvim.vim#L592
@ -163,8 +168,7 @@ in
let g:started_by_firenvim = v:true
'';
firenvim_file_loaded = pkgs.writeText "firenvim_file_loaded.vim"
''
firenvim_file_loaded = pkgs.writeText "firenvim_file_loaded.vim" ''
try
call firenvim#run()
catch /Unknown function/
@ -178,8 +182,7 @@ in
endtry
'';
in
builtins.toJSON
{
builtins.toJSON {
name = "firenvim";
description = "Turn your browser into a Neovim GUI.";
type = "stdio";
@ -194,5 +197,6 @@ in
-S '${firenvim_file_loaded}'
'';
};
};
# }}}
}

View file

@ -4,4 +4,5 @@
# example = import ./example.nix;
lua-colorscheme = import ./lua-colorscheme.nix;
theming = import ./theming.nix;
toggles = import ./toggles.nix;
}

View file

@ -0,0 +1,10 @@
{ lib, ... }:
{
options.satellite.toggles = lib.mkOption {
default = { };
description = "Record of custom toggles to use throughput the config";
type = lib.types.attrsOf (lib.types.submodule (name: {
options.enable = lib.mkEnableOption "Toggle for ${name}";
}));
};
}

View file

@ -76,7 +76,7 @@ in
terminal = false;
name = app.displayName;
type = "Application";
exec = "firefox --name=${app.displayName} --no-remote -P \"${app.name}\" \"${app.url}\"";
exec = "firefox --name=${app.displayName} --no-remote --kiosk -P \"${app.name}\" \"${app.url}\"";
icon = app.icon;
};
in