Compare commits
No commits in common. "18adff4c5260d4e2b9b79411affeff4626ba88fe" and "511462d6171b03e42e49487ecc35770282412045" have entirely different histories.
18adff4c52
...
511462d617
7 changed files with 178 additions and 256 deletions
|
|
@ -1 +0,0 @@
|
||||||
ce54be9aac846c7798307d6d6fcee3346c01f601
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
./modules/packages.nix
|
./modules/packages.nix
|
||||||
./modules/vscodium.nix
|
./modules/vscodium.nix
|
||||||
./modules/fonts.nix
|
./modules/fonts.nix
|
||||||
./modules/captive-browser.nix
|
|
||||||
];
|
];
|
||||||
home.homeDirectory =
|
home.homeDirectory =
|
||||||
if pkgs.stdenv.isDarwin then "/Users/${config.home.username}" else "/home/${config.home.username}";
|
if pkgs.stdenv.isDarwin then "/Users/${config.home.username}" else "/home/${config.home.username}";
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,8 @@
|
||||||
contacts = import "${inputs.mysecrets}/contacts.nix" { inherit lib; };
|
contacts = import "${inputs.mysecrets}/contacts.nix" { inherit lib; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
includes = [
|
includes =
|
||||||
|
[
|
||||||
{
|
{
|
||||||
condition = "gitdir:~/Seafile/Studium/";
|
condition = "gitdir:~/Seafile/Studium/";
|
||||||
contents = {
|
contents = {
|
||||||
|
|
|
||||||
|
|
@ -1,77 +0,0 @@
|
||||||
{
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
system,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
tomlFormat = pkgs.formats.toml { };
|
|
||||||
cfg = config.programs.captive-browser;
|
|
||||||
inherit (pkgs.stdenv.hostPlatform) isDarwin;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.programs.captive-browser = {
|
|
||||||
enable = lib.mkEnableOption "Enable custom captive-browser in user PATH";
|
|
||||||
package = lib.mkPackageOption pkgs "captive-browser" { nullable = true; };
|
|
||||||
settings = lib.mkOption {
|
|
||||||
type = lib.types.submodule {
|
|
||||||
freeformType = tomlFormat.type;
|
|
||||||
|
|
||||||
options = {
|
|
||||||
browser = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "command to invoke the browser with";
|
|
||||||
|
|
||||||
# browser is the shell (/bin/sh) command executed once the proxy starts.
|
|
||||||
# When browser exits, the proxy exits. An extra env var PROXY is available.
|
|
||||||
#
|
|
||||||
# Here, we use a separate Chrome instance in Incognito mode, so that
|
|
||||||
# it can run (and be waited for) alongside the default one, and that
|
|
||||||
# it maintains no state across runs. To configure this browser open a
|
|
||||||
# normal window in it, settings will be preserved.
|
|
||||||
default = ''
|
|
||||||
${cfg.browserCommand} \
|
|
||||||
--user-data-dir="$HOME/Library/Application Support/Google/Captive" \
|
|
||||||
--proxy-server="socks5://$PROXY" \
|
|
||||||
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" \
|
|
||||||
--no-first-run --new-window --incognito \
|
|
||||||
http://example.com
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
interface = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "WLAN interface to use";
|
|
||||||
};
|
|
||||||
browserCommand = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = if isDarwin then "open -n -W -a \"Google Chrome\" --args" else (lib.getExe pkgs.chromium);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
home.packages = [ cfg.package ];
|
|
||||||
|
|
||||||
programs.captive-browser.settings = {
|
|
||||||
# dhcp-dns is the shell (/bin/sh) command executed to obtain the DHCP
|
|
||||||
# DNS server address. The first match of an IPv4 regex is used.
|
|
||||||
# IPv4 only, because let's be real, it's a captive portal.
|
|
||||||
dhcp-dns = "ipconfig getoption ${cfg.interface} domain_name_server";
|
|
||||||
|
|
||||||
# socks5-addr is the listen address for the SOCKS5 proxy server.
|
|
||||||
socks5-addr = "localhost:1666";
|
|
||||||
};
|
|
||||||
home.file.".config/captive-browser.toml" = lib.mkIf (isDarwin && !config.xdg.enable) {
|
|
||||||
source = tomlFormat.generate "captive-browser-config" cfg.settings;
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.configFile."captive-browser.toml" = lib.mkIf (!(isDarwin && !config.xdg.enable)) {
|
|
||||||
source = tomlFormat.generate "captive-browser-config" cfg.settings;
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -43,6 +43,5 @@ in
|
||||||
koma-script
|
koma-script
|
||||||
;
|
;
|
||||||
})
|
})
|
||||||
]
|
] ++ lib.optionals config.schmittlauch.latex.guiTools latexGuiTools;
|
||||||
++ lib.optionals config.schmittlauch.latex.guiTools latexGuiTools;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@ let
|
||||||
unstable = inputs.nixos-unstable.legacyPackages.${system};
|
unstable = inputs.nixos-unstable.legacyPackages.${system};
|
||||||
nur = inputs.nur.legacyPackages.${system};
|
nur = inputs.nur.legacyPackages.${system};
|
||||||
|
|
||||||
graphicsApps = [
|
graphicsApps =
|
||||||
|
[
|
||||||
inkscape
|
inkscape
|
||||||
darktable
|
darktable
|
||||||
exiftool
|
exiftool
|
||||||
|
|
@ -31,7 +32,8 @@ let
|
||||||
gimp
|
gimp
|
||||||
];
|
];
|
||||||
|
|
||||||
multimediaApps = [
|
multimediaApps =
|
||||||
|
[
|
||||||
mpv
|
mpv
|
||||||
yt-dlp
|
yt-dlp
|
||||||
]
|
]
|
||||||
|
|
@ -47,7 +49,8 @@ let
|
||||||
#nur.repos.fooker.studio-link
|
#nur.repos.fooker.studio-link
|
||||||
];
|
];
|
||||||
|
|
||||||
cliApps = [
|
cliApps =
|
||||||
|
[
|
||||||
coreutils
|
coreutils
|
||||||
myVim
|
myVim
|
||||||
htop
|
htop
|
||||||
|
|
@ -98,7 +101,8 @@ let
|
||||||
nix-top
|
nix-top
|
||||||
statix
|
statix
|
||||||
];
|
];
|
||||||
devTools = [
|
devTools =
|
||||||
|
[
|
||||||
curl
|
curl
|
||||||
httpie
|
httpie
|
||||||
gcc
|
gcc
|
||||||
|
|
@ -192,7 +196,8 @@ let
|
||||||
chromedriver
|
chromedriver
|
||||||
];
|
];
|
||||||
|
|
||||||
kdeTools = [
|
kdeTools =
|
||||||
|
[
|
||||||
okteta
|
okteta
|
||||||
plasma5Packages.kdeconnect-kde
|
plasma5Packages.kdeconnect-kde
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,8 @@ in
|
||||||
contacts = import "${inputs.mysecrets}/contacts.nix" { inherit lib; };
|
contacts = import "${inputs.mysecrets}/contacts.nix" { inherit lib; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
includes = [
|
includes =
|
||||||
|
[
|
||||||
{
|
{
|
||||||
condition = "gitdir:~/src/schmittlauch/";
|
condition = "gitdir:~/src/schmittlauch/";
|
||||||
contents = {
|
contents = {
|
||||||
|
|
@ -93,11 +94,6 @@ in
|
||||||
+ import ./scripts/ssh-loop-fc.nix { inherit pkgs lib; }
|
+ import ./scripts/ssh-loop-fc.nix { inherit pkgs lib; }
|
||||||
);
|
);
|
||||||
|
|
||||||
# separate proxied browser using the DHCP-supplied DNS for accessing captive portals
|
|
||||||
programs.captive-browser = {
|
|
||||||
enable = true;
|
|
||||||
interface = "en0";
|
|
||||||
};
|
|
||||||
launchd.agents.hydra_proxy = {
|
launchd.agents.hydra_proxy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue