summaryrefslogtreecommitdiff
path: root/users/seth/desktop/default.nix
blob: 10d2a8902b554832f83953887e8b4bb4c0b372dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
  config,
  lib,
  pkgs,
  osConfig,
  ...
}:
let
  cfg = config.seth.desktop;
in
{
  options.seth.desktop = {
    enable = lib.mkEnableOption "desktop (Linux) settings" // {
      default = osConfig.desktop.enable or false;
      defaultText = lib.literalExpression "osConfig.desktop.enable or false";
    };
  };

  imports = [
    ./budgie.nix
    ./gnome.nix
    ./niri.nix
    ./plasma.nix
  ];

  config = lib.mkIf cfg.enable {
    # This is meant for Linux
    assertions = [ (lib.hm.assertions.assertPlatform "seth.desktop" pkgs lib.platforms.linux) ];

    home.packages = [

      # Add hardware acceleration flags on Linux
      ## let
      ##   inherit (pkgs) discord;
      ##   flags = lib.concatStringsSep " " [
      ##     "--enable-gpu-rasterization"
      ##     "--enable-zero-copy"
      ##     "--enable-gpu-compositing"
      ##     "--enable-native-gpu-memory-buffers"
      ##     "--enable-oop-rasterization"
      ##     "--enable-features=UseSkiaRenderer,WaylandWindowDecorations"
      ##   ];
      ## in
      ## if pkgs.stdenv.isLinux then
      ##   discord.overrideAttrs (old: {
      ##     desktopItem = old.desktopItem.override (old': {
      ##       exec = "${old'.exec} ${flags}";
      ##     });
      ##   })
      ## else
      pkgs.discord-canary

      pkgs.prismlauncher
    ];

    programs.ghostty.enable = pkgs.stdenv.hostPlatform.isLinux;
  };
}