discord: use new enable option for testbed

This commit is contained in:
Matt Sturgeon 2025-05-17 01:31:21 +01:00 committed by NAHO
parent a2236aa290
commit 2b176d49de
No known key found for this signature in database
GPG key ID: 229CB671D09B95F5
2 changed files with 24 additions and 37 deletions

View file

@ -7,46 +7,28 @@
{
perSystem =
{
pkgs,
system,
config,
...
}:
{ pkgs, config, ... }:
{
# Build all packages with 'nix flake check' instead of only verifying they
# are derivations.
checks = config.packages;
packages =
let
testbedPackages = import "${self}/stylix/testbed.nix" {
packages = lib.mkMerge [
# Testbeds are virtual machines based on NixOS, therefore they are
# only available for Linux systems.
(lib.mkIf pkgs.stdenv.hostPlatform.isLinux (
import "${self}/stylix/testbed.nix" {
inherit pkgs inputs lib;
};
# Discord is not available on arm64. This workaround filters out
# testbeds using that package, until we have a better way to handle
# this.
testbedPackages' =
if system == "aarch64-linux" then
lib.filterAttrs (
name: _: !lib.hasPrefix "testbed:discord:vencord" name
) testbedPackages
else
testbedPackages;
in
lib.mkMerge [
# Testbeds are virtual machines based on NixOS, therefore they are
# only available for Linux systems.
(lib.mkIf pkgs.stdenv.hostPlatform.isLinux testbedPackages')
{
docs = pkgs.callPackage "${self}/doc" {
inherit inputs;
inherit (inputs.nixpkgs.lib) nixosSystem;
inherit (inputs.home-manager.lib) homeManagerConfiguration;
};
palette-generator = pkgs.callPackage "${self}/palette-generator" { };
}
];
))
{
docs = pkgs.callPackage "${self}/doc" {
inherit inputs;
inherit (inputs.nixpkgs.lib) nixosSystem;
inherit (inputs.home-manager.lib) homeManagerConfiguration;
};
palette-generator = pkgs.callPackage "${self}/palette-generator" { };
}
];
};
}

View file

@ -6,9 +6,14 @@ let
};
in
{
stylix.testbed.ui.application = {
name = "discord";
inherit package;
stylix.testbed = {
# Discord is not available on arm64.
enable = lib.meta.availableOn pkgs.stdenv.hostPlatform package;
ui.application = {
name = "discord";
inherit package;
};
};
environment.systemPackages = [ package ];