From e179a6bc060ce62b4901a164b36ae8631b8ed3da Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Sat, 14 Oct 2023 17:40:12 +0800 Subject: [PATCH] users: remove system-user.nix --- nixos/networking/proxy.nix | 10 +++++++++- nixos/users/default.nix | 1 - nixos/users/system-users.nix | 9 --------- 3 files changed, 9 insertions(+), 11 deletions(-) delete mode 100644 nixos/users/system-users.nix diff --git a/nixos/networking/proxy.nix b/nixos/networking/proxy.nix index fd06445..7546a77 100644 --- a/nixos/networking/proxy.nix +++ b/nixos/networking/proxy.nix @@ -1,9 +1,17 @@ { pkgs, config, inputs, ... }: { + ### System proxy settings networking.proxy.default = "http://127.0.0.1:7890/"; - #environment.systemPackages = with pkgs; [ clash-meta ]; + ### User running proxy service + users.groups."clash-meta" = {}; + users.users."clash-meta" = { + isSystemUser = true; + group = config.users.groups."clash-meta".name; + }; + + ### Proxy service systemd.services."clash-meta" = { wantedBy = [ "multi-user.target" ]; after = [ "network-online.target" ]; diff --git a/nixos/users/default.nix b/nixos/users/default.nix index d5afd53..29159c8 100644 --- a/nixos/users/default.nix +++ b/nixos/users/default.nix @@ -3,6 +3,5 @@ { imports = [ ./users.nix - ./system-users.nix ]; } \ No newline at end of file diff --git a/nixos/users/system-users.nix b/nixos/users/system-users.nix deleted file mode 100644 index 87e96d5..0000000 --- a/nixos/users/system-users.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ ... }: - -{ - users.users."clash-meta" = { - isSystemUser = true; - group = "clash-meta"; - }; - users.groups.clash-meta = {}; -} \ No newline at end of file