meta: Merge phone module with system / desktop

This commit is contained in:
Donovan Glover
2024-06-14 01:21:06 -04:00
parent 7afc6b27f8
commit 05b14fa423
3 changed files with 47 additions and 58 deletions

View File

@@ -3,7 +3,7 @@
let
inherit (lib) mkOption mkEnableOption mkIf singleton;
inherit (lib.types) nullOr str listOf;
inherit (cfg) username iHaveLotsOfRam hashedPassword mullvad allowSRB2Port allowDevPort noRoot postgres;
inherit (cfg) username iHaveLotsOfRam hashedPassword mullvad allowSRB2Port allowDevPort noRoot postgres phone;
inherit (builtins) attrValues;
cfg = config.modules.system;
@@ -46,6 +46,8 @@ in
iHaveLotsOfRam = mkEnableOption "tmpfs on /tmp";
phone = mkEnableOption "PinePhone support";
hostName = mkOption {
type = str;
default = "nixos";
@@ -123,7 +125,19 @@ in
isNormalUser = true;
uid = 1000;
password = mkIf (hashedPassword == null && !noRoot) username;
extraGroups = if noRoot then [ ] else [ "wheel" "networkmanager" ];
extraGroups =
if noRoot
then [ ]
else
if phone
then [
"dialout"
"feedbackd"
"networkmanager"
"video"
"wheel"
]
else [ "wheel" "networkmanager" ];
};
};