nixphone stuff
This commit is contained in:
parent
0348ef1e6a
commit
f0fca1bad4
11 changed files with 433 additions and 236 deletions
|
|
@ -14,6 +14,8 @@ in
|
|||
flake = "/home/quadradical/.config/nixos";
|
||||
};
|
||||
|
||||
system.tools.nixos-rebuild.enable = false;
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "server" ''
|
||||
${lib.concatMapAttrsStringSep "\n" (
|
||||
|
|
|
|||
15
modules/desktop/phone-usb.nix
Normal file
15
modules/desktop/phone-usb.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
networking.networkmanager.ensureProfiles.profiles.phone-usb = {
|
||||
connection = {
|
||||
id = "Phone (USB)";
|
||||
type = "ethernet";
|
||||
};
|
||||
ethernet.mac-address = "02:00:00:00:42:02";
|
||||
ipv4 = {
|
||||
method = "manual";
|
||||
address1 = "172.16.42.2/24";
|
||||
never-default = true;
|
||||
};
|
||||
ipv6.method = "disabled";
|
||||
};
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
[burn-my-windows-profile]
|
||||
fire-enable-effect=false
|
||||
apparition-enable-effect=false
|
||||
broken-glass-enable-effect=false
|
||||
energize-a-enable-effect=false
|
||||
energize-b-enable-effect=false
|
||||
glide-enable-effect=true
|
||||
|
|
@ -1,23 +1,47 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
services = {
|
||||
desktopManager.gnome.enable = true;
|
||||
displayManager.gdm.enable = true;
|
||||
|
||||
gnome = {
|
||||
core-os-services.enable = true;
|
||||
core-apps.enable = true;
|
||||
};
|
||||
|
||||
gvfs.enable = true;
|
||||
};
|
||||
|
||||
environment.sessionVariables.NAUTILUS_4_EXTENSION_DIR = lib.mkForce "${config.system.path}/lib/nautilus/extensions-4";
|
||||
|
||||
environment.gnome.excludePackages = with pkgs; [
|
||||
yelp
|
||||
orca
|
||||
totem
|
||||
xterm
|
||||
evince
|
||||
decibels
|
||||
epiphany
|
||||
gnome-logs
|
||||
gnome-tour
|
||||
gnome-music
|
||||
simple-scan
|
||||
gnome-console
|
||||
gnome-software
|
||||
gnome-user-docs
|
||||
gnome-characters
|
||||
gnome-font-viewer
|
||||
gnome-connections
|
||||
gnome-text-editor
|
||||
gnome-system-monitor
|
||||
];
|
||||
|
||||
users.users.quadradical.maid.gsettings.settings.org.gnome = {
|
||||
desktop = {
|
||||
wm.preferences.focus-mode = "mouse";
|
||||
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;
|
||||
};
|
||||
|
||||
interface = rec {
|
||||
color-scheme = "prefer-dark";
|
||||
|
||||
|
|
@ -30,30 +54,12 @@
|
|||
font-name = "sans 11";
|
||||
document-font-name = font-name;
|
||||
monospace-font-name = "monospace";
|
||||
|
||||
show-battery-percentage = true;
|
||||
};
|
||||
|
||||
lockdown = {
|
||||
disable-printing = true;
|
||||
disable-print-setup = true;
|
||||
user-administration-disabled = true;
|
||||
};
|
||||
|
||||
peripherals.touchpad.disable-while-typing = false;
|
||||
};
|
||||
|
||||
shell = {
|
||||
remember-mount-password = true;
|
||||
favorite-apps = [
|
||||
"librewolf.desktop"
|
||||
"org.gnome.Geary.desktop"
|
||||
"org.gnome.Nautilus.desktop"
|
||||
];
|
||||
};
|
||||
|
||||
mutter.edge-tiling = false;
|
||||
system.location.enabled = true;
|
||||
settings-daemon.plugins.media-keys.calculator-static = [ ];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,120 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
environment = {
|
||||
systemPackages = with pkgs.gnomeExtensions; [
|
||||
pop-shell
|
||||
appindicator
|
||||
blur-my-shell
|
||||
just-perfection
|
||||
burn-my-windows
|
||||
launch-new-instance
|
||||
compiz-windows-effect
|
||||
rounded-window-corners-reborn
|
||||
brightness-control-using-ddcutil
|
||||
];
|
||||
|
||||
gnome.excludePackages = with pkgs; [
|
||||
yelp
|
||||
orca
|
||||
totem
|
||||
xterm
|
||||
evince
|
||||
decibels
|
||||
epiphany
|
||||
gnome-logs
|
||||
gnome-tour
|
||||
gnome-music
|
||||
simple-scan
|
||||
gnome-console
|
||||
gnome-software
|
||||
gnome-user-docs
|
||||
gnome-characters
|
||||
gnome-font-viewer
|
||||
gnome-connections
|
||||
gnome-text-editor
|
||||
gnome-system-monitor
|
||||
];
|
||||
};
|
||||
|
||||
users.users.quadradical.maid.gsettings.settings.org.gnome.shell = {
|
||||
disable-user-extensions = false;
|
||||
allow-extension-installation = false;
|
||||
enabled-extensions = [
|
||||
"blur-my-shell@aunetx"
|
||||
"pop-shell@system76.com"
|
||||
"rounded-window-corners@fxgn"
|
||||
"burn-my-windows@schneegans.github.com"
|
||||
"fullscreen-avoider@noobsai.github.com"
|
||||
"appindicatorsupport@rgcjonas.gmail.com"
|
||||
"compiz-windows-effect@hermes83.github.com"
|
||||
"display-brightness-ddcutil@themightydeity.github.com"
|
||||
"launch-new-instance@gnome-shell-extensions.gcampax.github.com"
|
||||
];
|
||||
disabled-extensions = [
|
||||
"just-perfection-desktop@just-perfection"
|
||||
];
|
||||
|
||||
extensions = {
|
||||
rounded-window-corners-reborn = {
|
||||
border-width = -5;
|
||||
skip-libadwaita-app = false;
|
||||
skip-libhandy-app = false;
|
||||
};
|
||||
|
||||
pop-shell = rec {
|
||||
active-hint = true;
|
||||
tile-by-default = true;
|
||||
active-hint-border-radius = 16;
|
||||
gap-inner = 3;
|
||||
gap-outer = gap-inner;
|
||||
};
|
||||
|
||||
just-perfection = {
|
||||
accessibility-menu = false;
|
||||
activities-button = true;
|
||||
calendar = true;
|
||||
clock-menu = true;
|
||||
clock-menu-position = 0;
|
||||
dash = false;
|
||||
dash-app-running = false;
|
||||
dash-separator = false;
|
||||
events-button = false;
|
||||
keyboard-layout = false;
|
||||
panel-size = 0;
|
||||
power-icon = true;
|
||||
quick-settings = true;
|
||||
quick-settings-dark-mode = false;
|
||||
show-apps-button = false;
|
||||
startup-status = 0;
|
||||
window-menu-take-screenshot-button = false;
|
||||
window-picker-icon = true;
|
||||
workspace = true;
|
||||
workspace-switcher-size = 0;
|
||||
world-clock = false;
|
||||
};
|
||||
|
||||
display-brightness-ddcutil = {
|
||||
allow-zero-brightness = true;
|
||||
button-location = 1;
|
||||
ddcutil-binary-path = lib.meta.getExe pkgs.ddcutil;
|
||||
decrease-brightness-shortcut = [ "XF86MonBrightnessDown" ];
|
||||
increase-brightness-shortcut = [ "XF86MonBrightnessUp" ];
|
||||
hide-system-indicator = true;
|
||||
only-all-slider = true;
|
||||
position-system-menu = 3.0;
|
||||
show-internal-slider = false;
|
||||
show-all-slider = true;
|
||||
show-display-name = false;
|
||||
show-osd = true;
|
||||
show-value-label = false;
|
||||
step-change-keyboard = 2.0;
|
||||
};
|
||||
|
||||
burn-my-windows.active-profile = toString ./burn-my-windows.conf;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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