mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
44 lines
1.5 KiB
Nix
44 lines
1.5 KiB
Nix
let
|
|
tests = {
|
|
wayland = { pkgs, ... }: {
|
|
imports = [ ./common/wayland-cage.nix ];
|
|
services.cage.program = "${pkgs.freetube}/bin/freetube";
|
|
virtualisation.memorySize = 2047;
|
|
environment.variables.NIXOS_OZONE_WL = "1";
|
|
environment.variables.DISPLAY = "do not use";
|
|
};
|
|
xorg = { pkgs, ... }: {
|
|
imports = [ ./common/user-account.nix ./common/x11.nix ];
|
|
virtualisation.memorySize = 2047;
|
|
services.xserver.enable = true;
|
|
services.xserver.displayManager.sessionCommands = ''
|
|
${pkgs.freetube}/bin/freetube
|
|
'';
|
|
test-support.displayManager.auto.user = "alice";
|
|
};
|
|
};
|
|
|
|
mkTest = name: machine:
|
|
import ./make-test-python.nix ({ pkgs, ... }: {
|
|
inherit name;
|
|
nodes = { "${name}" = machine; };
|
|
meta.maintainers = with pkgs.lib.maintainers; [ kirillrdy ];
|
|
# time-out on ofborg
|
|
meta.broken = pkgs.stdenv.hostPlatform.isAarch64;
|
|
enableOCR = true;
|
|
|
|
testScript = ''
|
|
start_all()
|
|
machine.wait_for_unit('graphical.target')
|
|
machine.wait_for_text('Your Subscription list is currently empty')
|
|
machine.send_key("ctrl-r")
|
|
machine.wait_for_text('Your Subscription list is currently empty')
|
|
machine.screenshot("main.png")
|
|
machine.send_key("ctrl-comma")
|
|
machine.wait_for_text('Data Settings', timeout=60)
|
|
machine.screenshot("preferences.png")
|
|
'';
|
|
});
|
|
in
|
|
builtins.mapAttrs (k: v: mkTest k v) tests
|