phone: Move phone-specific config out of system

This commit is contained in:
Donovan Glover 2024-07-17 06:49:30 -04:00
parent 2cd3aaf869
commit 86a786cf1f
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 14 additions and 19 deletions

View File

@ -30,6 +30,10 @@ in
xdg-user-dirs xdg-user-dirs
xresources xresources
; ;
config = {
programs.man.generateCaches = lib.mkForce false;
};
}; };
environment.systemPackages = attrValues { environment.systemPackages = attrValues {
@ -65,18 +69,10 @@ in
system = { system = {
hostName = "mobile-nixos"; hostName = "mobile-nixos";
stateVersion = "23.11"; stateVersion = "23.11";
phone = true; mullvad = true;
};
desktop = {
phone = true;
}; };
hardware.keyboardBinds = true; hardware.keyboardBinds = true;
system = {
mullvad = true;
};
}; };
hardware.graphics.enable32Bit = lib.mkForce false; hardware.graphics.enable32Bit = lib.mkForce false;
@ -100,6 +96,11 @@ in
udisks2.enable = lib.mkForce false; udisks2.enable = lib.mkForce false;
}; };
boot.binfmt.emulatedSystems = lib.mkForce [ ];
boot.loader.systemd-boot.enable = lib.mkForce false;
networking.firewall.checkReversePath = lib.mkForce false;
documentation.man.generateCaches = false;
powerManagement = { powerManagement = {
enable = true; enable = true;

View File

@ -3,7 +3,7 @@
let let
inherit (lib) mkOption mkEnableOption mkIf singleton optionals; inherit (lib) mkOption mkEnableOption mkIf singleton optionals;
inherit (lib.types) nullOr str listOf; inherit (lib.types) nullOr str listOf;
inherit (cfg) username iHaveLotsOfRam hashedPassword mullvad allowSRB2Port allowDevPort noRoot postgres phone; inherit (cfg) username iHaveLotsOfRam hashedPassword mullvad allowSRB2Port allowDevPort noRoot postgres;
inherit (builtins) attrValues; inherit (builtins) attrValues;
cfg = config.modules.system; cfg = config.modules.system;
@ -45,7 +45,6 @@ in
}; };
iHaveLotsOfRam = mkEnableOption "tmpfs on /tmp"; iHaveLotsOfRam = mkEnableOption "tmpfs on /tmp";
phone = mkEnableOption "Phone support";
hostName = mkOption { hostName = mkOption {
type = str; type = str;
@ -62,7 +61,7 @@ in
}; };
config = { config = {
boot = mkIf (!phone) { boot = {
tmp = tmp =
if iHaveLotsOfRam if iHaveLotsOfRam
then { useTmpfs = true; } then { useTmpfs = true; }
@ -138,16 +137,13 @@ in
else [ else [
"wheel" "wheel"
"networkmanager" "networkmanager"
] ++ (optionals (phone) [
"dialout" "dialout"
"feedbackd" "feedbackd"
"video" "video"
]); ];
}; };
}; };
documentation.man.generateCaches = mkIf (phone) false;
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
@ -157,7 +153,7 @@ in
inherit (cfg) stateVersion; inherit (cfg) stateVersion;
}; };
programs.man.generateCaches = mkIf (!phone) true; programs.man.generateCaches = true;
}; };
users.${username}.home = { users.${username}.home = {
@ -233,8 +229,6 @@ in
allowedTCPPorts = mkIf allowDevPort [ allowedTCPPorts = mkIf allowDevPort [
3000 3000
]; ];
checkReversePath = mkIf phone (lib.mkForce false);
}; };
}; };