system: Determine isPhone from programs.calls.enable

Removes the redundant phone option and enables the usage of isPhone in
other modules besides system without having to import it.
This commit is contained in:
Donovan Glover 2024-09-09 11:51:39 -04:00
parent 21cd3e96da
commit 5790f1bbde
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 3 additions and 4 deletions

View File

@ -63,7 +63,6 @@ in
hostName = "mobile-nixos"; hostName = "mobile-nixos";
stateVersion = "23.11"; stateVersion = "23.11";
mullvad = true; mullvad = true;
phone = true;
}; };
hardware.keyboardBinds = true; hardware.keyboardBinds = true;

View File

@ -25,10 +25,11 @@ let
mullvad mullvad
allowSRB2Port allowSRB2Port
allowDevPort allowDevPort
phone
postgres postgres
; ;
isPhone = config.programs.calls.enable;
cfg = config.modules.system; cfg = config.modules.system;
in in
{ {
@ -80,7 +81,6 @@ in
postgres = mkEnableOption "postgres database for containers"; postgres = mkEnableOption "postgres database for containers";
allowSRB2Port = mkEnableOption "port for srb2"; allowSRB2Port = mkEnableOption "port for srb2";
allowDevPort = mkEnableOption "port for development server"; allowDevPort = mkEnableOption "port for development server";
phone = mkEnableOption "phone support";
}; };
config = { config = {
@ -154,7 +154,7 @@ in
isNormalUser = true; isNormalUser = true;
uid = 1000; uid = 1000;
password = mkIf (hashedPassword == null && !isContainer) (if phone then "1234" else username); password = mkIf (hashedPassword == null && !isContainer) (if isPhone then "1234" else username);
extraGroups = extraGroups =
if isContainer then if isContainer then