Skip to content

Commit

Permalink
add: fw-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
jz8132543 committed Mar 8, 2024
1 parent 1726783 commit 8c39f54
Show file tree
Hide file tree
Showing 12 changed files with 988 additions and 90 deletions.
90 changes: 90 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
url = "github:nix-community/haumea";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
colmena = {
url = "github:zhaofengli/colmena";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down Expand Up @@ -145,6 +153,13 @@
inputs.flake-utils.follows = "flake-utils";
inputs.flake-compat.follows = "flake-compat";
};
clash2sing-box = {
url = "github:oluceps/clash2sing-box";
inputs.flake-utils.follows = "flake-utils";
inputs.naersk.follows = "naersk";
inputs.nixpkgs.follows = "nixpkgs";
inputs.fenix.follows = "fenix";
};
# Themes
grub2-themes = {
url = "github:vinceliuice/grub2-themes";
Expand Down
20 changes: 20 additions & 0 deletions home-manager/modules/desktop/dconf-proxy.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
lib,
osConfig,
...
}: let
proxy = {
host = "localhost";
port = osConfig.networking.fw-proxy.ports.mixed;
};
in {
dconf.settings = lib.mkIf (osConfig.networking.fw-proxy.enable && osConfig.programs.dconf.enable) {
"system/proxy" = {
mode = "manual";
use-same-proxy = true;
};
"system/proxy/http" = proxy;
"system/proxy/https" = proxy;
"system/proxy/socks" = proxy;
};
}
4 changes: 4 additions & 0 deletions nixos/hosts/isk/_steam/dst/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
config,
pkgs,
lib,
...
}: let
gameHome = config.users.users.steam.home;
Expand Down Expand Up @@ -73,6 +74,9 @@ in {
ExecStop = stopScript;
CPUQuota = "300%"; # at most 1.5 core (2 cores in total)
};
environment =
lib.mkIf (config.networking.fw-proxy.enable)
config.networking.fw-proxy.environment;
wantedBy = ["multi-user.target"];
};
networking.firewall.allowedUDPPorts = [
Expand Down
1 change: 1 addition & 0 deletions nixos/hosts/surface/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
++ nixosModules.desktop.all
++ [
./hardware-configuration.nix
nixosModules.services.fw-proxy
];

microsoft-surface = {
Expand Down
Loading

0 comments on commit 8c39f54

Please sign in to comment.