add 'laptopMode' option and user config (#92)

* aly: special sway and hyprland configs for mauville

* add 'laptopMode' option and config

* nixfmt
This commit is contained in:
Aly Raffauf 2024-08-19 21:40:31 -04:00 committed by GitHub
parent fb9adbde52
commit 5cae43ef51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 55 additions and 19 deletions

View file

@ -167,6 +167,12 @@ in {
}; };
}; };
laptopMode = lib.mkOption {
description = "Enable laptop configuration.";
default = osConfig.ar.laptopMode;
type = lib.types.bool;
};
services = { services = {
easyeffects = { easyeffects = {
enable = lib.mkEnableOption "EasyEffects user service."; enable = lib.mkEnableOption "EasyEffects user service.";

View file

@ -4,20 +4,14 @@
pkgs, pkgs,
... ...
}: { }: {
imports = [./laptop.nix];
programs.waybar.settings.mainBar."bluetooth" = { programs.waybar.settings.mainBar."bluetooth" = {
"on-click" = lib.mkForce "${lib.getExe pkgs.rofi-bluetooth} -i"; "on-click" = lib.mkForce "${lib.getExe pkgs.rofi-bluetooth} -i";
}; };
wayland.windowManager = { wayland.windowManager = {
sway.config = { sway.config = {
assigns = {
"workspace 1:web" = [{app_id = "firefox";} {app_id = "brave-browser";}];
"workspace 2:note" = [{app_id = "obsidian";}];
"workspace 3:code" = [{app_id = "codium-url-handler";} {app_id = "dev.zed.Zed";}];
"workspace 4:mail" = [{app_id = "thunderbird";}];
"workspace 5:work" = [{app_id = "firework";}];
};
floating.criteria = [{app_id = "Bitwarden";} {app_id = "org.keepassxc.KeePassXC";}]; floating.criteria = [{app_id = "Bitwarden";} {app_id = "org.keepassxc.KeePassXC";}];
gaps = { gaps = {
@ -33,7 +27,6 @@
}; };
startup = [ startup = [
{command = "sleep 2 && ${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} workspace 1:web";}
{command = lib.getExe config.ar.home.defaultApps.editor;} {command = lib.getExe config.ar.home.defaultApps.editor;}
{command = lib.getExe config.ar.home.defaultApps.webBrowser;} {command = lib.getExe config.ar.home.defaultApps.webBrowser;}
{command = lib.getExe pkgs.fractal;} {command = lib.getExe pkgs.fractal;}
@ -77,10 +70,6 @@
dwindle.no_gaps_when_only = "1"; dwindle.no_gaps_when_only = "1";
exec-once = [
"sleep 2 && hyprctl dispatch workspace 2 && sleep 2 && hyprctl dispatch workspace 3 && sleep 2 && hyprctl dispatch workspace 4 && sleep 2 && hyprctl dispatch workspace 1;"
];
input.kb_options = "ctrl:nocaps"; input.kb_options = "ctrl:nocaps";
windowrulev2 = [ windowrulev2 = [
@ -90,17 +79,11 @@
"float,class:(org.keepassxc.KeePassXC)" "float,class:(org.keepassxc.KeePassXC)"
"size 80% 80%,class:(Bitwarden)" "size 80% 80%,class:(Bitwarden)"
"size 80% 80%,class:(org.keepassxc.KeePassXC)" "size 80% 80%,class:(org.keepassxc.KeePassXC)"
"workspace 1,class:(brave-browser)"
"workspace 5,class:(firework)"
"workspace special:magic,class:(WebCord)" "workspace special:magic,class:(WebCord)"
"workspace special:magic,class:(org.gnome.Fractal)" "workspace special:magic,class:(org.gnome.Fractal)"
]; ];
workspace = [ workspace = [
"1,defaultName:web,on-created-empty:${lib.getExe config.ar.home.defaultApps.webBrowser}"
"2,defaultName:note,on-created-empty:${lib.getExe' pkgs.obsidian "obsidian"}"
"3,defaultName:code,on-created-empty:${lib.getExe config.ar.home.defaultApps.editor}"
"4,defaultName:mail,on-created-empty:${lib.getExe pkgs.thunderbird}"
"special:magic,on-created-empty:${lib.getExe pkgs.fractal}" "special:magic,on-created-empty:${lib.getExe pkgs.fractal}"
]; ];
}; };

View file

@ -0,0 +1,38 @@
{
config,
lib,
pkgs,
...
}: {
config = lib.mkIf config.ar.home.laptopMode {
wayland.windowManager = {
sway.config = {
assigns = {
"workspace 1:web" = [{app_id = "firefox";} {app_id = "brave-browser";}];
"workspace 2:note" = [{app_id = "obsidian";}];
"workspace 3:code" = [{app_id = "codium-url-handler";} {app_id = "dev.zed.Zed";}];
"workspace 4:mail" = [{app_id = "thunderbird";}];
"workspace 5:work" = [{app_id = "firework";}];
};
startup = [
{command = "sleep 2 && ${lib.getExe' config.wayland.windowManager.sway.package "swaymsg"} workspace 1:web";}
];
};
hyprland.settings = {
exec-once = [
"sleep 2 && hyprctl dispatch workspace 2 && sleep 2 && hyprctl dispatch workspace 3 && sleep 2 && hyprctl dispatch workspace 4 && sleep 2 && hyprctl dispatch workspace 1;"
];
workspace = [
"1,defaultName:web,on-created-empty:${lib.getExe config.ar.home.defaultApps.webBrowser}"
"2,defaultName:note,on-created-empty:${lib.getExe' pkgs.obsidian "obsidian"}"
"3,defaultName:code,on-created-empty:${lib.getExe config.ar.home.defaultApps.editor}"
"4,defaultName:mail,on-created-empty:${lib.getExe pkgs.thunderbird}"
"special:magic,on-created-empty:${lib.getExe pkgs.fractal}"
];
};
};
};
}

View file

@ -42,6 +42,7 @@
sway.enable = true; sway.enable = true;
}; };
laptopMode = true;
services.flatpak.enable = true; services.flatpak.enable = true;
users = { users = {

View file

@ -46,6 +46,8 @@
sway.enable = true; sway.enable = true;
}; };
laptopMode = true;
users.aly = { users.aly = {
enable = true; enable = true;
password = "$y$j9T$NSS7QcEtN4yiigPyofwlI/$nxdgz0lpySa0heDMjGlHe1gX3BWf48jK6Tkfg4xMEs6"; password = "$y$j9T$NSS7QcEtN4yiigPyofwlI/$nxdgz0lpySa0heDMjGlHe1gX3BWf48jK6Tkfg4xMEs6";

View file

@ -66,6 +66,8 @@
sway.enable = true; sway.enable = true;
}; };
laptopMode = true;
users.aly = { users.aly = {
enable = true; enable = true;
password = "$y$j9T$TitXX3J690cnK41XciNMg/$APKHM/os6FKd9H9aXGxaHaQ8zP5SenO9EO94VYafl43"; password = "$y$j9T$TitXX3J690cnK41XciNMg/$APKHM/os6FKd9H9aXGxaHaQ8zP5SenO9EO94VYafl43";

View file

@ -41,6 +41,8 @@
sway.enable = true; sway.enable = true;
}; };
laptopMode = true;
users.aly = { users.aly = {
enable = true; enable = true;
password = "$y$j9T$VdtiEyMOegHpcUwgmCVFD0$K8Ne6.zk//VJNq2zxVQ0xE0Wg3LohvAQd3Xm9aXdM15"; password = "$y$j9T$VdtiEyMOegHpcUwgmCVFD0$K8Ne6.zk//VJNq2zxVQ0xE0Wg3LohvAQd3Xm9aXdM15";

View file

@ -34,6 +34,8 @@
sway.enable = lib.mkEnableOption "Sway wayland session."; sway.enable = lib.mkEnableOption "Sway wayland session.";
}; };
laptopMode = lib.mkEnableOption "Enable laptop configuration.";
services.flatpak.enable = lib.mkEnableOption "Flatpak support with GUI."; services.flatpak.enable = lib.mkEnableOption "Flatpak support with GUI.";
}; };
} }