{
  config,
  lib,
  inputs,
  pkgs,
  timeZone,
  ...
}:
let
  cfg = config.deskCfg;
in
{
  options.deskCfg = {
    de = lib.mkOption {
      default = "niri";
      type = lib.types.str;
      description = "Desktop Environment";
    };
    userName = lib.mkOption {
      type = lib.types.str;
      description = "Main username for system";
    };
    hostName = lib.mkOption {
      type = lib.types.str;
      description = "Hostname for system";
    };
    fullName = lib.mkOption {
      type = lib.types.str;
      default = "User";
      description = "Full display name for the user";
    };
    installGaming = lib.mkOption {
      type = lib.types.bool;
      default = false;
      description = "Whether to install gaming software or not";
    };
    flakePath = lib.mkOption {
      type = lib.types.str;
      default = "/home/${cfg.userName}/nixos";
      description = "Absolute path to the NixOS flake configuration directory";
    };
  };

  imports = [
    ../user/main_user.nix
    ../system/power_manager.nix
    ../system/noctalia-system.nix
  ];

  config = {
    nixpkgs.overlays = [
      inputs.nur.overlays.default
    ];

    # Enable flakes
    nix.settings.experimental-features = [
      "nix-command"
      "flakes"
    ];

    # Boot loader defaults
    boot.loader.systemd-boot.enable = lib.mkDefault true;
    boot.loader.efi.canTouchEfiVariables = lib.mkDefault true;

    networking.hostName = cfg.hostName;
    networking.networkmanager.enable = lib.mkDefault true;

    time.timeZone = timeZone;

    main_user = {
      enable = true;
      userName = cfg.userName;
      fullName = cfg.fullName;
      isDesktopUser = true;
    };

    power_manager = {
      enable = lib.mkDefault true;
      backend = lib.mkDefault "power-profiles-daemon";
    };

    noctaliaSystem.enable = lib.mkDefault true;
  };
}
