nixphone stuff
This commit is contained in:
parent
0348ef1e6a
commit
f0fca1bad4
6 changed files with 433 additions and 236 deletions
|
|
@ -1 +1 @@
|
|||
{ documentation.man.generateCaches = false; }
|
||||
{ documentation.man.cache.enable = false; }
|
||||
|
|
|
|||
56
modules/mobile/gnome-mobile.nix
Normal file
56
modules/mobile/gnome-mobile.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# GNOME Shell mobile. GDM and the GNOME services/apps are in modules/graphical/gnome.
|
||||
{ inputs, pkgs, ... }:
|
||||
{
|
||||
nixpkgs.overlays = [ inputs.gnome-mobile.overlays.default ];
|
||||
|
||||
services = {
|
||||
desktopManager.gnome = {
|
||||
enable = true;
|
||||
|
||||
# One app per workspace
|
||||
extraGSettingsOverrides = ''
|
||||
[org.gnome.mutter]
|
||||
dynamic-workspaces=true
|
||||
'';
|
||||
extraGSettingsOverridePackages = [ pkgs.mutter ];
|
||||
};
|
||||
|
||||
logind.settings.Login = {
|
||||
HandlePowerKey = "ignore";
|
||||
HandlePowerKeyLongPress = "poweroff";
|
||||
};
|
||||
};
|
||||
|
||||
# GNOME talks to IBus over D-Bus, with these set the on-screen keyboard won't show up.
|
||||
environment.extraInit = ''
|
||||
unset GTK_IM_MODULE QT_IM_MODULE XMODIFIERS
|
||||
'';
|
||||
|
||||
users.users.quadradical.maid.gsettings.settings.org.gnome = {
|
||||
desktop = {
|
||||
search-providers.sort-order = [
|
||||
"org.gnome.Contacts.desktop"
|
||||
"org.gnome.Documents.desktop"
|
||||
"org.gnome.Nautilus.desktop"
|
||||
];
|
||||
|
||||
background = rec {
|
||||
picture-uri = "file://${../../background.jpg}";
|
||||
picture-uri-dark = picture-uri;
|
||||
};
|
||||
|
||||
lockdown.user-administration-disabled = true;
|
||||
};
|
||||
|
||||
system.location.enabled = true;
|
||||
|
||||
shell = {
|
||||
remember-mount-password = true;
|
||||
favorite-apps = [
|
||||
"librewolf.desktop"
|
||||
"org.gnome.Geary.desktop"
|
||||
"org.gnome.Nautilus.desktop"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
21
modules/mobile/phone.nix
Normal file
21
modules/mobile/phone.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs = {
|
||||
feedbackd.enable = true;
|
||||
calls.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
chatty
|
||||
];
|
||||
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
"olm-3.2.16"
|
||||
];
|
||||
|
||||
networking.modemmanager.enable = true;
|
||||
|
||||
services.geoclue2.enable = true;
|
||||
users.users.geoclue.extraGroups = [ "networkmanager" ];
|
||||
location.provider = "geoclue2";
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs = {
|
||||
feedbackd.enable = true;
|
||||
calls.enable = true;
|
||||
firefox.package = pkgs.firefox-mobile;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
chatty
|
||||
];
|
||||
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
"olm-3.2.16"
|
||||
];
|
||||
|
||||
networking.modemmanager.enable = true;
|
||||
|
||||
services = {
|
||||
geoclue2 = {
|
||||
enable = true;
|
||||
whitelistedAgents = [ "sm.puri.Phosh" ];
|
||||
appConfig."sm.puri.Phosh" = {
|
||||
isAllowed = true;
|
||||
isSystem = true;
|
||||
};
|
||||
};
|
||||
|
||||
xserver.desktopManager.phosh = {
|
||||
enable = true;
|
||||
group = "users";
|
||||
user = "quadradical";
|
||||
};
|
||||
};
|
||||
|
||||
users.users.geoclue.extraGroups = [ "networkmanager" ];
|
||||
location.provider = "geoclue2";
|
||||
}
|
||||
12
modules/mobile/ssh.nix
Normal file
12
modules/mobile/ssh.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
users.users.quadradical.openssh.authorizedKeys.keys = import ../../secrets/keys.nix;
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
PasswordAuthentication = false;
|
||||
AllowUsers = [ "quadradical" ];
|
||||
PermitRootLogin = "no";
|
||||
};
|
||||
};
|
||||
}
|
||||
34
modules/mobile/usb-network.nix
Normal file
34
modules/mobile/usb-network.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
imports = [ "${inputs.gadgetfs}/usb-gadget.nix" ];
|
||||
|
||||
hardware.usb-gadget = {
|
||||
enable = true;
|
||||
gadgets.g = {
|
||||
default = true;
|
||||
product = "quadphone";
|
||||
functions.ecm.usb0 = {
|
||||
deviceAddress = "02:00:00:00:42:01";
|
||||
hostAddress = "02:00:00:00:42:02";
|
||||
};
|
||||
configs.def = {
|
||||
id = 1;
|
||||
functions = [ "ecm.usb0" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
networking.networkmanager.ensureProfiles.profiles.usb-network = {
|
||||
connection = {
|
||||
id = "USB network";
|
||||
type = "ethernet";
|
||||
interface-name = "usb0";
|
||||
};
|
||||
ipv4 = {
|
||||
method = "manual";
|
||||
address1 = "172.16.42.1/24";
|
||||
never-default = true;
|
||||
};
|
||||
ipv6.method = "disabled";
|
||||
};
|
||||
}
|
||||
Loading…
Reference in a new issue