profiles/sway: init from legacy

This commit is contained in:
Felix Buehler 2023-03-19 12:38:08 +01:00
parent 97afc505cb
commit d72190bee6
11 changed files with 166 additions and 125 deletions

72
profiles/sway/default.nix Normal file
View file

@ -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
'';
};
};
}

View file

@ -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 = [ ];
};
};
};
}

View file

@ -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";
};
};
}

26
profiles/sway/theme.nix Normal file
View file

@ -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";
};
}