From d72190bee63469ed35f29fe1a64d3a7f1896c9fc Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sun, 19 Mar 2023 12:38:08 +0100 Subject: [PATCH] profiles/sway: init from legacy --- legacy/modules/location.nix | 26 ----------- legacy/modules/screen-sharing.nix | 25 ---------- legacy/modules/sway.nix | 54 ---------------------- legacy/modules/theme.nix | 17 ------- machines/thinkman/configuration.nix | 3 -- machines/thinkman/profiles.nix | 1 + profiles/default.nix | 1 + profiles/sway/default.nix | 72 +++++++++++++++++++++++++++++ profiles/sway/location.nix | 33 +++++++++++++ profiles/sway/screen-sharing.nix | 33 +++++++++++++ profiles/sway/theme.nix | 26 +++++++++++ 11 files changed, 166 insertions(+), 125 deletions(-) delete mode 100644 legacy/modules/location.nix delete mode 100644 legacy/modules/screen-sharing.nix delete mode 100644 legacy/modules/sway.nix delete mode 100644 legacy/modules/theme.nix create mode 100644 profiles/sway/default.nix create mode 100644 profiles/sway/location.nix create mode 100644 profiles/sway/screen-sharing.nix create mode 100644 profiles/sway/theme.nix diff --git a/legacy/modules/location.nix b/legacy/modules/location.nix deleted file mode 100644 index 974cb4d..0000000 --- a/legacy/modules/location.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - location.provider = "geoclue2"; - - services.geoclue2 = { - enable = true; - enableDemoAgent = true; - - appConfig."gammastep" = { - desktopID = "gammastep"; - isAllowed = true; - isSystem = false; - # Empty list allows all users - users = [ ]; - }; - appConfig."gammastep-indicator" = { - desktopID = "gammastep-indicator"; - isAllowed = true; - isSystem = false; - # Empty list allows all users - users = [ ]; - }; - - }; -} diff --git a/legacy/modules/screen-sharing.nix b/legacy/modules/screen-sharing.nix deleted file mode 100644 index 5d5ecf6..0000000 --- a/legacy/modules/screen-sharing.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - environment.systemPackages = with pkgs; [ - remmina - teamviewer - ]; - - services.pipewire.enable = true; - - xdg.portal = { - enable = true; - extraPortals = with pkgs; [ - xdg-desktop-portal-gtk - xdg-desktop-portal-wlr - ]; - }; - - # for firefox - environment.sessionVariables = { - MOZ_ENABLE_WAYLAND = "1"; - XDG_CURRENT_DESKTOP = "sway"; - XDG_SESSION_TYPE = "wayland"; - GTK_USE_PORTAL = "1"; - }; -} diff --git a/legacy/modules/sway.nix b/legacy/modules/sway.nix deleted file mode 100644 index 5d18efb..0000000 --- a/legacy/modules/sway.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - imports = [ - ../modules/theme.nix - ]; - - programs.light.enable = true; - - environment.systemPackages = with pkgs; [ - polkit_gnome - ]; - environment.pathsToLink = [ "/libexec" ]; - programs.wshowkeys.enable = true; - - programs.sway = { - enable = true; - wrapperFeatures = { - gtk = true; - base = true; - }; - - extraPackages = with pkgs; [ - brightnessctl - dmenu - foot - gammastep - grim - i3status-rust - mako - slurp - swayidle - swaylock - wdisplays - wf-recorder - wl-clipboard - wofi - xwayland - wshowkeys - ]; - - extraSessionCommands = '' - export XDG_SESSION_TYPE=wayland - export XDG_CURRENT_DESKTOP=sway - export SDL_VIDEODRIVER=wayland - export QT_QPA_PLATFORM=wayland - export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" - export _JAVA_AWT_WM_NONREPARENTING=1 - export CLUTTER_BACKEND=wayland - export SAL_USE_VCLPLUGIN=gtk3 - export MOZ_ENABLE_WAYLAND=1 - export MOZ_USE_XINPUT2=1 - ''; - }; -} diff --git a/legacy/modules/theme.nix b/legacy/modules/theme.nix deleted file mode 100644 index 91bdca0..0000000 --- a/legacy/modules/theme.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ config, lib, pkgs, ... }: -{ - environment.systemPackages = with pkgs; [ - gtk-engine-murrine - gtk_engines - gsettings-desktop-schemas - lxappearance - qgnomeplatform - numix-cursor-theme - numix-icon-theme - numix-icon-theme-circle - adwaita-qt - arc-kde-theme - arc-theme - ]; - qt5.platformTheme = "qt5ct"; -} diff --git a/machines/thinkman/configuration.nix b/machines/thinkman/configuration.nix index 71ba04a..ab843d2 100644 --- a/machines/thinkman/configuration.nix +++ b/machines/thinkman/configuration.nix @@ -14,11 +14,8 @@ ../../legacy/modules/gaming.nix ../../legacy/modules/hardware-base.nix ../../legacy/modules/intel-video.nix - ../../legacy/modules/location.nix ../../legacy/modules/media.nix ../../legacy/modules/meeting.nix - ../../legacy/modules/screen-sharing.nix - ../../legacy/modules/sway.nix ../../legacy/modules/systemd-user.nix ../../legacy/modules/systemduefi.nix ../../legacy/modules/webcam.nix diff --git a/machines/thinkman/profiles.nix b/machines/thinkman/profiles.nix index fe31b21..8e3f7c5 100644 --- a/machines/thinkman/profiles.nix +++ b/machines/thinkman/profiles.nix @@ -11,6 +11,7 @@ in latex.enable = true; powersave.enable = true; printing.enable = true; + sway.enable = true; sync.enable = true; }; } diff --git a/profiles/default.nix b/profiles/default.nix index 6c9b7b9..9473611 100644 --- a/profiles/default.nix +++ b/profiles/default.nix @@ -8,6 +8,7 @@ ./latex ./powersave ./printing + ./sway ./sync ]; } diff --git a/profiles/sway/default.nix b/profiles/sway/default.nix new file mode 100644 index 0000000..799ad11 --- /dev/null +++ b/profiles/sway/default.nix @@ -0,0 +1,72 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.my.profiles.sway; +in +{ + imports = [ + ./location.nix + ./screen-sharing.nix + ./theme.nix + ]; + + options.my.profiles.sway = with lib; { + enable = mkEnableOption "sway profile"; + }; + + config = lib.mkIf cfg.enable { + + my.profiles = { + sway-location.enable = true; + sway-screen-sharing.enable = true; + sway-theme.enable = true; + }; + + environment.systemPackages = with pkgs; [ + polkit_gnome + ]; + environment.pathsToLink = [ "/libexec" ]; + + programs.wshowkeys.enable = true; + programs.light.enable = true; + + programs.sway = { + enable = true; + wrapperFeatures = { + gtk = true; + base = true; + }; + + extraPackages = with pkgs; [ + brightnessctl + dmenu + foot + gammastep + grim + i3status-rust + mako + slurp + swayidle + swaylock + wdisplays + wf-recorder + wl-clipboard + wofi + xwayland + # wshowkeys + ]; + + extraSessionCommands = '' + export XDG_SESSION_TYPE=wayland + export XDG_CURRENT_DESKTOP=sway + export SDL_VIDEODRIVER=wayland + export QT_QPA_PLATFORM=wayland + export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" + export _JAVA_AWT_WM_NONREPARENTING=1 + export CLUTTER_BACKEND=wayland + export SAL_USE_VCLPLUGIN=gtk3 + export MOZ_ENABLE_WAYLAND=1 + export MOZ_USE_XINPUT2=1 + ''; + }; + }; +} diff --git a/profiles/sway/location.nix b/profiles/sway/location.nix new file mode 100644 index 0000000..bea5d1b --- /dev/null +++ b/profiles/sway/location.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.my.profiles.sway-location; +in +{ + options.my.profiles.sway-location = with lib; { + enable = mkEnableOption "sway-location profile"; + }; + + config = lib.mkIf cfg.enable { + location.provider = "geoclue2"; + + services.geoclue2 = { + enable = true; + enableDemoAgent = true; + + appConfig."gammastep" = { + desktopID = "gammastep"; + isAllowed = true; + isSystem = false; + # Empty list allows all users + users = [ ]; + }; + appConfig."gammastep-indicator" = { + desktopID = "gammastep-indicator"; + isAllowed = true; + isSystem = false; + # Empty list allows all users + users = [ ]; + }; + }; + }; +} diff --git a/profiles/sway/screen-sharing.nix b/profiles/sway/screen-sharing.nix new file mode 100644 index 0000000..3bbf618 --- /dev/null +++ b/profiles/sway/screen-sharing.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.my.profiles.sway-screen-sharing; +in +{ + options.my.profiles.sway-screen-sharing = with lib; { + enable = mkEnableOption "sway-screen-sharing profile"; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + remmina + ]; + + services.pipewire.enable = true; + + xdg.portal = { + enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-gtk + xdg-desktop-portal-wlr + ]; + }; + + # for firefox + environment.sessionVariables = { + MOZ_ENABLE_WAYLAND = "1"; + XDG_CURRENT_DESKTOP = "sway"; + XDG_SESSION_TYPE = "wayland"; + GTK_USE_PORTAL = "1"; + }; + }; +} diff --git a/profiles/sway/theme.nix b/profiles/sway/theme.nix new file mode 100644 index 0000000..07095d2 --- /dev/null +++ b/profiles/sway/theme.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.my.profiles.sway-theme; +in +{ + options.my.profiles.sway-theme = with lib; { + enable = mkEnableOption "sway-theme profile"; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + gtk-engine-murrine + gtk_engines + gsettings-desktop-schemas + lxappearance + qgnomeplatform + numix-cursor-theme + numix-icon-theme + numix-icon-theme-circle + adwaita-qt + arc-kde-theme + arc-theme + ]; + qt5.platformTheme = "qt5ct"; + }; +}