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
xresources
;
config = {
programs.man.generateCaches = lib.mkForce false;
};
};
environment.systemPackages = attrValues {
@ -65,18 +69,10 @@ in
system = {
hostName = "mobile-nixos";
stateVersion = "23.11";
phone = true;
};
desktop = {
phone = true;
mullvad = true;
};
hardware.keyboardBinds = true;
system = {
mullvad = true;
};
};
hardware.graphics.enable32Bit = lib.mkForce false;
@ -100,6 +96,11 @@ in
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 = {
enable = true;

View File

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