Refactorings and cleanups
This commit is contained in:
parent
9ed4b18e1d
commit
abe0ef7ad8
10 changed files with 28 additions and 141 deletions
|
@ -1,7 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
#home-manager.users.fhauser = {
|
||||
# home.packages = with pkgs; [ androidStudioPackages.beta ];
|
||||
# pam.sessionVariables.STUDIO_JDK = "${pkgs.jdk14}/lib/openjdk";
|
||||
#}; # TODO: This was extracted into a shell.nix
|
||||
{ pkgs, ... }: {
|
||||
programs.adb.enable = true;
|
||||
users.users.fhauser.extraGroups = [ "adbusers" ];
|
||||
}
|
||||
|
|
|
@ -19,8 +19,21 @@
|
|||
./shell.nix
|
||||
./swaylock.nix
|
||||
./kanshi.nix
|
||||
./sway.nix
|
||||
./android-studio.nix
|
||||
];
|
||||
home-manager.users.fhauser = { config, pkgs, ... }: {
|
||||
services = {
|
||||
network-manager-applet.enable = true;
|
||||
nextcloud-client = {
|
||||
enable = true;
|
||||
startInBackground = true;
|
||||
};
|
||||
owncloud-client.enable = true;
|
||||
pasystray.enable = true;
|
||||
blueman-applet.enable = true;
|
||||
};
|
||||
|
||||
home = {
|
||||
packages = with pkgs;
|
||||
[ # Networking
|
||||
|
|
171
defaults/user-configuration/fhauser/applications/sway.nix
Normal file
171
defaults/user-configuration/fhauser/applications/sway.nix
Normal file
|
@ -0,0 +1,171 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
|
||||
# environment.systemPackages = with pkgs; [ polkit_gnome ]; #TODO: Needed?
|
||||
programs.sway.enable = true;
|
||||
xdg.portal.wlr.enable = true;
|
||||
|
||||
services.gnome.gnome-remote-desktop.enable = true;
|
||||
#environment.systemPackages = with pkgs; [ pipewire ];
|
||||
#systemd.user.services.pipewire.environment.XDG_CURRENT_DESKTOP = "sway";
|
||||
#systemd.user.services.xdg-desktop-portal-wlr.environment.XDG_CURRENT_DESKTOP =
|
||||
# "sway";
|
||||
# systemd.user.services.xdg-desktop-portal-wlr.script = "${pkgs.xdg-desktop-portal-wlr}/libexec/xdg-desktop-portal-wlr";
|
||||
# systemd.user.services.xdg-desktop-portal-wlr.scriptArgs = "--output=DP-1"; # TODO: Extract this *****
|
||||
home-manager.users.fhauser = let
|
||||
adhereTheSwayTarget = {
|
||||
Install.WantedBy = lib.mkForce [ "sway-session.target" ];
|
||||
Unit.PartOf = lib.mkForce [ "sway-session.target" ];
|
||||
};
|
||||
# TODO: active screen with -m $active_screen
|
||||
bemenuLauncher = pkgs.writeScriptBin "bemenuLauncher" ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
#active_screen=$(swaymsg -r -t get_outputs | \
|
||||
# ${pkgs.jq}/bin/jq '. [] | select (.focused == true) | .name | split ("-") | last')
|
||||
${pkgs.dmenu}/bin/dmenu_path | \
|
||||
${pkgs.bemenu}/bin/bemenu --list 20 --ignorecase --prompt 'Start: ' | \
|
||||
xargs swaymsg exec --
|
||||
'';
|
||||
homeManagerConfig = config.home-manager.users.fhauser;
|
||||
in rec {
|
||||
home.packages = with pkgs; [
|
||||
sway-contrib.grimshot
|
||||
wl-clipboard
|
||||
libappindicator
|
||||
gnome.defaultIconTheme
|
||||
gnome2.gnome-icon-theme
|
||||
hicolor-icon-theme # TODO: Move these requirements?
|
||||
];
|
||||
|
||||
xsession.preferStatusNotifierItems = true;
|
||||
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
systemdIntegration = true;
|
||||
xwayland = true;
|
||||
wrapperFeatures = { gtk = true; };
|
||||
extraSessionCommands = ''
|
||||
#export XDG_CURRENT_DESKTOP=Unity
|
||||
export XDG_CURRENT_DESKTOP=sway
|
||||
export XDG_SESSION_TYPE="wayland"
|
||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||
export SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh # TODO: Migrate
|
||||
export QT_QPA_PLATFORM=wayland
|
||||
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
|
||||
# TODO: QTpie
|
||||
export WLR_DRM_NO_MODIFIERS=1
|
||||
export WLR_NO_HARDWARE_CURSORS=1
|
||||
'';
|
||||
config = {
|
||||
input = {
|
||||
"type:keyboard" = {
|
||||
xkb_layout = "ch,de";
|
||||
xkb_options = "eurosign:e";
|
||||
};
|
||||
"*" = { xkb_numlock = "enable"; };
|
||||
};
|
||||
terminal = "${pkgs.alacritty}/bin/alacritty";
|
||||
menu = "${bemenuLauncher}/bin/bemenuLauncher";
|
||||
gaps.inner = 8;
|
||||
modifier = "Mod4";
|
||||
window.border = 0;
|
||||
#colors.focused.border = "#323232";
|
||||
|
||||
#TODO: Workspace Programm assignment: Not working properly
|
||||
assigns = {
|
||||
"10" = [{ app_id = "^firefox$"; }];
|
||||
"11" = [{ app_id = "^(claws-mail|thunderbird|evolution)$"; }];
|
||||
"12" = [{
|
||||
class = "^Chromium-browser$";
|
||||
instance = "^web.threema.ch";
|
||||
}];
|
||||
"13" = [{ class = "^Spotify$"; }];
|
||||
};
|
||||
|
||||
keybindings = let
|
||||
mod = wayland.windowManager.sway.config.modifier;
|
||||
playerctl = "${pkgs.playerctl}/bin/playerctl";
|
||||
pamixer = "${pkgs.pamixer}/bin/pamixer";
|
||||
light = "${pkgs.light}/bin/light";
|
||||
in lib.mkOptionDefault {
|
||||
"${mod}+p" = "exec passbemenu";
|
||||
"${mod}+x" = "move workspace to output right";
|
||||
"${mod}+y" = "move workspace to output left";
|
||||
|
||||
"${mod}+section" = "workspace 0";
|
||||
"${mod}+0" = "workspace 10";
|
||||
"${mod}+apostrophe" = "workspace 11";
|
||||
"${mod}+dead_circumflex" = "workspace 12";
|
||||
"${mod}+dead_diaeresis" = "workspace 13";
|
||||
"${mod}+dollar" = "workspace 14";
|
||||
|
||||
"${mod}+Shift+section" = "move container to workspace 0";
|
||||
"${mod}+Shift+0" = "move container to workspace 10";
|
||||
"${mod}+Shift+apostrophe" = "move container to workspace 11";
|
||||
"${mod}+Shift+dead_circumflex" = "move container to workspace 12";
|
||||
"${mod}+Shift+dead_diaeresis" = "move container to workspace 13";
|
||||
"${mod}+Shift+dollar" = "move container to workspace 14";
|
||||
|
||||
"Ctrl+mod1+l" = "exec ${pkgs.systemd}/bin/loginctl lock-session";
|
||||
"Ctrl+mod1+Shift+L" = "exec ${pkgs.systemd}/bin/systemctl suspend";
|
||||
|
||||
# pulse audio volume control
|
||||
XF86AudioLowerVolume = "exec ${pamixer} --decrease 3";
|
||||
XF86AudioRaiseVolume = "exec ${pamixer} --increase 3";
|
||||
XF86AudioMute = "exec ${pamixer} --toggle-mute";
|
||||
XF86AudioMicMute = "exec ${pamixer} --default-source --toggle-mute";
|
||||
|
||||
# Spotify control
|
||||
XF86AudioPause = "exec ${playerctl} play-pause";
|
||||
XF86AudioPlay = "exec ${playerctl} play-pause";
|
||||
XF86AudioNext = "exec ${playerctl} next";
|
||||
XF86AudioPrev = "exec ${playerctl} previous";
|
||||
|
||||
# screen brightness
|
||||
XF86MonBrightnessUp = "exec ${light} -A 10";
|
||||
XF86MonBrightnessDown = "exec ${light} -U 5";
|
||||
|
||||
# screenshot
|
||||
Print = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";
|
||||
};
|
||||
};
|
||||
extraConfig = ''
|
||||
# Disable the laptop screen when the lid is closed.
|
||||
bindswitch --reload lid:on output eDP-1 disable
|
||||
bindswitch --reload lid:off output eDP-1 enable
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.user.services.network-manager-applet = adhereTheSwayTarget;
|
||||
systemd.user.services.nextcloud-client = adhereTheSwayTarget // {
|
||||
# For trayicon to work:
|
||||
Unit.After = [ "waybar.service" ];
|
||||
Service = {
|
||||
ExecStartPre = "${pkgs.coreutils}/bin/sleep 3";
|
||||
Environment = lib.mkForce
|
||||
"PATH=${homeManagerConfig.home.profileDirectory}/bin XDG_CURRENT_DESKTOP=Unity";
|
||||
};
|
||||
};
|
||||
systemd.user.services.owncloud-client = adhereTheSwayTarget // {
|
||||
# For trayicon to work:
|
||||
Unit.After = [ "waybar.service" ];
|
||||
Service = {
|
||||
ExecStartPre = "${pkgs.coreutils}/bin/sleep 3";
|
||||
Environment = lib.mkForce
|
||||
"PATH=${homeManagerConfig.home.profileDirectory}/bin XDG_CURRENT_DESKTOP=Unity";
|
||||
};
|
||||
};
|
||||
systemd.user.services.pasystray = adhereTheSwayTarget;
|
||||
|
||||
gtk = {
|
||||
iconTheme = {
|
||||
# package = pkgs.gnome-icon-theme;
|
||||
# name = "gnome";
|
||||
package = pkgs.hicolor_icon_theme;
|
||||
name = "hicolor";
|
||||
};
|
||||
gtk3.extraConfig.gtk-menu-images = true;
|
||||
};
|
||||
|
||||
dconf.settings = { "org/gnome/desktop/interface".menus-have-icons = true; };
|
||||
};
|
||||
}
|
|
@ -374,9 +374,13 @@
|
|||
}
|
||||
'';
|
||||
};
|
||||
systemd.user.services.waybar.Unit = {
|
||||
Requisite = lib.mkForce [ ];
|
||||
After = lib.mkForce [ ];
|
||||
systemd.user.services.waybar = with lib; {
|
||||
# Install.WantedBy = mkForce [ "sway-session.target" ]; # TODO: Set as systemd.target with 22.05
|
||||
Unit = {
|
||||
Requisite = mkForce [ ];
|
||||
After = mkForce [ ];
|
||||
PartOf = [ "tray.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue