From 5a2116572d97128c750ba8ecb4aa24991622501e Mon Sep 17 00:00:00 2001 From: Zhongheng Liu Date: Sun, 25 Aug 2024 18:43:16 +0800 Subject: [PATCH] feat: included additional system components Moved proxy declaration to specialisation Enabled avahi Enabled CUPS printing services --- nixos/configuration.nix | 10 +++++++--- nixos/services/avahi.service.nix | 7 +++++++ nixos/services/laptop.preset.nix | 2 ++ nixos/services/printing.service.nix | 6 ++++++ 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 nixos/services/avahi.service.nix create mode 100644 nixos/services/printing.service.nix diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 2ef2d79..af1a358 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -37,9 +37,13 @@ enable = true; powerOnBoot = true; }; - networking.proxy = { - default = "http://127.0.0.1:7897/"; - noProxy = "127.0.0.1,localhost,internal.domain"; + specialisation = { + in-china.configuration = { + networking.proxy = { + default = "http://127.0.0.1:7897/"; + noProxy = "127.0.0.1,localhost,internal.domain"; + }; + }; }; systemd.user.services.mpris-proxy = { diff --git a/nixos/services/avahi.service.nix b/nixos/services/avahi.service.nix new file mode 100644 index 0000000..54bf88c --- /dev/null +++ b/nixos/services/avahi.service.nix @@ -0,0 +1,7 @@ +{...}: { + services.avahi = { + enable = true; + nssmdns = true; + openFirewall = true; + }; +} diff --git a/nixos/services/laptop.preset.nix b/nixos/services/laptop.preset.nix index 4199353..31d0137 100644 --- a/nixos/services/laptop.preset.nix +++ b/nixos/services/laptop.preset.nix @@ -4,5 +4,7 @@ ./pipewire.service.nix ./syncthing.service.nix ./misc.service.nix + ./avahi.service.nix + ./printing.service.nix ]; } diff --git a/nixos/services/printing.service.nix b/nixos/services/printing.service.nix new file mode 100644 index 0000000..a89c732 --- /dev/null +++ b/nixos/services/printing.service.nix @@ -0,0 +1,6 @@ +{...}: { + services.printing = { + enable = true; + drivers = []; + }; +}