diff options
author | Peter Hoeg <peter@hoeg.com> | 2022-03-08 11:56:13 +0800 |
---|---|---|
committer | Peter Hoeg <peter@hoeg.com> | 2022-03-13 20:22:00 +0800 |
commit | 80b9bfdfb1f72dc7067e355fbc89cb68ea0be118 (patch) | |
tree | 93c3e7866d080854e717579304a62edf34f82c73 /nixos/modules | |
parent | 895090bf89cd1a9cd7bc3ea7edd3bd2a0ae9d88f (diff) |
nixos/captive-browser: add to menu bar
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/programs/captive-browser.nix | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/nixos/modules/programs/captive-browser.nix b/nixos/modules/programs/captive-browser.nix index dc054504ea48..aad554c2bd66 100644 --- a/nixos/modules/programs/captive-browser.nix +++ b/nixos/modules/programs/captive-browser.nix @@ -1,8 +1,12 @@ { config, lib, pkgs, ... }: -with lib; let cfg = config.programs.captive-browser; + + inherit (lib) + concatStringsSep escapeShellArgs optionalString + literalExpression mkEnableOption mkIf mkOption mkOptionDefault types; + browserDefault = chromium: concatStringsSep " " [ ''env XDG_CONFIG_HOME="$PREV_CONFIG_HOME"'' ''${chromium}/bin/chromium'' @@ -15,6 +19,15 @@ let ''-no-default-browser-check'' ''http://cache.nixos.org/'' ]; + + desktopItem = pkgs.makeDesktopItem { + name = "captive-browser"; + desktopName = "Captive Portal Browser"; + exec = "/run/wrappers/bin/captive-browser"; + icon = "nix-snowflake"; + categories = [ "Network" ]; + }; + in { ###### interface @@ -84,6 +97,11 @@ in ###### implementation config = mkIf cfg.enable { + environment.systemPackages = [ + (pkgs.runCommandNoCC "captive-browser-desktop-item" { } '' + install -Dm444 -t $out/share/applications ${desktopItem}/share/applications/*.desktop + '') + ]; programs.captive-browser.dhcp-dns = let |