refactor *started*
This commit is contained in:
parent
d0413cb830
commit
db2103a37d
103 changed files with 1008 additions and 786 deletions
13
home/desktop/default.nix
Normal file
13
home/desktop/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./window-managers
|
||||
./shell
|
||||
];
|
||||
}
|
||||
13
home/desktop/shell/default.nix
Normal file
13
home/desktop/shell/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./noctalia.nix
|
||||
./walker.nix
|
||||
];
|
||||
}
|
||||
19
home/desktop/shell/noctalia.nix
Normal file
19
home/desktop/shell/noctalia.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
config = lib.mkIf osConfig.desktop.shell.noctalia.enable {
|
||||
};
|
||||
|
||||
imports = lib.mkIf osConfig.desktop.shell.noctalia.enable [
|
||||
inputs.noctalia.homeModules.default
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
26
home/desktop/shell/walker.nix
Normal file
26
home/desktop/shell/walker.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
inputs,
|
||||
lib,
|
||||
osConfig,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
config = lib.mkIf osConfig.desktop.shell.walker.enable {
|
||||
programs = {
|
||||
walker = {
|
||||
enable = true;
|
||||
runAsService = true;
|
||||
config = {
|
||||
theme = "noctalia";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
imports = lib.mkIf osConfig.desktop.shell.walker.enable [
|
||||
inputs.walker.homeManagerModules.default
|
||||
]
|
||||
}
|
||||
14
home/desktop/window-managers/default.nix
Normal file
14
home/desktop/window-managers/default.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hyprland.nix
|
||||
./niri.nix
|
||||
./sway.nix
|
||||
];
|
||||
}
|
||||
181
home/desktop/window-managers/hyprland.nix
Normal file
181
home/desktop/window-managers/hyprland.nix
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
osConfig,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
options = {
|
||||
desktop = {
|
||||
hyprland = {
|
||||
monitors = lib.mkOption {
|
||||
default = [
|
||||
",preferred,auto,1"
|
||||
];
|
||||
description = "declare monitors";
|
||||
};
|
||||
workspaces = {
|
||||
workspaces = lib.mkOption {
|
||||
default = (
|
||||
builtins.concatLists (
|
||||
builtins.genList (
|
||||
i:
|
||||
let
|
||||
ws = i + 1;
|
||||
in
|
||||
[
|
||||
"${toString i},persistent:true"
|
||||
]
|
||||
) config.desktop.hyprland.workspaces.amount
|
||||
)
|
||||
);
|
||||
description = "declare workspace";
|
||||
};
|
||||
amount = lib.mkOption {
|
||||
default = 9;
|
||||
description = "declare workspace amount";
|
||||
};
|
||||
};
|
||||
numlock = lib.mkEnableOption "numlock by default";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf osConfig.desktop.hyprland.enable {
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
configPackages = [
|
||||
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland
|
||||
];
|
||||
extraPortals = [
|
||||
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland
|
||||
pkgs.xdg-desktop-portal-xapp
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
|
||||
];
|
||||
config.common = {
|
||||
"org.freedesktop.portal.OpenURI" = [
|
||||
"*"
|
||||
"hyprland"
|
||||
];
|
||||
};
|
||||
};
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
systemd.enable = false;
|
||||
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
|
||||
portalPackage =
|
||||
inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.xdg-desktop-portal-hyprland;
|
||||
settings = {
|
||||
monitor = config.desktop.hyprland.monitors;
|
||||
workspace = config.desktop.hyprland.workspaces.workspaces;
|
||||
env = [
|
||||
"XDG_CURRENT_DESKTOP,Hyprland"
|
||||
"XDG_SESSION_TYPE,wayland"
|
||||
"XDG_SESSION_DESKTOP,Hyprland"
|
||||
];
|
||||
exec-once = [
|
||||
(lib.mkIf (osConfig.desktop.shell.walker.enable) "elephant")
|
||||
(lib.mkIf (osConfig.desktop.shell.waybar.enable) "waybar")
|
||||
(lib.mkIf (osConfig.desktop.shell.noctalia.enable) "noctalia-shell")
|
||||
(lib.mkIf (osConfig.desktop.shell.noctalia.enable) "noctalia-shell ipc call wallpaper random")
|
||||
(lib.mkIf (osConfig.desktop.shell.swww.enable) "waypaper --restore --random")
|
||||
(lib.mkIf (osConfig.gaming.steam.enable) "adwaita-steam-gtk -u; steam -silent")
|
||||
(lib.mkIf (osConfig.internet.mail.providers.protonmail.enable) "protonmail-bridge -n")
|
||||
"echo $HYPRLAND_INSTANCE_SIGNATURE > ~/.config/hypr/instance_signature"
|
||||
];
|
||||
"$mod" = "SUPER";
|
||||
"$shiftmod" = "SUPER_SHIFT";
|
||||
"$controlmod" = "SUPER_CTRL";
|
||||
bind = [
|
||||
|
||||
(lib.mkIf (osConfig.desktop.shell.walker.enable) "$mod, D, exec, walker")
|
||||
(lib.mkIf (osConfig.desktop.shell.rofi.enable) "$mod, D, exec, rofi -show drun")
|
||||
"$mod, return, exec, ${osConfig.apps.terminal.binary}"
|
||||
(lib.mkIf (osConfig.desktop.utilities.grimblast.enable) ", print, exec, GRIMBLAST_EDITOR=gradia grimblast edit area")
|
||||
(lib.mkIf (osConfig.desktop.shell.walker.enable) (
|
||||
lib.mkIf (osConfig.misc.bitwarden.enable) "$mod, B, exec, rbw unlocked || kitty --class kitty-floating -e rbw unlock; selected=$(rbw list | walker -d); wl-copy $(rbw get \"$selected\"); sleep 30; rbw lock"
|
||||
))
|
||||
"$mod, F, fullscreen, 1"
|
||||
"$shiftmod, F, fullscreen, 0"
|
||||
"$shiftmod, Q, killactive,"
|
||||
"$mod, S, togglespecialworkspace, magic"
|
||||
"$mod, O, exec, zen"
|
||||
"$shiftmod, S, movetoworkspace, special:magic"
|
||||
"$controlmod, right, workspace, m+1"
|
||||
"$controlmod, left, workspace, m-1"
|
||||
"$mod, mouse_down, workspace, m-1"
|
||||
"$mod, mouse_up, workspace, m+1"
|
||||
"$mod, left, movefocus, l"
|
||||
"$mod, right, movefocus, r"
|
||||
"$mod, up, movefocus, u"
|
||||
"$mod, down, movefocus, d"
|
||||
"$mod, J, exec, playerctl previous"
|
||||
"$mod, K, exec, playerctl play-pause"
|
||||
"$mod, L, exec, playerctl next"
|
||||
"$mod, G, togglefloating,"
|
||||
"$mod, F1, exec, hyprlock"
|
||||
"$shiftmod, E, exec, codium"
|
||||
"$controlmod, up, exec, light -A 10"
|
||||
"$controlmod, down, exec, light -U 10"
|
||||
"$controlmod, Q, exec, hyprctl kill"
|
||||
|
||||
]
|
||||
++ (builtins.concatLists (
|
||||
builtins.genList (
|
||||
i:
|
||||
let
|
||||
ws = i + 1;
|
||||
in
|
||||
[
|
||||
"$mod, code:1${toString i}, workspace, ${toString ws}"
|
||||
"$shiftmod, code:1${toString i}, movetoworkspacesilent, ${toString ws}"
|
||||
]
|
||||
) config.desktop.hyprland.workspaces.amount
|
||||
));
|
||||
bindm = [
|
||||
"$mod, mouse:272, movewindow"
|
||||
"$mod, mouse:273, resizewindow"
|
||||
];
|
||||
bindel = [
|
||||
",XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
|
||||
",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
|
||||
];
|
||||
input = {
|
||||
kb_layout = "de";
|
||||
numlock_by_default = config.desktop.hyprland.numlock;
|
||||
follow_mouse = 2;
|
||||
mouse_refocus = false;
|
||||
accel_profile = "flat";
|
||||
sensitivity = 0.2;
|
||||
touchpad = {
|
||||
natural_scroll = "no";
|
||||
disable_while_typing = true;
|
||||
};
|
||||
};
|
||||
cursor = {
|
||||
inactive_timeout = 0;
|
||||
no_warps = true;
|
||||
};
|
||||
decoration = {
|
||||
rounding = 20;
|
||||
blur = {
|
||||
enabled = true;
|
||||
size = 3;
|
||||
passes = 1;
|
||||
};
|
||||
shadow = {
|
||||
range = 4;
|
||||
render_power = 3;
|
||||
color = "rgba(1a1a1aee)";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
home.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
}
|
||||
22
home/desktop/window-managers/niri.nix
Normal file
22
home/desktop/window-managers/niri.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
osConfig,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
options = {
|
||||
desktop.window-managers = {
|
||||
niri = {
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
config = lib.mkIf osConfig.desktop.window-managers.niri.enable {
|
||||
xdg.configFile."niri/config.kdl".source = ../../configs/niri/config.kdl;
|
||||
|
||||
};
|
||||
}
|
||||
72
home/desktop/window-managers/sway.nix
Normal file
72
home/desktop/window-managers/sway.nix
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
options = {
|
||||
desktop.window-managers = {
|
||||
sway = {
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
config = lib.mkIf osConfig.desktop.window-managers.sway.enable {
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
package = pkgs.swayfx;
|
||||
config = {
|
||||
modifier = "Mod4";
|
||||
startup = [
|
||||
{ command = "elephant"; }
|
||||
];
|
||||
keybindings =
|
||||
let
|
||||
modifier = config.wayland.windowManager.sway.config.modifier;
|
||||
in
|
||||
{
|
||||
"${modifier}+Return" = "exec ${config.wayland.windowManager.sway.config.terminal}";
|
||||
"${modifier}+Shift+q" = "kill";
|
||||
"${modifier}+d" = "exec walker";
|
||||
"${modifier}+o" = "exec zen";
|
||||
"${modifier}+Control+right" = "exec /home/marty/.config/sway/scripts/workspaceswitcher right";
|
||||
"${modifier}+Control+left" = "exec /home/marty/.config/sway/scripts/workspaceswitcher left";
|
||||
"${modifier}+f" = "fullscreen";
|
||||
|
||||
"${modifier}+1" = "workspace number 1";
|
||||
"${modifier}+2" = "workspace number 2";
|
||||
"${modifier}+3" = "workspace number 3";
|
||||
"${modifier}+4" = "workspace number 4";
|
||||
"${modifier}+5" = "workspace number 5";
|
||||
"${modifier}+6" = "workspace number 6";
|
||||
"${modifier}+7" = "workspace number 7";
|
||||
"${modifier}+8" = "workspace number 8";
|
||||
"${modifier}+9" = "workspace number 9";
|
||||
"${modifier}+s" = "workspace number 0";
|
||||
|
||||
"${modifier}+Shift+1" = "move container to workspace number 1";
|
||||
"${modifier}+Shift+2" = "move container to workspace number 2";
|
||||
"${modifier}+Shift+3" = "move container to workspace number 3";
|
||||
"${modifier}+Shift+4" = "move container to workspace number 4";
|
||||
"${modifier}+Shift+5" = "move container to workspace number 5";
|
||||
"${modifier}+Shift+6" = "move container to workspace number 6";
|
||||
"${modifier}+Shift+7" = "move container to workspace number 7";
|
||||
"${modifier}+Shift+8" = "move container to workspace number 8";
|
||||
"${modifier}+Shift+9" = "move container to workspace number 9";
|
||||
"${modifier}+Shift+s" = "move container to workspace number 0";
|
||||
};
|
||||
input = {
|
||||
"*" = {
|
||||
xkb_layout = builtins.substring 0 2 osConfig.system.locale;
|
||||
};
|
||||
};
|
||||
defaultWorkspace = "workspace number 1";
|
||||
terminal = osConfig.desktop.defaults.terminal.binary;
|
||||
};
|
||||
checkConfig = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue