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

{
  imports = [
    ./modules.nix
  ];

  networking = {
    hostName = "framework";
    networkmanager = {
      enable = true;
    };
  };

  services = {
    pipewire = {
      enable = true;
      alsa = {
        enable = true;
        support32Bit = true;
      };
      pulse = {
        enable = true;
      };
    };
  };

  # Flatpak
  #services = {
  #  flatpak = {
  #    enable = true;
  #  };
  #};

  # Todo -> Display server for all nixos machines (lightdm or smth else)
  
  # User
  users= {
    users = {
      alex = {
        isNormalUser = true;
        description = "Alexandre Delcamp--Enache";
        shell= pkgs.zsh;
        extraGroups = [ "networkmanager" "wheel" "video" "render" ];
      };
    };
  };
  # HomeManager
  home-manager = {
    extraSpecialArgs = { inherit inputs; };
    useGlobalPkgs = true;
    useUserPackages = true;
    backupFileExtension = "HM-Backup";
    users = {
      "alex" = import ./home.nix;
    };
  };

  programs = {
    hyprland = {
      enable = true;
    };
    zsh = {
      enable = true;
      autosuggestions = {
        enable = true;
      };
    };
  };

  environment = {
    systemPackages = with pkgs; [
      playerctl

      # Video Accel
      libva
      libva-utils
      mesa
      (wrapOBS {
        plugins = with pkgs.obs-studio-plugins; [
          obs-vaapi        # ← encodage H.264/HEVC via VA-API (AMD, Intel)
          obs-gstreamer    # ← optionnel mais utile
        ];
      })
    ];
    sessionVariables = {
      NIXOS_OZONE_WL = "1";
      LIBVA_DRIVER_NAME = "radeonsi";
    };
    pathsToLink = [ "/share/zsh" ];
  };

  system = {
    stateVersion = "24.11";
  };

# End of config
}
