Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #212199 from OPNA2608/init/miriway

miriway: init at unstable-2022-12-18

authored by Nick Cao and committed by GitHub 3ab1fd29 0dbdc44d

+270
+1
nixos/modules/module-list.nix
··· 195 195 ./programs/mdevctl.nix 196 196 ./programs/mepo.nix 197 197 ./programs/mininet.nix 198 + ./programs/miriway.nix 198 199 ./programs/mosh.nix 199 200 ./programs/msmtp.nix 200 201 ./programs/mtr.nix
+60
nixos/modules/programs/miriway.nix
··· 1 + { config, pkgs, lib, ... }: 2 + 3 + let 4 + cfg = config.programs.miriway; 5 + in { 6 + options.programs.miriway = { 7 + enable = lib.mkEnableOption (lib.mdDoc '' 8 + Miriway, a Mir based Wayland compositor. You can manually launch Miriway by 9 + executing "exec miriway" on a TTY, or launch it from a display manager. Copy 10 + /etc/xdg/xdg-miriway/miriway-shell.config to ~/.config/miriway-shell.config 11 + to modify the default configuration. See <https://github.com/Miriway/Miriway>, 12 + and "miriway --help" for more information''); 13 + 14 + config = lib.mkOption { 15 + type = lib.types.lines; 16 + default = '' 17 + x11-window-title=Miriway (Mir-on-X) 18 + idle-timeout=600 19 + ctrl-alt=t:miriway-terminal # Default "terminal emulator finder" 20 + 21 + shell-component=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY 22 + ''; 23 + example = '' 24 + idle-timeout=300 25 + ctrl-alt=t:weston-terminal 26 + add-wayland-extensions=all 27 + 28 + shell-components=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY 29 + 30 + shell-component=waybar 31 + shell-component=wbg Pictures/wallpaper 32 + 33 + shell-meta=a:synapse 34 + ''; 35 + description = lib.mdDoc '' 36 + Miriway's config. This will be installed system-wide. 37 + The default will install the miriway package's barebones example config. 38 + ''; 39 + }; 40 + }; 41 + 42 + config = lib.mkIf cfg.enable { 43 + environment = { 44 + systemPackages = [ pkgs.miriway ]; 45 + etc = { 46 + "xdg/xdg-miriway/miriway-shell.config".text = cfg.config; 47 + }; 48 + }; 49 + 50 + hardware.opengl.enable = lib.mkDefault true; 51 + fonts.enableDefaultFonts = lib.mkDefault true; 52 + programs.dconf.enable = lib.mkDefault true; 53 + programs.xwayland.enable = lib.mkDefault true; 54 + 55 + # To make the Miriway session available if a display manager like SDDM is enabled: 56 + services.xserver.displayManager.sessionPackages = [ pkgs.miriway ]; 57 + }; 58 + 59 + meta.maintainers = with lib.maintainers; [ OPNA2608 ]; 60 + }
+1
nixos/tests/all-tests.nix
··· 398 398 minidlna = handleTest ./minidlna.nix {}; 399 399 miniflux = handleTest ./miniflux.nix {}; 400 400 minio = handleTest ./minio.nix {}; 401 + miriway = handleTest ./miriway.nix {}; 401 402 misc = handleTest ./misc.nix {}; 402 403 mjolnir = handleTest ./matrix/mjolnir.nix {}; 403 404 mod_perl = handleTest ./mod_perl.nix {};
+126
nixos/tests/miriway.nix
··· 1 + import ./make-test-python.nix ({ pkgs, lib, ... }: { 2 + name = "miriway"; 3 + 4 + meta = { 5 + maintainers = with lib.maintainers; [ OPNA2608 ]; 6 + # FIXME On ARM Miriway inside the VM doesn't receive keyboard inputs, why? 7 + broken = pkgs.stdenv.hostPlatform.isAarch; 8 + }; 9 + 10 + nodes.machine = { config, ... }: { 11 + imports = [ 12 + ./common/auto.nix 13 + ./common/user-account.nix 14 + ]; 15 + 16 + # Seems to very rarely get interrupted by oom-killer 17 + virtualisation.memorySize = 2047; 18 + 19 + test-support.displayManager.auto = { 20 + enable = true; 21 + user = "alice"; 22 + }; 23 + 24 + services.xserver = { 25 + enable = true; 26 + displayManager.defaultSession = lib.mkForce "miriway"; 27 + }; 28 + 29 + programs.miriway = { 30 + enable = true; 31 + config = '' 32 + add-wayland-extensions=all 33 + 34 + ctrl-alt=t:foot --maximized 35 + ctrl-alt=a:env WINIT_UNIX_BACKEND=x11 WAYLAND_DISPLAY=invalid alacritty --option window.startup_mode=maximized 36 + 37 + shell-component=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY 38 + 39 + shell-component=foot --maximized 40 + ''; 41 + }; 42 + 43 + environment = { 44 + shellAliases = { 45 + test-wayland = "wayland-info | tee /tmp/test-wayland.out && touch /tmp/test-wayland-exit-ok"; 46 + test-x11 = "glinfo | tee /tmp/test-x11.out && touch /tmp/test-x11-exit-ok"; 47 + }; 48 + 49 + systemPackages = with pkgs; [ 50 + mesa-demos 51 + wayland-utils 52 + foot 53 + alacritty 54 + ]; 55 + 56 + # To help with OCR 57 + etc."xdg/foot/foot.ini".text = lib.generators.toINI { } { 58 + main = { 59 + font = "inconsolata:size=16"; 60 + }; 61 + colors = rec { 62 + foreground = "000000"; 63 + background = "ffffff"; 64 + regular2 = foreground; 65 + }; 66 + }; 67 + etc."xdg/alacritty/alacritty.yml".text = lib.generators.toYAML { } { 68 + font = rec { 69 + normal.family = "Inconsolata"; 70 + bold.family = normal.family; 71 + italic.family = normal.family; 72 + bold_italic.family = normal.family; 73 + size = 16; 74 + }; 75 + colors = rec { 76 + primary = { 77 + foreground = "0x000000"; 78 + background = "0xffffff"; 79 + }; 80 + normal = { 81 + green = primary.foreground; 82 + }; 83 + }; 84 + }; 85 + }; 86 + 87 + fonts.fonts = [ pkgs.inconsolata ]; 88 + }; 89 + 90 + enableOCR = true; 91 + 92 + testScript = { nodes, ... }: '' 93 + start_all() 94 + machine.wait_for_unit("multi-user.target") 95 + 96 + # Wait for Miriway to complete startup 97 + machine.wait_for_file("/run/user/1000/wayland-0") 98 + machine.succeed("pgrep miriway-shell") 99 + machine.screenshot("miriway_launched") 100 + 101 + # Test Wayland 102 + # We let Miriway start the first terminal, as we might get stuck if it's not ready to process the first keybind 103 + # machine.send_key("ctrl-alt-t") 104 + machine.wait_for_text("alice@machine") 105 + machine.send_chars("test-wayland\n") 106 + machine.wait_for_file("/tmp/test-wayland-exit-ok") 107 + machine.copy_from_vm("/tmp/test-wayland.out") 108 + machine.screenshot("foot_wayland_info") 109 + # Only succeeds when a mouse is moved inside an interactive session? 110 + # machine.send_chars("exit\n") 111 + # machine.wait_until_fails("pgrep foot") 112 + machine.succeed("pkill foot") 113 + 114 + # Test XWayland 115 + machine.send_key("ctrl-alt-a") 116 + machine.wait_for_text("alice@machine") 117 + machine.send_chars("test-x11\n") 118 + machine.wait_for_file("/tmp/test-x11-exit-ok") 119 + machine.copy_from_vm("/tmp/test-x11.out") 120 + machine.screenshot("alacritty_glinfo") 121 + # Only succeeds when a mouse is moved inside an interactive session? 122 + # machine.send_chars("exit\n") 123 + # machine.wait_until_fails("pgrep alacritty") 124 + machine.succeed("pkill alacritty") 125 + ''; 126 + })
+80
pkgs/applications/window-managers/miriway/default.nix
··· 1 + { stdenv 2 + , lib 3 + , fetchFromGitHub 4 + , unstableGitUpdater 5 + , nixosTests 6 + , cmake 7 + , pkg-config 8 + , mir 9 + , libxkbcommon 10 + }: 11 + 12 + stdenv.mkDerivation rec { 13 + pname = "miriway"; 14 + version = "unstable-2022-12-18"; 15 + 16 + src = fetchFromGitHub { 17 + owner = "Miriway"; 18 + repo = "Miriway"; 19 + rev = "d294c303cb99b7becb0d6686be9a09f0a1f57596"; 20 + hash = "sha256-H+IZgI1IQxNl5yAygbDKXkyXajGHV/mp9gEqZcp0TeE="; 21 + }; 22 + 23 + postPatch = '' 24 + substituteInPlace CMakeLists.txt \ 25 + --replace "\''${CMAKE_INSTALL_PREFIX}/bin" "\''${CMAKE_INSTALL_BINDIR}" \ 26 + --replace "/usr/share" "\''${CMAKE_INSTALL_DATADIR}" \ 27 + --replace "/etc" "\''${CMAKE_INSTALL_SYSCONFDIR}" 28 + 29 + sed -i -e '/project(/a include(GNUInstallDirs)' CMakeLists.txt 30 + ''; 31 + 32 + strictDeps = true; 33 + 34 + nativeBuildInputs = [ 35 + cmake 36 + pkg-config 37 + ]; 38 + 39 + buildInputs = [ 40 + mir 41 + libxkbcommon 42 + ]; 43 + 44 + passthru = { 45 + updateScript = unstableGitUpdater { }; 46 + providedSessions = [ "miriway" ]; 47 + tests = { 48 + inherit (nixosTests) miriway; 49 + }; 50 + }; 51 + 52 + meta = with lib; { 53 + description = "Mir based Wayland compositor"; 54 + longDescription = '' 55 + Miriway is a starting point for creating a Wayland based desktop environment using Mir. 56 + 57 + At the core of Miriway is miriway-shell, a Mir based Wayland compositor that provides: 58 + 59 + - A "floating windows" window managament policy; 60 + - Support for Wayland (and via Xwayland) X11 applications; 61 + - Dynamic workspaces; 62 + - Additional Wayland support for "shell components" such as panels and docs; and, 63 + - Configurable shortcuts for launching standard apps such as launcher and terminal emulator. 64 + 65 + In addition to miriway-shell, Miriway has: 66 + 67 + - A "terminal emulator finder" script miriway-terminal, that works with most terminal emulators; 68 + - A launch script miriway to simplify starting Miriway; 69 + - A default configuration file miriway-shell.config; and, 70 + - A greeter configuration miriway.desktop so Miriway can be selected at login 71 + 72 + Miriway has been tested with shell components from several desktop environments and there are notes on 73 + enabling these in miriway-shell.config. 74 + ''; 75 + homepage = "https://github.com/Miriway/Miriway"; 76 + license = licenses.gpl3Only; 77 + platforms = platforms.linux; 78 + maintainers = with maintainers; [ OPNA2608 ]; 79 + }; 80 + }
+2
pkgs/top-level/all-packages.nix
··· 24903 24903 24904 24904 mir = callPackage ../servers/mir { }; 24905 24905 24906 + miriway = callPackage ../applications/window-managers/miriway { }; 24907 + 24906 24908 icinga2 = callPackage ../servers/monitoring/icinga2 { }; 24907 24909 24908 24910 icinga2-agent = callPackage ../servers/monitoring/icinga2 {