diff options
| author | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-24 03:42:34 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-24 03:42:34 +0530 |
| commit | 44b8624d201e70c8418ada5db3c46e9ba130ea30 (patch) | |
| tree | ab960997bf8831d294dd84838523b358b7012ac5 /modules/web | |
| parent | 30f8fea050f3242f0e6a2072779e706b5c8ceaf1 (diff) | |
| download | home-manager-config-44b8624d201e70c8418ada5db3c46e9ba130ea30.tar.gz home-manager-config-44b8624d201e70c8418ada5db3c46e9ba130ea30.zip | |
refactor(naming): use kebab-case option names and consistent gopass secret naming
Diffstat (limited to 'modules/web')
| -rw-r--r-- | modules/web/chawan/default.nix | 14 | ||||
| -rw-r--r-- | modules/web/chromium/assertions.nix | 4 | ||||
| -rw-r--r-- | modules/web/chromium/default.nix | 44 |
3 files changed, 32 insertions, 30 deletions
diff --git a/modules/web/chawan/default.nix b/modules/web/chawan/default.nix index f3f0a30..0f1256d 100644 --- a/modules/web/chawan/default.nix +++ b/modules/web/chawan/default.nix @@ -2,8 +2,12 @@ { config, lib, + pkgs, ... }: +let + cfg = config.web.chawan; +in { imports = [ ./assertions.nix @@ -17,7 +21,7 @@ default = config.programs.chawan.package; description = "Package to use for chawan."; }; - homeUrl = lib.mkOption { + home-url = lib.mkOption { type = lib.types.str; default = "https://searx.space"; description = "The first page to open when chawan is launched."; @@ -25,7 +29,7 @@ }; config = lib.mkMerge [ - (lib.mkIf config.web.chawan.enable { + (lib.mkIf cfg.enable { home.file.".local/share/icons/hicolor/scalable/apps/internet-web-browser.svg" = { source = ../../../assets/icons/apps/internet-web-browser.svg; }; @@ -50,13 +54,13 @@ }; }; home.packages = [ - config.web.chawan.package + cfg.package ]; }) - (lib.mkIf (config.web.chawan.enable && config.terminal.kitty.enable) { + (lib.mkIf (cfg.enable && config.terminal.kitty.enable) { xdg.desktopEntries."chawan" = { name = "Chawan"; - exec = "${lib.getExe config.terminal.kitty.package} --class chawan -e ${lib.getExe config.web.chawan.package} ${config.web.chawan.homeUrl}"; + exec = "${lib.getExe config.terminal.kitty.package} --class chawan -e ${lib.getExe cfg.package} ${cfg.home-url}"; icon = "internet-web-browser"; categories = [ "Network" ]; comment = "Text-based web browser"; diff --git a/modules/web/chromium/assertions.nix b/modules/web/chromium/assertions.nix index 465ebbd..79a9ba1 100644 --- a/modules/web/chromium/assertions.nix +++ b/modules/web/chromium/assertions.nix @@ -3,8 +3,8 @@ { assertions = [ { - assertion = !config.web.chromium.useOpenGL || config.web.chromium.enable; - message = "web.chromium.useOpenGL requires web.chromium.enable."; + assertion = !config.web.chromium.use-opengl || config.web.chromium.enable; + message = "web.chromium.use-opengl requires web.chromium.enable."; } ]; } diff --git a/modules/web/chromium/default.nix b/modules/web/chromium/default.nix index 1e3608c..ae9e97e 100644 --- a/modules/web/chromium/default.nix +++ b/modules/web/chromium/default.nix @@ -4,6 +4,10 @@ pkgs, ... }: +let + cfg = config.web.chromium; + extensionDirs = lib.concatStringsSep "," (lib.mapAttrsToList (_: ext: ext.drv) cfg.extensions); +in { imports = [ ./assertions.nix @@ -20,32 +24,26 @@ defaultText = lib.literalExpression "config.programs.chromium.finalPackage"; description = "Package to use for chromium. Defaults to the wrapped finalPackage from programs.chromium."; }; - useOpenGL = lib.mkEnableOption '' + use-opengl = lib.mkEnableOption '' Use OpenGL APIs for graphics acceleration ''; }; - config = lib.mkIf config.web.chromium.enable { + config = lib.mkIf cfg.enable { programs.chromium = { enable = true; package = pkgs.ungoogled-chromium; - commandLineArgs = - let - extensionDirs = lib.concatStringsSep "," ( - lib.mapAttrsToList (_: ext: ext.drv) config.web.chromium.extensions - ); - in - [ - "--force-dark-mode" - "--force-device-scale-factor=1.15" - # Don't use the gnome password store - "--password-store=basic" - "--load-extension=${extensionDirs}" - ] - ++ lib.optionals config.web.chromium.useOpenGL [ - "--use-angle=opengl" - "--use-cmd-decoder=passthrough" - ]; + commandLineArgs = [ + "--force-dark-mode" + "--force-device-scale-factor=1.15" + # Don't use the gnome password store + "--password-store=basic" + "--load-extension=${extensionDirs}" + ] + ++ lib.optionals cfg.use-opengl [ + "--use-angle=opengl" + "--use-cmd-decoder=passthrough" + ]; }; xdg.mimeApps.defaultApplications = { @@ -94,10 +92,10 @@ credentials_enable_autosignin = false; extensions = { pinned_extensions = [ - config.web.chromium.extensions.browserpass.id - config.web.chromium.extensions.darkreader.id - config.web.chromium.extensions.ublockOrigin.id - config.web.chromium.extensions.vimium.id + cfg.extensions.browserpass.id + cfg.extensions.darkreader.id + cfg.extensions.ublockOrigin.id + cfg.extensions.vimium.id ]; theme = { id = ""; |
