setup sway vm

This commit is contained in:
tristan 2024-01-06 22:35:25 +00:00
parent e67707b0f0
commit 35fa5b6bda
10 changed files with 118 additions and 111 deletions

2
.gitignore vendored
View file

@ -1,2 +1,2 @@
result
nixos.qcow2
*.qcow2

View file

@ -36,17 +36,32 @@
./home/programs/personal.nix
];
vm = mkConf [
FCS-Tristan-Nixbook =
mkConf [
./hardware/fcs-tristan-nixbook.nix
./nixos/programs/hyprland.nix
./nixos/modules/work.nix
] [
./home/programs/work.nix
];
vm-sway =
builtins.trace ''
I haven't finished configuring sway yet.
use alt+enter to start a terminal.
use alt+d to launch applications
start the vm with '-vga qxl'
''
mkConf
[
./hardware/vm.nix
./nixos/programs/sway.nix
] [];
vm-tty = mkConf [
./hardware/vm.nix
] [];
FCS-Tristan-Nixbook = mkConf [
./hardware/fcs-tristan-nixbook.nix
./nixos/programs/hyprland.nix
./nixos/modules/work.nix
] [
./home/programs/work.nix
];
};
};
}

View file

@ -1,11 +1,33 @@
{config, ...}: let
user = config.user;
in {
hardware.opengl.enable = true;
boot.kernelModules = ["qxl" "bochs_drm"];
system.stateVersion = "24.05";
home-manager.users.${user}.imports = [
{
home.stateVersion = "24.05";
# so it won't conflict with the host
windowManager.modifierKey = "ALT";
}
];
displays.displays = {
Virtual-1 = {
enable = true;
name = "Virtual-1";
workspaces = {
start = 1;
end = 10;
};
resolution = {
x = 1920;
y = 1080;
freq = 60;
};
};
};
}

View file

@ -1,6 +1,7 @@
{
config,
pkgs,
lib,
...
}:
# https://nix-community.github.io/home-manager/options.xhtml
@ -14,13 +15,15 @@
./modules/menu.nix
./modules/scripts.nix
./programs/hyprland.nix
./programs/graphical.nix
./programs/scripts.nix
./programs/neovim/.
./programs/git.nix
./programs/lf/.
./programs/shell.nix
{
options.windowManager.modifierKey = lib.mkOption {default = "SUPER";};
}
];
roles.mpd.enable = true;

View file

@ -7,6 +7,7 @@
cfg = config.programs.menu;
terminal = config.programs.terminal;
termcmd = "${terminal}/bin/${terminal.pname}";
menucmd = "${config.programs.menu.package}${config.programs.menu.drunCommand}";
in {
options.programs = with lib; {
menu = {
@ -17,6 +18,9 @@ in {
default = "/bin/wofi --show dmenu";
example = "/bin/dmenu";
};
drunCommand = mkOption {
default = "/bin/wofi --show drun";
};
};
};
@ -29,6 +33,8 @@ in {
};
};
wayland.windowManager.sway.config.menu = menucmd;
home.packages = [cfg.package];
};
}

View file

