mirror of
https://github.com/Dichgrem/DCGOS.git
synced 2025-12-16 11:12:00 -05:00
chore:remove_gfs
This commit is contained in:
@@ -1,5 +0,0 @@
|
|||||||
{pkgs, ...}: {
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
gui-for-singbox
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,9 @@
|
|||||||
|
|
||||||
GPU-AMD = true;
|
GPU-AMD = true;
|
||||||
### See https://nixos.wiki/wiki/AMD_GPU
|
### See https://nixos.wiki/wiki/AMD_GPU
|
||||||
|
|
||||||
|
SingBox = true;
|
||||||
|
|
||||||
Power-control = "TLP";
|
Power-control = "TLP";
|
||||||
### Possible options: PPD ; TLP
|
### Possible options: PPD ; TLP
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
HotSpot-Use-Case = false;
|
HotSpot-Use-Case = false;
|
||||||
### See https://nixos.wiki/wiki/Internet_Connection_Sharing
|
### See https://nixos.wiki/wiki/Internet_Connection_Sharing
|
||||||
|
|
||||||
|
SingBox = true;
|
||||||
|
|
||||||
Power control = "PPD";
|
Power control = "PPD";
|
||||||
### Possible options: PPD ; TLP
|
### Possible options: PPD ; TLP
|
||||||
|
|
||||||
|
|||||||
39
modules/services/sing-box.nix
Normal file
39
modules/services/sing-box.nix
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{ hostname, lib, pkgs, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
inherit (import ../../hosts/${hostname}/env.nix) SingBox;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
disabledModules = [ "services/networking/sing-box.nix" ];
|
||||||
|
|
||||||
|
config = mkIf SingBox {
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.sing-box ];
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d /etc/sing-box 0755 root root -"
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.services.sing-box = {
|
||||||
|
description = "sing-box service (custom)";
|
||||||
|
after = [ "network.target" ];
|
||||||
|
wantedBy = [ ];
|
||||||
|
|
||||||
|
script = ''
|
||||||
|
exec ${pkgs.sing-box}/bin/sing-box -D "$STATE_DIRECTORY" run -c /etc/sing-box/config.json
|
||||||
|
'';
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
DynamicUser = true;
|
||||||
|
CapabilityBoundingSet = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_DAC_OVERRIDE";
|
||||||
|
AmbientCapabilities = "CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_DAC_OVERRIDE";
|
||||||
|
|
||||||
|
NoNewPrivileges = true;
|
||||||
|
StateDirectory = "sing-box";
|
||||||
|
StateDirectoryMode = "0700";
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = 5;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user