{ config, lib, pkgs, ... }:

{
  imports = [
    ./hardware-configuration.nix
    ./m1-support
  ];

  networking.hostName = "nat";

  de.enable = true;
  de.touchpad.enable = true;

  # nixpkgs.overlays = [
  #   (final: prev: {
  #     signal-desktop = prev.signal-desktop.overrideAttrs (old: {
  #       version = "5.50.1";
  #       src = final.fetchurl {
  #         url = "https://github.com/0mniteck/Signal-Desktop-Builder/raw/2610eaded94b3c717a63fdff3cb872dbbaf16383/builds/release/signal-desktop_5.50.1_arm64.deb";
  #         sha256 = "sha256-++xG3fCMvU+nwlkBwjZ0d0wfWiNDSUhyCfzTirsY2xs=";
  #       };

  #       #buildInputs = old.buildInputs ++ [ final.openssl_3_0 ];

  #       preFixup = ''
  #         gappsWrapperArgs+=(
  #           --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ final.stdenv.cc.cc ] }"
  #           --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
  #           --suffix PATH : ${lib.makeBinPath [ final.xdg-utils ]}
  #         )
  #         # Fix the desktop link
  #         substituteInPlace $out/share/applications/signal-desktop.desktop \
  #           --replace /opt/Signal/signal-desktop $out/bin/signal-desktop
  #         autoPatchelf --no-recurse -- $out/lib/Signal/
  #         patchelf --add-needed ${final.libpulseaudio}/lib/libpulse.so $out/lib/Signal/resources/app.asar.unpacked/node_modules/ringrtc/build/linux/libringrtc-arm64.node
  #         patchelf --add-needed ${final.openssl_3_0}/lib/libcrypto.so.3 $out/lib/Signal/resources/app.asar.unpacked/node_modules/ringrtc/build/linux/libringrtc-arm64.node
  #       '';

  #       meta.platforms = [ "aarch64-linux" ];
  #     });
  #   })
  # ];

  nixpkgs.overlays = [
    (final: prev: {
      jellyfin-media-player = prev.jellyfin-media-player.overrideAttrs (old: {
        meta.platforms = [ "aarch64-linux" ];
      });
    })
  ];
}