@ -1,8 +1,11 @@
{
lib,
pkgs,
config,
...
}: {
}: let
modifier = config.windowManager.modifierKey;
in {
imports = [
(import ./swaylock.nix)
(import ./swayidle.nix)
@ -51,52 +54,52 @@
];
};
bind = [
"SUPER, h, movefocus,l"
"SUPER, l, movefocus,r"
"SUPER, j, layoutmsg,cyclenext"
"SUPER, k, layoutmsg,cycleprev"
"SUPER, space, layoutmsg,swapwithmaster master"
"SUPER, F, fullscreen,"
"SUPER, V, togglefloating,"
"SUPER, W, layoutmsg, orientationprev"
"SUPER_SHIFT, W, layoutmsg, orientationnext"
"SUPER_SHIFT, V, togglegroup,"
"SUPER_SHIFT, h, changegroupactive,b"
"SUPER_SHIFT, h, moveintogroup,l"
"SUPER_SHIFT, l, moveintogroup,r"
"SUPER_SHIFT, l, changegroupactive,f"
"SUPER, Y, togglespecialworkspace"
"SUPER_SHIFT, Y, movetoworkspace, special"
"SUPER_SHIFT, X, killactive"
"SUPER, slash, focuswindow, brave-browser"
"SUPER, n, focuswindow, Logseq"
"SUPER, R, submap, resize"
"SUPER,1,workspace,1"
"SUPER,2,workspace,2"
"SUPER,3,workspace,3"
"SUPER,4,workspace,4"
"SUPER,5,workspace,5"
"SUPER,6,workspace,6"
"SUPER,7,workspace,7"
"SUPER,8,workspace,8"
"SUPER,9,workspace,9"
"SUPER,0,workspace,10"
"SUPER,left,workspace,r-1"
"SUPER,right,workspace,r+1"
"SUPER_SHIFT,1,movetoworkspace,1"
"SUPER_SHIFT,2,movetoworkspace,2"
"SUPER_SHIFT,3,movetoworkspace,3"
"SUPER_SHIFT,4,movetoworkspace,4"
"SUPER_SHIFT,5,movetoworkspace,5"
"SUPER_SHIFT,6,movetoworkspace,6"
"SUPER_SHIFT,7,movetoworkspace,7"
"SUPER_SHIFT,8,movetoworkspace,8"
"SUPER_SHIFT,9,movetoworkspace,9"
"SUPER_SHIFT,0,movetoworkspace,10"
"${modifier}, h, movefocus,l"
"${modifier}, l, movefocus,r"
"${modifier}, j, layoutmsg,cyclenext"
"${modifier}, k, layoutmsg,cycleprev"
"${modifier}, space, layoutmsg,swapwithmaster master"
"${modifier}, F, fullscreen,"
"${modifier}, V, togglefloating,"
"${modifier}, W, layoutmsg, orientationprev"
"${modifier}_SHIFT, W, layoutmsg, orientationnext"
"${modifier}_SHIFT, V, togglegroup,"
"${modifier}_SHIFT, h, changegroupactive,b"
"${modifier}_SHIFT, h, moveintogroup,l"
"${modifier}_SHIFT, l, moveintogroup,r"
"${modifier}_SHIFT, l, changegroupactive,f"
"${modifier}, Y, togglespecialworkspace"
"${modifier}_SHIFT, Y, movetoworkspace, special"
"${modifier}_SHIFT, X, killactive"
"${modifier}, slash, focuswindow, brave-browser"
"${modifier}, n, focuswindow, Logseq"
"${modifier}, R, submap, resize"
"${modifier},1,workspace,1"
"${modifier},2,workspace,2"
"${modifier},3,workspace,3"
"${modifier},4,workspace,4"
"${modifier},5,workspace,5"
"${modifier},6,workspace,6"
"${modifier},7,workspace,7"
"${modifier},8,workspace,8"
"${modifier},9,workspace,9"
"${modifier},0,workspace,10"
"${modifier},left,workspace,r-1"
"${modifier},right,workspace,r+1"
"${modifier}_SHIFT,1,movetoworkspace,1"
"${modifier}_SHIFT,2,movetoworkspace,2"
"${modifier}_SHIFT,3,movetoworkspace,3"
"${modifier}_SHIFT,4,movetoworkspace,4"
"${modifier}_SHIFT,5,movetoworkspace,5"
"${modifier}_SHIFT,6,movetoworkspace,6"
"${modifier}_SHIFT,7,movetoworkspace,7"
"${modifier}_SHIFT,8,movetoworkspace,8"
"${modifier}_SHIFT,9,movetoworkspace,9"
"${modifier}_SHIFT,0,movetoworkspace,10"
];
bindm = [
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"
"${modifier}, mouse:272, movewindow"
"${modifier}, mouse:273, resizewindow"
];
env = [
"GDK_BACKEND,wayland,x11"
@ -151,7 +154,7 @@
bind = , escape, submap,reset
bind = , enter, submap,reset
bind = SUPER, R, submap,reset
bind = ${modifier}, R, submap,reset
bind = CONTROL, C, submap,reset
submap = reset
'';

View file

@ -3,6 +3,7 @@
pkgs,
...
}: let
modifier = config.windowManager.modifierKey;
terminal = config.programs.terminal;
termcmd = "${terminal}/bin/${terminal.pname}";
my-deps = {
@ -64,7 +65,7 @@ in {
'';
hotkeys = [
{
modifier = "SUPER_SHIFT";
modifier = "${modifier}_SHIFT";
key = "P";
}
];
@ -84,7 +85,7 @@ in {
'';
hotkeys = [
{
modifier = "SUPER_SHIFT";
modifier = "${modifier}_SHIFT";
key = "S";
}
];
@ -159,7 +160,7 @@ in {
'';
hotkeys = [
{
modifier = "SUPER";
modifier = "${modifier}";
key = "EQUAL";
}
];
@ -172,7 +173,7 @@ in {
'';
hotkeys = [
{
modifier = "SUPER";
modifier = "${modifier}";
key = "MINUS";
}
];
@ -213,7 +214,7 @@ in {
'';
hotkeys = [
{
modifier = "SUPER_SHIFT";
modifier = "${modifier}_SHIFT";
key = "period";
}
{
@ -230,7 +231,7 @@ in {
'';
hotkeys = [
{
modifier = "SUPER_SHIFT";
modifier = "${modifier}_SHIFT";
key = "comma";
}
{
@ -285,7 +286,7 @@ in {
hotkeys = [
{
key = "C";
modifier = "SUPER_SHIFT";
modifier = "${modifier}_SHIFT";
}
];
}

View file

@ -45,46 +45,8 @@
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 36;
modules-left = ["sway/workspaces" "sway/window"];
modules-right = ["mpris" "pulseaudio" "clock" "tray" "battery"];
clock = {
format = "📅 {:%a %b-%d %I:%M %p}";
};
pulseaudio = {
format-muted = "🔇 {volume}";
format = "{icon} {volume}";
format-icons.default = ["🔈" "🔉" "🔊"];
on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
};
mpris = {
format = "{player_icon} {artist} - {title}";
format-paused = "{status_icon} {player_icon} {artist} - {title}";
player-icons = {
default = "";
mpd = "🎵";
kdeconnect = "";
};
status-icons = {
paused = "";
};
};
battery = {
format = "{icon} {capacity}%";
format-icons = ["🤏" "🪫" "🔋" "🔋"];
format-charging = "🔌 {capacity}%";
states = {
warning = 30;
critical = 15;
};
};
};
};
systemd = {
enable = true;
target = "graphical-session.target";
};
};
}

View file

@ -13,8 +13,6 @@ in {
};
home-manager.users.${user}.imports = [
{
wayland.windowManager.hyprland.enable = true;
}
../../home/programs/hyprland.nix
];
}

View file

@ -1,9 +1,6 @@
{user}: {
lib,
pkgs,
config,
...
}: {
{config, ...}: let
user = config.user;
in {
services.greetd = {
enable = true;
settings = rec {