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

{
  imports = with tree; [
    ./hardware.nix

    users.root
    users.chaos
    profiles.tailscale
    profiles.dnscrypt
    profiles.printing
    profiles.sshd

    # required for dualsense controller
    profiles.kernels.latest

    profiles.laptop

    # Bluetooth
    profiles.connectivity.bluetooth
    profiles.sound.pulseaudio.pulse-bluetooth

    profiles.connectivity.network_manager
    profiles.connectivity.ios

    profiles.sound.pulseaudio.pulse

    profiles.gui
    profiles.gui.environments.sway

    profiles.gaming.steam

    # for sci-hub and whenever websites break
    profiles.tor

    # Music! 
    hosts.lappy.profiles.mpd

    # For cross compiling and deploying to raspberry
    profiles.cross.arm64
  ];

  home-manager.users.root = { imports = with tree; [ home.base ]; };
  home-manager.users.chaos = {
    imports = with tree; [
      home.base
      home.dev.all
      home.reversing

      home.gui
      home.gui.environments.sway

      home.gaming.emulators.ds
      #home.gaming.games.minecraft
      #home.gaming.games.osu
      #home.gaming.platforms.steam

      #home.bluetooth
      home.network_manager

      home.apps.vivaldi
      home.apps.telegram
      home.apps.quassel

      home.programming
      #home.programming.languages.go
      home.programming.languages.nix
    ];
  };

  services.getty.extraArgs =
    [ "--skip-login" "--login-options" "chaos" ];

  networking.firewall.enable = true;
  # let vscode, vivaldi, etc work.
  security.unprivilegedUsernsClone = true;

  networking.hostName = "lappy";
  time.timeZone = "Europe/London";
  powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";

  services.fstrim.enable = true;

  system.stateVersion = "21.11";
}