# Edit this configuration file to define what should be installed on
# your system.  Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`).

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

{
  imports = [
    inputs.nixos-apple-silicon.nixosModules.default
    inputs.home-manager.nixosModules.default
    ../../modules

    # Default specialisation
    ({ lib, config, ... }: {
      config = lib.mkIf (config.specialisation != { }) {
        snowhawk.hyprland.enable = true;
      };
    })
  ];

  snowhawk = {
    filesystem.enable = true;
    user.enable = true;
    env.enable = true;
    sops.enable = true;

    audio.enable = false;
    power-button.enable = false;
  };

  specialisation = {
    plasma.configuration = {
      environment.etc."specialisation".text = "plasma";

      services.xserver.enable = true;
      services.displayManager.sddm.enable = true;
      services.desktopManager.plasma6.enable = true;

      services.hypridle.enable = true;
      systemd.user.services.hypridle.path = [ pkgs.brightnessctl ];
    };
  };


  documentation = {
    enable = true;
    dev.enable = true;
    man.enable = true;
  };

  home-manager = {
    users = { "ravenshade" = import ./home.nix; };
    backupFileExtension = "backup";
    useGlobalPkgs = true;
  };

  environment.systemPackages = with pkgs; [
    neovim
    curl
    git
    killall

    iwd
    iwgtk

    gparted
    exfatprogs

    linux-manual

    inputs.nh.packages.${pkgs.system}.default
  ];

  environment.variables.NH_FLAKE = "/home/ravenshade/.config/nixos";
  environment.variables.NIXOS_OZONE_WL = 1;

  fonts.packages = with pkgs; [
    nerd-fonts.jetbrains-mono
  ];

  # Enable CUPS to print documents.
  services.printing.enable = true;

  # Set your time zone.
  time.timeZone = "America/Los_Angeles";
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "23.11"; # Did you read the comment?
}