diff --git a/hosts/phone/configuration.nix b/hosts/phone/configuration.nix index 6116b59f..2752cc11 100644 --- a/hosts/phone/configuration.nix +++ b/hosts/phone/configuration.nix @@ -1,14 +1,12 @@ { self, pkgs, - config, lib, ... }: let inherit (lib) mkIf mkForce; - inherit (config.modules.system) username; inherit (builtins) attrValues; in { @@ -38,24 +36,6 @@ in xdg-user-dirs xresources ; - - config = { - programs.man.generateCaches = mkForce false; - }; - }; - - environment = { - sessionVariables = { - LIBGL_ALWAYS_SOFTWARE = "true"; - }; - - systemPackages = with pkgs; [ - chatty - megapixels - livi - gnome-contacts - eog - ]; }; modules = { @@ -66,85 +46,28 @@ in }; hardware.keyboardBinds = true; + + phone.enable = true; }; i18n.inputMethod.enable = mkForce false; programs = { - calls.enable = true; - cdemu.enable = mkForce false; hyprland.enable = mkForce false; thunar.enable = mkForce false; }; - networking = { - wireless.enable = false; - wireguard.enable = true; - - networkmanager.ensureProfiles.profiles = { - mobile = { - connection = { - id = "4G"; - type = "gsm"; - }; - - gsm.apn = "NXTGENPHONE"; - ipv4.method = "auto"; - - ipv6 = { - addr-gen-mode = "default"; - method = "auto"; - }; - }; - }; - - firewall.checkReversePath = mkForce false; - }; - services = { - xserver = { - displayManager.lightdm.enable = false; - - desktopManager.phosh = { - enable = true; - group = "users"; - user = username; - }; - }; - udisks2.enable = mkForce false; pipewire.enable = mkForce false; greetd.enable = mkForce false; }; boot = { - enableContainers = false; - binfmt.emulatedSystems = mkForce [ ]; loader.systemd-boot.enable = mkIf (pkgs.system == "aarch64-linux") (mkForce false); - - kernel.sysctl = { - "vm.dirty_background_ratio" = 5; - "vm.dirty_ratio" = 10; - }; - }; - - documentation = { - enable = false; - man.generateCaches = false; }; hardware.graphics.enable32Bit = mkForce false; - - powerManagement = { - enable = true; - - cpufreq = rec { - min = 816000; - max = min; - }; - - cpuFreqGovernor = "performance"; - }; } diff --git a/modules/phone.nix b/modules/phone.nix new file mode 100644 index 00000000..e14c9162 --- /dev/null +++ b/modules/phone.nix @@ -0,0 +1,102 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + inherit (lib) + mkIf + mkEnableOption + mkForce + ; + + inherit (config.modules.system) username; + + cfg = config.modules.phone; +in +{ + options.modules.phone = { + enable = mkEnableOption "phone support"; + }; + + config = mkIf cfg.enable { + environment = { + sessionVariables = { + LIBGL_ALWAYS_SOFTWARE = "true"; + }; + + systemPackages = with pkgs; [ + chatty + megapixels + livi + gnome-contacts + eog + ]; + }; + + programs.calls.enable = true; + + networking = { + wireless.enable = false; + wireguard.enable = true; + + networkmanager.ensureProfiles.profiles = { + mobile = { + connection = { + id = "4G"; + type = "gsm"; + }; + + gsm.apn = "NXTGENPHONE"; + ipv4.method = "auto"; + + ipv6 = { + addr-gen-mode = "default"; + method = "auto"; + }; + }; + }; + + firewall.checkReversePath = mkForce false; + }; + + documentation = { + enable = false; + man.generateCaches = false; + }; + + services = { + xserver = { + displayManager.lightdm.enable = false; + + desktopManager.phosh = { + enable = true; + group = "users"; + user = username; + }; + }; + }; + + boot = { + enableContainers = false; + + kernel.sysctl = { + "vm.dirty_background_ratio" = 5; + "vm.dirty_ratio" = 10; + }; + }; + + powerManagement = { + enable = true; + + cpufreq = rec { + min = 816000; + max = min; + }; + + cpuFreqGovernor = "performance"; + }; + }; +} diff --git a/modules/system.nix b/modules/system.nix index a64a1e1f..df347591 100644 --- a/modules/system.nix +++ b/modules/system.nix @@ -179,7 +179,7 @@ in inherit (cfg) stateVersion; }; - programs.man.generateCaches = true; + programs.man.generateCaches = mkIf (!isPhone) true; }; users.${username}.home = {