-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfiguration-pinephonepro.nix
171 lines (134 loc) · 4.83 KB
/
configuration-pinephonepro.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
defaultUserName:
{ config, lib, pkgs, ... }:
let
hostName = "pinephonepro";
terminal = pkgs.kgx.override { genericBranding = true; };
in
{
imports = [
];
config = {
# numeric password is currently required to unlock a session
# with the plasma mobile shell
users.users.${defaultUserName} = {
isNormalUser = true;
# TODO change me!
hashedPassword = "$6$zActsdzv754qmpNR$TVgNLHx4/0Q3GIqirequckS252LvYFomx11IimP8uuk.soV8CQFIUDcjhhF7lHz5BurJZJLj/QlGOHZTYAX8R1";
home = "/home/${defaultUserName}";
createHome = true;
extraGroups = [
"wheel"
"networkmanager"
"video"
"feedbackd"
"dialout" # required for modem access
];
uid = 1000;
openssh.authorizedKeys.keys = [
# TODO add keys
];
};
# TODO change me!
users.users.root.hashedPassword = "$6$Jv0Cl55I5TN$BAwcCxOv7Yvy3z369jwFU7/x.TfUOCEvM6FVxsQOPWJEFgKYhZvsgDmvF3gb8dgOAntHvYHR8QF0obpezLx3v1";
# "desktop" environment configuration
powerManagement.enable = true;
hardware.opengl.enable = true;
systemd.defaultUnit = "graphical.target";
systemd.services.phosh = {
wantedBy = [ "graphical.target" ];
serviceConfig = {
ExecStart = "${pkgs.phosh}/bin/phosh";
User = 1000;
PAMName = "login";
WorkingDirectory = "~";
TTYPath = "/dev/tty7";
TTYReset = "yes";
TTYVHangup = "yes";
TTYVTDisallocate = "yes";
StandardInput = "tty-fail";
StandardOutput = "journal";
StandardError = "journal";
UtmpIdentifier = "tty7";
UtmpMode = "user";
Restart = "always";
};
};
services.xserver.desktopManager.gnome.enable = true;
# unpatched gnome-initial-setup is partially broken in small screens
services.gnome.gnome-initial-setup.enable = false;
programs.phosh.enable = true;
environment.gnome.excludePackages = with pkgs.gnome3; [
gnome-terminal
];
environment.systemPackages = with pkgs; [
git
pipes
terminal
wget
];
environment.etc."machine-info".text = lib.mkDefault ''
CHASSIS="handset"
'';
##########################################################################
## networking, modem and misc.
##########################################################################
networking = {
inherit hostName;
wireless.enable = false;
networkmanager.enable = true;
# FIXME : configure usb rndis through networkmanager in the future.
# Currently this relies on stage-1 having configured it.
networkmanager.unmanaged = [ "rndis0" "usb0" ];
};
# Setup USB gadget networking in initrd...
mobile.boot.stage-1.networking.enable = lib.mkDefault true;
# Bluetooth
hardware.bluetooth.enable = true;
##########################################################################
## SSH
##########################################################################
services.openssh = {
enable = true;
passwordAuthentication = false;
permitRootLogin = "no";
allowSFTP = false;
};
programs.mosh.enable = true;
# Don't start it in stage-1 though.
# (Currently doesn't quit on switch root)
# mobile.boot.stage-1.ssh.enable = true;
##########################################################################
# default quirks
##########################################################################
# Ensures this demo rootfs is useable for platforms requiring FBIOPAN_DISPLAY.
mobile.quirks.fb-refresher.enable = true;
# Okay, systemd-udev-settle times out... no idea why yet...
# Though, it seems fine to simply disable it.
# FIXME : figure out why systemd-udev-settle doesn't work.
systemd.services.systemd-udev-settle.enable = false;
# Force userdata for the target partition. It is assumed it will not
# fit in the `system` partition.
mobile.system.android.system_partition_destination = "userdata";
##########################################################################
## misc "system"
##########################################################################
# No mutable users. This requires us to set passwords with hashedPassword.
users.mutableUsers = false;
nix = {
gc = {
automatic = true;
options = "--delete-older-than 8d";
};
# nix flakes
package = pkgs.nixUnstable;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "21.11"; # Did you read the comment?
};
}