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; enable = true;
}; };
home.packages = lib.mkIf config.programs.wofi.enable [ # Enable runner integration
pkgs.wofi-pass 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 ]; satellite.persistence.at.data.apps.pass.directories = [ storePath ];
} }

View file

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

View file

@ -137,9 +137,12 @@ let
in in
{ {
# {{{ Basic config # {{{ Basic config
# Do not manage neovim via nix # Do not manage neovim via the default home manager module
programs.neovim.enable = false; 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"; xdg.configFile.nvim.source = config.satellite.dev.path "dotfiles/neovim";
home.sessionVariables.EDITOR = "nvim"; home.sessionVariables.EDITOR = "nvim";
@ -150,49 +153,50 @@ in
]; ];
# }}} # }}}
# {{{ Firenvim # {{{ Firenvim
home.file.".mozilla/native-messaging-hosts/firenvim.json".text = home.file.".mozilla/native-messaging-hosts/firenvim.json" =
let lib.mkIf config.programs.firefox.enable {
# God knows what this does text =
# https://github.com/glacambre/firenvim/blob/87c9f70d3e6aa2790982aafef3c696dbe962d35b/autoload/firenvim.vim#L592 let
firenvim_init = pkgs.writeText "firenvim_init.vim" '' # God knows what this does
let g:firenvim_i=[] # https://github.com/glacambre/firenvim/blob/87c9f70d3e6aa2790982aafef3c696dbe962d35b/autoload/firenvim.vim#L592
let g:firenvim_o=[] firenvim_init = pkgs.writeText "firenvim_init.vim" ''
let g:Firenvim_oi={i,d,e->add(g:firenvim_i,d)} let g:firenvim_i=[]
let g:Firenvim_oo={t->[chansend(2,t)]+add(g:firenvim_o,t)} let g:firenvim_o=[]
let g:firenvim_c=stdioopen({'on_stdin':{i,d,e->g:Firenvim_oi(i,d,e)},'on_print':{t->g:Firenvim_oo(t)}}) let g:Firenvim_oi={i,d,e->add(g:firenvim_i,d)}
let g:started_by_firenvim = v:true let g:Firenvim_oo={t->[chansend(2,t)]+add(g:firenvim_o,t)}
''; let g:firenvim_c=stdioopen({'on_stdin':{i,d,e->g:Firenvim_oi(i,d,e)},'on_print':{t->g:Firenvim_oo(t)}})
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
try call firenvim#run()
call firenvim#run() catch /Unknown function/
catch /Unknown function/ call chansend(g:firenvim_c,["f\n\n\n"..json_encode({"messages":["Your plugin manager did not load the Firenvim plugin for neovim."],"version":"0.0.0"})])
call chansend(g:firenvim_c,["f\n\n\n"..json_encode({"messages":["Your plugin manager did not load the Firenvim plugin for neovim."],"version":"0.0.0"})]) call chansend(2,["Firenvim not in runtime path. &rtp="..&rtp])
call chansend(2,["Firenvim not in runtime path. &rtp="..&rtp]) qall!
qall! catch
catch call chansend(g:firenvim_c,["l\n\n\n"..json_encode({"messages": ["Something went wrong when running firenvim. See troubleshooting guide."],"version":"0.0.0"})])
call chansend(g:firenvim_c,["l\n\n\n"..json_encode({"messages": ["Something went wrong when running firenvim. See troubleshooting guide."],"version":"0.0.0"})]) call chansend(2,[v:exception])
call chansend(2,[v:exception]) qall!
qall! endtry
endtry '';
''; in
in builtins.toJSON {
builtins.toJSON name = "firenvim";
{ description = "Turn your browser into a Neovim GUI.";
name = "firenvim"; type = "stdio";
description = "Turn your browser into a Neovim GUI."; allowed_extensions = [ "firenvim@lacamb.re" ];
type = "stdio"; path = pkgs.writeShellScript "firenvim.sh" ''
allowed_extensions = [ "firenvim@lacamb.re" ]; mkdir -p /run/user/$UID/firenvim
path = pkgs.writeShellScript "firenvim.sh" '' chmod 700 /run/user/$UID/firenvim
mkdir -p /run/user/$UID/firenvim cd /run/user/$UID/firenvim
chmod 700 /run/user/$UID/firenvim
cd /run/user/$UID/firenvim
exec '${firenvim}/bin/nvim' --headless \ exec '${firenvim}/bin/nvim' --headless \
--cmd 'source "${firenvim_init}"' \ --cmd 'source "${firenvim_init}"' \
-S '${firenvim_file_loaded}' -S '${firenvim_file_loaded}'
''; '';
}; };
};
# }}} # }}}
} }

View file

@ -4,4 +4,5 @@
# example = import ./example.nix; # example = import ./example.nix;
lua-colorscheme = import ./lua-colorscheme.nix; lua-colorscheme = import ./lua-colorscheme.nix;
theming = import ./theming.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; terminal = false;
name = app.displayName; name = app.displayName;
type = "Application"; 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; icon = app.icon;
}; };
in in