diff --git a/.gitignore b/.gitignore index 15dc2cb..6994117 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ *.swp +# VM artifacts +*.qcow2 + result diff --git a/modules/desktop/sway/default.nix b/modules/desktop/sway/default.nix index 2e34a6d..1ce5bf6 100644 --- a/modules/desktop/sway/default.nix +++ b/modules/desktop/sway/default.nix @@ -7,7 +7,8 @@ }: with lib; let cfg = config.aa.desktop.sway; - sway_cfg = config.aa.home.extraOptions.wayland.windowManager.sway; + nag = "swaynag"; + sway_cfg = config.aa.home.extraOptions.wayland.windowManager.sway.config; in { options.aa.desktop.sway = with types; { enable = mkEnableOption "sway"; @@ -37,6 +38,11 @@ in { menu = "rofi -show run"; workspaceAutoBackAndForth = true; + left = "h"; + right = "l"; + up = "j"; + down = "k"; + colors = { focused = { border = "#2B3C44"; @@ -147,7 +153,8 @@ in { "${sway_cfg.modifier}+c" = "kill"; "${sway_cfg.modifier}+p" = "exec ${sway_cfg.menu}"; "${sway_cfg.modifier}+z" = "reload"; - "${sway_cfg.modifier}+x" = "exec swaylock -i ${config.home.homeDirectory}/dotfiles/users/alejandro/sway/wallpaper.png"; + # TODO: Reintroduce this. Failing because config.home.homeDirectory is not set + # "${sway_cfg.modifier}+x" = "exec swaylock -i ${config.home.homeDirectory}/dotfiles/users/alejandro/sway/wallpaper.png"; # Volume control "XF86AudioRaiseVolume" = " exec 'pamixer --increase 5'"; diff --git a/modules/user/default.nix b/modules/user/default.nix index 77b52e3..093ff0e 100644 --- a/modules/user/default.nix +++ b/modules/user/default.nix @@ -33,7 +33,7 @@ in { inherit (cfg) name; - home = "/home/{$cfg.name}"; + home = "/home/${cfg.name}"; group = "users"; shell = pkgs.zsh; diff --git a/systems/x86_64-vm/virt/default.nix b/systems/x86_64-vm/virt/default.nix new file mode 100644 index 0000000..7ac57e0 --- /dev/null +++ b/systems/x86_64-vm/virt/default.nix @@ -0,0 +1,33 @@ +{ + pkgs, + lib, + ... +}: +with lib; { + virtualisation.qemu.options = ["-vga qxl"]; + + # For sway to work with home manager + security.polkit.enable = true; + + # Without this, sway fails to start in the VM + # programs.sway.extraSessionCommands = '' + # WLR_NO_HARDWARE_CURSORS=1 + # ''; + + aa = { + nix.enable = true; + + suites.desktop.enable = true; + }; + + users.users.virt = { + isNormalUser = true; + extraGroups = ["wheel"]; + hashedPassword = "$6$nOlwKVf1u0Wt//zU$43xhafbe2CAWTjOemAUm1J1Dpw7to0ZTbGhFk7CkVTRB3E80a1lhhQ175VnkcJ/X1HI6lsyV8fNMc3GF7JTAP0"; + }; + + environment = { + systemPackages = with pkgs; [wayland-utils]; + variables = {"WLR_RENDERER_ALLOW_SOFTWARE" = "1";}; + }; +}