2023-01-02 10:00:20 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
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
|
|
|
|
2023-01-20 11:37:43 +00:00
|
|
|
sane.roles.client = true;
|
2023-01-20 22:40:58 +00:00
|
|
|
sane.services.wg-home.enable = true;
|
|
|
|
sane.services.wg-home.ip = config.sane.hosts.by-name."moby".wg-home.ip;
|
2023-01-20 11:37:43 +00:00
|
|
|
|
2022-10-24 14:39:50 +00:00
|
|
|
# XXX colin: phosh doesn't work well with passwordless login,
|
|
|
|
# so set this more reliable default password should anything go wrong
|
2022-05-23 10:06:29 +00:00
|
|
|
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-10-24 14:39:50 +00:00
|
|
|
sops.secrets.colin-passwd = {
|
2023-01-19 23:23:41 +00:00
|
|
|
sopsFile = ../../../secrets/moby.yaml;
|
2022-10-24 14:39:50 +00:00
|
|
|
neededForUsers = true;
|
|
|
|
};
|
|
|
|
|
2023-01-26 23:35:57 +00:00
|
|
|
sane.web-browser = {
|
|
|
|
# compromise impermanence for the sake of usability
|
|
|
|
persistCache = "private";
|
|
|
|
persistData = "private";
|
|
|
|
|
|
|
|
# i don't do crypto stuff on moby
|
|
|
|
addons.ether-metamask.enable = false;
|
|
|
|
# addons.sideberry.enable = false;
|
|
|
|
};
|
|
|
|
|
2023-01-30 10:35:03 +00:00
|
|
|
sane.user.persist.plaintext = [
|
2022-12-03 07:30:09 +00:00
|
|
|
".config/pulse" # persist pulseaudio volume
|
2022-08-04 21:05:24 +00:00
|
|
|
];
|
|
|
|
|
2023-02-06 22:41:32 +00:00
|
|
|
sane.gui.phosh.enable = true;
|
2023-03-01 10:14:48 +00:00
|
|
|
# sane.programs.consoleUtils.enableFor.user.colin = false;
|
|
|
|
# sane.programs.guiApps.enableFor.user.colin = false;
|
|
|
|
sane.programs.sequoia.enableFor.user.colin = false;
|
2023-03-28 19:03:53 +00:00
|
|
|
sane.programs.tuiApps.enableFor.user.colin = false; # visidata, others, don't compile well
|
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.
|
2022-12-21 06:33:50 +00:00
|
|
|
# even 10 can be too much
|
|
|
|
# TODO: compress moby kernels!
|
|
|
|
boot.loader.generic-extlinux-compatible.configurationLimit = 8;
|
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.
|
2023-01-23 07:42:51 +00:00
|
|
|
# the default CMA seems to be 32M.
|
|
|
|
# i was running fine with 256MB from 2022/07-ish through 2022/12-ish, but then the phone quit reliably coming back from sleep: maybe a memory leak?
|
2022-10-04 09:25:59 +00:00
|
|
|
# `cat /proc/meminfo` to see CmaTotal/CmaFree if interested in tuning this.
|
2023-01-26 23:41:22 +00:00
|
|
|
boot.kernelParams = [ "cma=512M" ];
|
2022-10-04 09:25:59 +00:00
|
|
|
|
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
|
|
|
}
|