{
  description = "My personal NixOS config";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

    awww = {
      url = "git+https://codeberg.org/LGFae/awww";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    stylix = {
      url = "github:danth/stylix";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    zen-browser = {
      url = "github:youwen5/zen-browser-flake";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    floatc = {
      url = "git+https://git.stribrny.org/max_ag/floating-calculator?rev=2abbacf66e99db523d624037f3e449aa40e8f366";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    niri-flake = {
      url = "github:sodiboo/niri-flake";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = {nixpkgs, ...} @ inputs: let
    system = "x86_64-linux";

    mkSystem = device-name:
      nixpkgs.lib.nixosSystem {
        inherit system;

        specialArgs = {
          inherit inputs device-name system;
        };
        modules = [
          ./configuration/${device-name}/configuration.nix
          ./configuration/${device-name}/hardware-configuration.nix
          inputs.home-manager.nixosModules.default
          inputs.stylix.nixosModules.stylix
          {
            home-manager = {
              useUserPackages = true;
              useGlobalPkgs = true;

              extraSpecialArgs = {
                inherit inputs device-name system;
              };

              backupFileExtension = null;

              users.maxag = {
                imports = [./home/${device-name}/home.nix];
                home.stateVersion = "25.11";
              };

              sharedModules = [
                inputs.stylix.homeModules.stylix
              ];
            };
          }
        ];
      };
  in {
    nixosConfigurations = {
      max-laptop = mkSystem "laptop";
      max-main = mkSystem "main";
    };
  };
}
