2022-08-09 22:26:41 +00:00
|
|
|
{ config, pkgs, lib, mobile-nixos, ... }:
|
2022-05-23 02:45:54 +00:00
|
|
|
{
|
2022-06-23 22:42:20 +00:00
|
|
|
imports = [
|
2022-06-23 23:57:25 +00:00
|
|
|
./firmware.nix
|
2022-06-23 22:42:20 +00:00
|
|
|
./fs.nix
|
2022-08-09 22:26:41 +00:00
|
|
|
./kernel.nix
|
2022-06-23 22:42:20 +00:00
|
|
|
];
|
2022-09-30 11:44:29 +00:00
|
|
|
|
|
|
|
# cross-compiled documentation is *slow*.
|
|
|
|
# no obvious way to natively compile docs (2022/09/29).
|
|
|
|
# entrypoint is nixos/modules/misc/documentation.nix
|
|
|
|
# doc building happens in nixos/doc/manual/default.nix
|
|
|
|
# TODO: we could *maybe* inject pkgs.buildPackages.xyz = cross.buildPackages.xyz?
|
|
|
|
documentation.nixos.enable = false;
|
|
|
|
|
2022-05-23 10:06:29 +00:00
|
|
|
# XXX colin: phosh doesn't work well with passwordless login
|
|
|
|
users.users.colin.initialPassword = "147147";
|
2022-08-03 23:23:36 +00:00
|
|
|
services.getty.autologinUser = "root"; # allows for emergency maintenance?
|
2022-05-23 10:06:29 +00:00
|
|
|
|
2022-08-04 21:05:24 +00:00
|
|
|
# usability compromises
|
|
|
|
sane.impermanence.home-dirs = [
|
|
|
|
".librewolf"
|
|
|
|
];
|
|
|
|
|
2022-08-03 23:23:36 +00:00
|
|
|
# sane.home-packages.enableGuiPkgs = false; # XXX faster builds/imaging for debugging
|
2022-08-01 07:23:49 +00:00
|
|
|
sane.home-manager.extraPackages = [
|
2022-06-09 21:50:24 +00:00
|
|
|
pkgs.plasma5Packages.konsole # terminal
|
|
|
|
];
|
2022-05-23 07:40:59 +00:00
|
|
|
|
2022-08-01 07:23:49 +00:00
|
|
|
sane.nixcache.enable = true;
|
2022-08-04 21:05:24 +00:00
|
|
|
sane.impermanence.enable = true;
|
2022-08-01 07:23:49 +00:00
|
|
|
sane.gui.phosh.enable = true;
|
2022-08-03 23:23:36 +00:00
|
|
|
|
|
|
|
boot.loader.efi.canTouchEfiVariables = false;
|
2022-09-21 10:25:23 +00:00
|
|
|
# /boot space is at a premium. default was 20.
|
|
|
|
boot.loader.generic-extlinux-compatible.configurationLimit = 10;
|
2022-08-06 22:48:05 +00:00
|
|
|
# mobile.bootloader.enable = false;
|
|
|
|
# mobile.boot.stage-1.enable = false;
|
2022-08-03 23:23:36 +00:00
|
|
|
# boot.initrd.systemd.enable = false;
|
|
|
|
# boot.initrd.services.swraid.enable = false; # attempt to fix dm_mod stuff
|
2022-09-28 12:33:08 +00:00
|
|
|
# disable proximity sensor.
|
|
|
|
# the filtering/calibration is bad that it causes the screen to go fully dark at times.
|
|
|
|
boot.blacklistedKernelModules = [ "stk3310" ];
|
2022-08-03 23:23:36 +00:00
|
|
|
|
2022-10-04 09:25:59 +00:00
|
|
|
# without this some GUI apps fail: `DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory`
|
|
|
|
# this is because they can't allocate enough video ram.
|
|
|
|
# the default CMA seems to be 32M. we could probably get by with as little as 64M, and safely with 128M.
|
|
|
|
# `cat /proc/meminfo` to see CmaTotal/CmaFree if interested in tuning this.
|
|
|
|
boot.kernelParams = [ "cma=256M" ];
|
|
|
|
|
2022-08-05 21:42:08 +00:00
|
|
|
# mobile-nixos' /lib/firmware includes:
|
2022-08-03 23:23:36 +00:00
|
|
|
# rtl_bt (bluetooth)
|
|
|
|
# anx7688-fw.bin (USB-C -> HDMI bridge)
|
|
|
|
# ov5640_af.bin (camera module)
|
2022-08-06 22:48:05 +00:00
|
|
|
# hardware.firmware = [ config.mobile.device.firmware ];
|
2022-08-09 05:13:17 +00:00
|
|
|
hardware.firmware = [ pkgs.rtl8723cs-firmware ];
|
2022-06-07 00:39:40 +00:00
|
|
|
|
2022-08-01 21:38:10 +00:00
|
|
|
system.stateVersion = "21.11";
|
2022-05-30 21:56:31 +00:00
|
|
|
|
|
|
|
# defined: https://www.freedesktop.org/software/systemd/man/machine-info.html
|
|
|
|
# XXX colin: not sure which, if any, software makes use of this
|
|
|
|
environment.etc."machine-info".text = ''
|
|
|
|
CHASSIS="handset"
|
|
|
|
'';
|
2022-05-31 23:12:29 +00:00
|
|
|
|
|
|
|
# enable rotation sensor
|
|
|
|
hardware.sensor.iio.enable = true;
|
2022-07-15 06:58:27 +00:00
|
|
|
|
2022-09-26 07:46:38 +00:00
|
|
|
# from https://gitlab.manjaro.org/manjaro-arm/packages/community/phosh/alsa-ucm-pinephone
|
2022-09-26 08:42:31 +00:00
|
|
|
# mobile-nixos does this same thing, with *slightly different settings*.
|
|
|
|
# i trust manjaro more because the guy maintaining that is actively trying to upstream into alsa-ucm-conf.
|
|
|
|
# an alternative may be to build a custom alsa with the PinePhone config patch applied:
|
|
|
|
# - <https://github.com/alsa-project/alsa-ucm-conf/pull/134>
|
|
|
|
# that would make this be not device-specific
|
2022-09-26 07:46:38 +00:00
|
|
|
environment.variables.ALSA_CONFIG_UCM2 = "${./ucm2}";
|
|
|
|
systemd.services.pulseaudio.environment.ALSA_CONFIG_UCM2 = "${./ucm2}";
|
|
|
|
|
2022-09-28 06:23:37 +00:00
|
|
|
hardware.opengl.driSupport = true;
|
2022-05-23 02:45:54 +00:00
|
|
|
}
|