{ self, inputs, ... }:
{
  flake.nixosConfigurations.FW16 = inputs.nixpkgs.lib.nixosSystem {
    modules = [
      self.nixosModules.FW16Config
      inputs.lanzaboote.nixosModules.lanzaboote
      inputs.home-manager.nixosModules.default
      inputs.spicetify-nix.nixosModules.spicetify
    ];
  };

  flake.nixosModules.FW16Config = { config, pkgs, inputs, ...}: {
    imports = [
      self.nixosModules.FW16Hardware
      self.nixosModules.amd
      self.nixosModules.commonConfig
      self.nixosModules.bootloader
      self.nixosModules.niri
      self.nixosModules.bluetooth
      #self.nixosModules.distrobox
    ];

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

      /*
      nftables = {
        enable = true;
        ruleset = ''
          table inet filter {
            chain input {
              type filter hook input priority filter; policy drop;

              iifname "enp*" accept

              ct state { established, related } accept

              tcp dport 22 accept

              icmp type echo-request accept
            }
            chain forward {
              type filter hook forward priority filter; policy accept;
            }
            chain output {
              type filter hook output priority filter; policy accept;
            }
          }
        '';
      };
    */
    };

    hardware.inputmodule.enable = true;

    services = {
      power-profiles-daemon = {
        enable = true;
      };
      tlp = {
        enable = false;
      };
      pipewire = {
        enable = true;
        alsa = {
          enable = true;
          support32Bit = true;
        };
        pulse = {
          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" ];
        };
      };
    };

    home-manager = {
      useGlobalPkgs = true;
      users = {
        "alex" = self.homeModules.commonHomeConfig;
      };
    };

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

    environment = {
      systemPackages = with pkgs; [
        playerctl
        framework-tool

        # Video Accel
        libva
        libva-utils
        mesa
      ];
      sessionVariables = {
        NIXOS_OZONE_WL = "1";
        LIBVA_DRIVER_NAME = "radeonsi";
      };
    };

    system = {
      stateVersion = "24.11";
    };

  # End of config
  };
}
