{
  pkgs,
  pkgsUnstable,
  ...
}: let
  unstable = pkgsUnstable;
in
{
  services = {
    xserver = {
      enable = true;
      videoDrivers = ["modesetting" "nvidia"];
    };
    displayManager.ly.enable = true;
    blueman.enable = false;
    printing.enable = false;
    pipewire = {
      alsa.enable = true;
      alsa.support32Bit = true;
      pulse.enable = true;
    };
  };
  security.rtkit.enable = true;

  boot = {
    readOnlyNixStore = true;
    initrd.compressor = "zstd";
    loader = {
      systemd-boot = {
        enable = true;
        editor = false;
        configurationLimit = 25;
      };
      efi.canTouchEfiVariables = true;
    };
    kernelParams = [
      "nvidia_drm"
      "nvidia_modeset"
      "nvidia_uvm"
      "nvidia-drm.fbdev=1"
      "nvidia"
    ];
  };

  networking.hostName = "gloria";
  networking.enableIPv6 = false;
  networking.networkmanager.enable = true;
  time.timeZone = "Asia/Tehran";

  hardware = {
    graphics.enable = true;
    nvidia = {
      modesetting.enable = true;
      powerManagement.enable = true;
      open = false;
      nvidiaSettings = true;
      package = pkgs.linuxPackages.nvidiaPackages.beta;
      prime.offload = {
          enable = true;
          enableOffloadCmd = true;
          };
      prime = {
      intelBusId = "PCI:0:2:0";
      nvidiaBusId = "PCI:1:0:0";
      };
    };
    bluetooth.enable = true;
    bluetooth.powerOnBoot = true;
  };

  security.sudo.enable = false;
  security.sudo-rs.enable = true;

  virtualisation = {
	podman.enable = true;
  };

  environment.systemPackages = with pkgs; [
    (pkgs.runCommand "vim-wrapper" { } ''
      mkdir -p $out/bin
      ln -s ${pkgs.neovim}/bin/nvim $out/bin/vim
    '')
	unstable.ungoogled-chromium
    unstable.git
    unstable.adwaita-icon-theme
    unstable.nil
    jmtpfs
    android-tools
    unstable.qbittorrent
    unstable.zathura
    unstable.rofi
  ];

  nixpkgs.config.allowUnfree = true;
  
  users.users.coast = {
    isNormalUser = true;
    extraGroups = [ "wheel" "podman" ];
    shell = pkgs.nushell;
  };

  programs = {
    foot.enable = false;
    nano.enable = false;
    nekoray.enable = true;
    nekoray.tunMode.enable = true;
	niri.enable = true;
  };

  fonts.packages = with pkgs; [
    ubuntu-sans
    ubuntu_font_family
    nerd-fonts._0xproto
    nerd-fonts.droid-sans-mono
    nerd-fonts.jetbrains-mono
	nerd-fonts.fira-code
    vazir-fonts
  ];

  xdg.portal = {
	  enable = true;
	  xdgOpenUsePortal = true;
	  extraPortals = with pkgs; [
		  xdg-desktop-portal-gtk
		  xdg-desktop-portal-gnome
	  ];
  };

  nix.settings.experimental-features = [ "nix-command" "flakes" ];
  services.openssh.enable = true;
  system.stateVersion = "25.05";
}
