mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-06-20 01:38:02 +02:00
meta: Merge phone module with system / desktop
This commit is contained in:
parent
7afc6b27f8
commit
05b14fa423
@ -3,7 +3,7 @@
|
|||||||
let
|
let
|
||||||
inherit (lib) mkEnableOption mkIf mkMerge mkOption;
|
inherit (lib) mkEnableOption mkIf mkMerge mkOption;
|
||||||
inherit (lib.types) str float int;
|
inherit (lib.types) str float int;
|
||||||
inherit (config.modules.system) username;
|
inherit (config.modules.system) username phone;
|
||||||
inherit (cfg) bloat gnome plasma container theme opacity fontSize graphical;
|
inherit (cfg) bloat gnome plasma container theme opacity fontSize graphical;
|
||||||
inherit (nix-config.packages.${pkgs.system}) aleo-fonts;
|
inherit (nix-config.packages.${pkgs.system}) aleo-fonts;
|
||||||
inherit (pkgs) phinger-cursors noto-fonts-cjk-sans maple-mono noto-fonts-emoji;
|
inherit (pkgs) phinger-cursors noto-fonts-cjk-sans maple-mono noto-fonts-emoji;
|
||||||
@ -15,6 +15,7 @@ in
|
|||||||
imports = attrValues {
|
imports = attrValues {
|
||||||
inherit (nix-config.inputs.home-manager.nixosModules) home-manager;
|
inherit (nix-config.inputs.home-manager.nixosModules) home-manager;
|
||||||
inherit (nix-config.inputs.stylix.nixosModules) stylix;
|
inherit (nix-config.inputs.stylix.nixosModules) stylix;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
options.modules.desktop = {
|
options.modules.desktop = {
|
||||||
@ -41,11 +42,22 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
hardware.opengl.driSupport32Bit = true;
|
hardware = {
|
||||||
|
opengl.driSupport32Bit = true;
|
||||||
|
|
||||||
|
pulseaudio = mkIf phone {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.pulseaudioFull;
|
||||||
|
};
|
||||||
|
|
||||||
|
bluetooth.enable = mkIf phone true;
|
||||||
|
sensor.iio.enable = mkIf phone true;
|
||||||
|
};
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
hyprland.enable = mkIf (!container) true;
|
hyprland.enable = mkIf (!container && !phone) true;
|
||||||
cdemu.enable = true;
|
cdemu.enable = true;
|
||||||
|
calls.enable = mkIf phone true;
|
||||||
|
|
||||||
thunar = {
|
thunar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -56,7 +68,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
i18n.inputMethod = {
|
i18n.inputMethod = mkIf (!phone) {
|
||||||
enabled = "fcitx5";
|
enabled = "fcitx5";
|
||||||
|
|
||||||
fcitx5 = {
|
fcitx5 = {
|
||||||
@ -74,9 +86,15 @@ in
|
|||||||
xserver = mkIf (!container || graphical) {
|
xserver = mkIf (!container || graphical) {
|
||||||
enable = true;
|
enable = true;
|
||||||
excludePackages = [ pkgs.xterm ];
|
excludePackages = [ pkgs.xterm ];
|
||||||
|
|
||||||
|
desktopManager.phosh = mkIf phone {
|
||||||
|
enable = true;
|
||||||
|
user = username;
|
||||||
|
group = "users";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
pipewire = {
|
pipewire = mkIf (!phone) {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
alsa = {
|
alsa = {
|
||||||
@ -87,7 +105,7 @@ in
|
|||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
greetd = mkIf (!container) {
|
greetd = mkIf (!container && !phone) {
|
||||||
enable = true;
|
enable = true;
|
||||||
restart = false;
|
restart = false;
|
||||||
|
|
||||||
@ -133,6 +151,13 @@ in
|
|||||||
;
|
;
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
(mkIf phone (attrValues {
|
||||||
|
inherit (pkgs)
|
||||||
|
chatty
|
||||||
|
megapixels
|
||||||
|
;
|
||||||
|
}))
|
||||||
|
|
||||||
(attrValues {
|
(attrValues {
|
||||||
inherit (pkgs) anki kanjidraw pulseaudio glib;
|
inherit (pkgs) anki kanjidraw pulseaudio glib;
|
||||||
inherit (nix-config.inputs.sakaya.packages.${pkgs.system}) sakaya;
|
inherit (nix-config.inputs.sakaya.packages.${pkgs.system}) sakaya;
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
{ lib, pkgs, options, config, mobile-nixos, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (lib) mkEnableOption mkIf;
|
|
||||||
|
|
||||||
cfg = config.modules.phone;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
(import "${mobile-nixos}/lib/configuration.nix" {
|
|
||||||
device = "pine64-pinephone";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
options.modules.phone = {
|
|
||||||
enable = mkEnableOption "PinePhone support";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
mobile.beautification = {
|
|
||||||
silentBoot = lib.mkDefault true;
|
|
||||||
splash = lib.mkDefault true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.xserver.desktopManager.phosh = {
|
|
||||||
enable = true;
|
|
||||||
group = "users";
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.calls.enable = true;
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
chatty # IM and SMS
|
|
||||||
epiphany # Web browser
|
|
||||||
gnome-console # Terminal
|
|
||||||
megapixels # Camera
|
|
||||||
];
|
|
||||||
|
|
||||||
hardware.sensor.iio.enable = true;
|
|
||||||
|
|
||||||
assertions = [
|
|
||||||
{ assertion = options.services.xserver.desktopManager.phosh.user.isDefined;
|
|
||||||
message = ''
|
|
||||||
`services.xserver.desktopManager.phosh.user` not set.
|
|
||||||
When importing the phosh configuration in your system, you need to set `services.xserver.desktopManager.phosh.user` to the username of the session user.
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
@ -3,7 +3,7 @@
|
|||||||
let
|
let
|
||||||
inherit (lib) mkOption mkEnableOption mkIf singleton;
|
inherit (lib) mkOption mkEnableOption mkIf singleton;
|
||||||
inherit (lib.types) nullOr str listOf;
|
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;
|
inherit (builtins) attrValues;
|
||||||
|
|
||||||
cfg = config.modules.system;
|
cfg = config.modules.system;
|
||||||
@ -46,6 +46,8 @@ in
|
|||||||
|
|
||||||
iHaveLotsOfRam = mkEnableOption "tmpfs on /tmp";
|
iHaveLotsOfRam = mkEnableOption "tmpfs on /tmp";
|
||||||
|
|
||||||
|
phone = mkEnableOption "PinePhone support";
|
||||||
|
|
||||||
hostName = mkOption {
|
hostName = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
default = "nixos";
|
default = "nixos";
|
||||||
@ -123,7 +125,19 @@ in
|
|||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
uid = 1000;
|
uid = 1000;
|
||||||
password = mkIf (hashedPassword == null && !noRoot) username;
|
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" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user