Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions nixos/modules/programs/captive-browser.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,27 @@ let
types
;

requiresSetcapWrapper = config.boot.kernelPackages.kernelOlder "5.7" && cfg.bindInterface;

browserDefault =
chromium:
concatStringsSep " " [
''env XDG_CONFIG_HOME="$PREV_CONFIG_HOME"''
"${chromium}/bin/chromium"
"--user-data-dir=\${XDG_DATA_HOME:-$HOME/.local/share}/chromium-captive"
''--proxy-server="socks5://$PROXY"''
''--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost"''
''--proxy-bypass-list="<-loopback>"''
"--no-first-run"
"--new-window"
"--incognito"
"-no-default-browser-check"
"--no-crash-upload"
"--disable-extensions"
"--disable-sync"
"--disable-background-networking"
"--disable-client-side-phishing-detection"
"--disable-component-update"
"--disable-translate"
"--disable-web-resources"
"--safebrowsing-disable-auto-update"
"http://cache.nixos.org/"
];

Expand Down Expand Up @@ -144,12 +151,5 @@ in
else
throw "programs.captive-browser.dhcp-dns must be set"
);

security.wrappers.captive-browser = mkIf requiresSetcapWrapper {
owner = "root";
group = "root";
capabilities = "cap_net_raw+p";
source = "${captive-browser-configured}/bin/captive-browser";
};
};
}
25 changes: 8 additions & 17 deletions pkgs/by-name/ca/captive-browser/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,25 @@
lib,
fetchFromGitHub,
buildGoModule,
fetchpatch,
}:

buildGoModule {
buildGoModule (finalAttrs: {
pname = "captive-browser";
version = "0-unstable-2021-08-01";
version = "0-unstable-2025-11-05";

src = fetchFromGitHub {
owner = "FiloSottile";
owner = "pacoorozco";
repo = "captive-browser";
rev = "9c707dc32afc6e4146e19b43a3406329c64b6f3c";
sha256 = "sha256-65lPo5tpE0M/VyyvlzlcVSuHX4AhhVuqK0UF4BIAH/Y=";
rev = "ca6f74e132ecf298c87936d4c946fd551aefbbf7";
sha256 = "sha256-wojx28GFg9whfkNxUbOVDVNHp8M7SLsmRBTP/Jh8nLQ=";
};

vendorHash = "sha256-2MFdQ2GIDAdLPuwAiGPO9wU3mm2BDXdyTwoVA1xVlcQ=";
deleteVendor = true;

patches = [
# Add go modules support
(fetchpatch {
url = "https://github.com/FiloSottile/captive-browser/commit/ef50837778ef4eaf38b19887e79c8b6fa830c342.patch";
hash = "sha256-w+jDFeO94pMu4ir+G5CzqYlXxYOm9+YfyzbU3sbTyiY=";
})
];
vendorHash = "sha256-8FMFgCJUTalJ45GR5UnyXqN6s0gVFtiy6zjugbngDYQ=";

ldflags = [
"-s"
"-w"
"-X main.Version=${finalAttrs.version}"
];

meta = {
Expand All @@ -38,4 +29,4 @@ buildGoModule {
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ma27 ];
};
}
})
Loading