From 8cc37836144c70b65113ad65e3288bbe0062f23e Mon Sep 17 00:00:00 2001 From: Dominik Polakovics Date: Sun, 24 Sep 2023 02:18:16 +0200 Subject: [PATCH] change phone --- hosts/phone/configuration.nix | 7 +++--- hosts/phone/modules/sway/default.nix | 35 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/hosts/phone/configuration.nix b/hosts/phone/configuration.nix index 36b4677..4dba1c8 100644 --- a/hosts/phone/configuration.nix +++ b/hosts/phone/configuration.nix @@ -38,9 +38,9 @@ zramSwap.enable = true; # Auto-login for phosh - services.xserver.desktopManager.phosh = { - user = "dominik"; - }; + # services.xserver.desktopManager.phosh = { + # user = "dominik"; + # }; # # User configuration @@ -59,6 +59,7 @@ ]; }; + # Auto-login and start sway services.getty.autologinUser = "dominik"; environment.loginShellInit = '' [[ "$(tty)" == /dev/tty1 ]] && sway diff --git a/hosts/phone/modules/sway/default.nix b/hosts/phone/modules/sway/default.nix index e5e8730..e57fd42 100644 --- a/hosts/phone/modules/sway/default.nix +++ b/hosts/phone/modules/sway/default.nix @@ -1,10 +1,37 @@ { pkgs, ... }: let + dbus-sway-environment = pkgs.writeTextFile { + name = "dbus-sway-environment"; + destination = "/bin/dbus-sway-environment"; + executable = true; + + text = '' + dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway + systemctl --user stop pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr + systemctl --user start pipewire pipewire-media-session xdg-desktop-portal xdg-desktop-portal-wlr + ''; + }; + + configure-gtk = pkgs.writeTextFile { + name = "configure-gtk"; + destination = "/bin/configure-gtk"; + executable = true; + text = let + schema = pkgs.gsettings-desktop-schemas; + datadir = "${schema}/share/gsettings-schemas/${schema.name}"; + in '' + export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS + gnome_schema=org.gnome.desktop.interface + gsettings set $gnome_schema gtk-theme 'Dracula' + ''; + }; in { environment.systemPackages = with pkgs; [ alsaUtils dracula-theme + dbus-sway-environment + configure-gtk firefox foot git @@ -32,6 +59,14 @@ in virtualisation.waydroid.enable = true; + services.dbus.enable = true; + xdg.portal = { + enable = true; + wlr.enable = true; + # gtk portal needed to make gtk apps happy + extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + }; + programs.sway = { enable = true; wrapperFeatures.gtk = true;