Compare commits

..

No commits in common. "18adff4c5260d4e2b9b79411affeff4626ba88fe" and "511462d6171b03e42e49487ecc35770282412045" have entirely different histories.

7 changed files with 178 additions and 256 deletions

View file

@ -1 +0,0 @@
ce54be9aac846c7798307d6d6fcee3346c01f601

View file

@ -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}";

View file

@ -33,39 +33,40 @@
contacts = import "${inputs.mysecrets}/contacts.nix" { inherit lib; }; contacts = import "${inputs.mysecrets}/contacts.nix" { inherit lib; };
in in
{ {
includes = [ includes =
{ [
condition = "gitdir:~/Seafile/Studium/"; {
contents = { condition = "gitdir:~/Seafile/Studium/";
user.name = contacts.personal.name;
user.email = contacts.uni.email;
};
}
{
condition = "gitdir:~/src/nixpkgs/";
contents = {
user.name = "Trolli Schmittlauch";
user.email = contacts.nixOs.email;
};
}
]
# set default name for several other common locations
++
map
(dir: {
condition = "gitdir:${dir}";
contents = { contents = {
user = { user.name = contacts.personal.name;
inherit (contacts.schmittlauch) email name; user.email = contacts.uni.email;
};
}; };
}) }
[ {
"~/src/" condition = "gitdir:~/src/nixpkgs/";
"~/bin/" contents = {
"~/tmp/" user.name = "Trolli Schmittlauch";
"~/nixconfigs/" user.email = contacts.nixOs.email;
]; };
}
]
# set default name for several other common locations
++
map
(dir: {
condition = "gitdir:${dir}";
contents = {
user = {
inherit (contacts.schmittlauch) email name;
};
};
})
[
"~/src/"
"~/bin/"
"~/tmp/"
"~/nixconfigs/"
];
}; };
services.gpg-agent = { services.gpg-agent = {

View file

@ -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;
};
};
}

View file

@ -43,6 +43,5 @@ in
koma-script koma-script
; ;
}) })
] ] ++ lib.optionals config.schmittlauch.latex.guiTools latexGuiTools;
++ lib.optionals config.schmittlauch.latex.guiTools latexGuiTools;
} }

View file

@ -12,85 +12,88 @@ 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 [
darktable inkscape
exiftool darktable
] exiftool
++ (with gimp3Plugins; [ ]
#fourier # broken ++ (with gimp3Plugins; [
#lqrPlugin # broken #fourier # broken
]) #lqrPlugin # broken
++ lib.optionals pkgs.stdenv.isLinux [ ])
gimp3 ++ lib.optionals pkgs.stdenv.isLinux [
hugin gimp3
#luminanceHDR # FIXME, build failure hugin
xournalpp #luminanceHDR # FIXME, build failure
] xournalpp
++ lib.optionals pkgs.stdenv.isDarwin [ ]
gimp ++ lib.optionals pkgs.stdenv.isDarwin [
]; gimp
];
multimediaApps = [ multimediaApps =
mpv [
yt-dlp mpv
] yt-dlp
++ lib.optionals pkgs.stdenv.isDarwin [ vlc-bin ] ]
++ lib.optionals pkgs.stdenv.isLinux [ ++ lib.optionals pkgs.stdenv.isDarwin [ vlc-bin ]
vlc ++ lib.optionals pkgs.stdenv.isLinux [
amarok vlc
clementine amarok
kdePackages.elisa clementine
musescore kdePackages.elisa
tenacity musescore
soundkonverter tenacity
#nur.repos.fooker.studio-link soundkonverter
]; #nur.repos.fooker.studio-link
];
cliApps = [ cliApps =
coreutils [
myVim coreutils
htop myVim
tmux htop
httpie tmux
rsync httpie
ponysay rsync
gti ponysay
tree gti
lsof tree
mosh lsof
openssh mosh
sshfs-fuse openssh
sshuttle sshfs-fuse
cryfs sshuttle
thefuck cryfs
gnupg thefuck
unar gnupg
lzop unar
p7zip lzop
pwgen p7zip
pandoc pwgen
pdfgrep pandoc
# zig dependency breaks occasionally, stay on C version for now pdfgrep
ncdu_1 # zig dependency breaks occasionally, stay on C version for now
dos2unix ncdu_1
unzip dos2unix
fswatch unzip
jq fswatch
age jq
lnav age
spacer lnav
spacer
nix-output-monitor # putting this here as a plain `nix` alternative nix-output-monitor # putting this here as a plain `nix` alternative
] ]
++ lib.optionals pkgs.stdenv.isLinux [ ++ lib.optionals pkgs.stdenv.isLinux [
xclip xclip
smbnetfs # for FUSE smb mounting smbnetfs # for FUSE smb mounting
psmisc # for killall psmisc # for killall
torsocks torsocks
agrep agrep
reptyr # re-bind running program to other tty reptyr # re-bind running program to other tty
]; ];
nixHelpers = [ nixHelpers = [
nixpkgs-review nixpkgs-review
@ -98,29 +101,30 @@ let
nix-top nix-top
statix statix
]; ];
devTools = [ devTools =
curl [
httpie curl
gcc httpie
shellcheck gcc
mtr shellcheck
ripgrep mtr
fd ripgrep
gitui fd
pre-commit gitui
scriv pre-commit
scriv
# Haskell # Haskell
ghc ghc
cabal2nix cabal2nix
] ]
++ lib.optionals pkgs.stdenv.isLinux [ ++ lib.optionals pkgs.stdenv.isLinux [
gdb gdb
strace strace
ltrace ltrace
valgrind valgrind
zeal zeal
]; ];
pythonTools = with python3Packages; [ pythonTools = with python3Packages; [
python # to shadow old macOS python python # to shadow old macOS python
@ -192,32 +196,33 @@ let
chromedriver chromedriver
]; ];
kdeTools = [ kdeTools =
okteta [
plasma5Packages.kdeconnect-kde okteta
] plasma5Packages.kdeconnect-kde
++ (with kdePackages; [ ]
okular ++ (with kdePackages; [
gwenview okular
yakuake gwenview
dolphin yakuake
spectacle dolphin
kate spectacle
kleopatra kate
qdirstat kleopatra
ark qdirstat
kwalletmanager ark
#ktouch # TODO: unbreak kwalletmanager
kcharselect #ktouch # TODO: unbreak
konversation kcharselect
krdc konversation
skanlite krdc
akonadiconsole skanlite
tokodon # mastodon client akonadiconsole
networkmanager-qt tokodon # mastodon client
kcrash networkmanager-qt
breeze-gtk kcrash
]); breeze-gtk
]);
in in
{ {
options.schmittlauch.packages = { options.schmittlauch.packages = {

View file

@ -66,25 +66,26 @@ 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 = {
user = {
inherit (contacts.schmittlauch) name email;
};
};
}
]
# set default name for several other common locations
++ map (dir: {
condition = "gitdir:${dir}";
contents = { contents = {
user = { user = {
inherit (contacts.schmittlauch) name email; inherit (contacts.work) name email;
}; };
}; };
} }) [ "~/" ];
]
# set default name for several other common locations
++ map (dir: {
condition = "gitdir:${dir}";
contents = {
user = {
inherit (contacts.work) name email;
};
};
}) [ "~/" ];
}; };
# some extra shell scripts # some extra shell scripts
@ -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 = {