{
  description = "My NixOS desktop and server configs";

  inputs = {

    # NixOS official package source, using the nixos-23.11 branch here
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
    nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
    nixos-hardware.url = "github:nixos/nixos-hardware";

    # Declarative dotfile management
    home-manager = {
      url = "github:nix-community/home-manager/release-24.05";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    # Declarative partitioning and formatting
    disko = {
      url = "github:nix-community/disko";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    stylix.url = "github:danth/stylix";

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

#    # Secrets management. See ./docs/secretsmgmt.md
#    sops-nix = {
#      url = "github:mic92/sops-nix";
#      inputs.nixpkgs.follows = "nixpkgs";
#    };

  };

  outputs = { nixpkgs, nixpkgs-unstable, stylix, nixvim, ... }@attrs: 
  let
      lib = nixpkgs.lib;
      pkgs = import nixpkgs { system = "x86_64-linux"; config = { allowUnfree = true; }; };
      pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; config = { allowUnfree = true; }; };
  in
  {
    nixosConfigurations = {

      Lenni = let
        system = "x86_64-linux";
      in
      lib.nixosSystem {

        specialArgs = {
          hostname = "Lenni";
          type = "desktop";
          inherit pkgs;
          inherit pkgs-unstable;
          inherit system;
        };

        modules = [
          attrs.home-manager.nixosModules.home-manager
            {
              home-manager.useGlobalPkgs = true;
              home-manager.useUserPackages = true;
            }
          attrs.disko.nixosModules.disko
          stylix.nixosModules.stylix
          nixvim.nixosModules.nixvim
          attrs.nixos-hardware.nixosModules.framework-12th-gen-intel
          ./hosts
          ./users/willifan
        ];

      };

      Puenktchen = let
        system = "x86_64-linux";
      in
      lib.nixosSystem {

        specialArgs = {
          hostname = "Puenktchen";
          type = "desktop";
          inherit pkgs;
          inherit pkgs-unstable;
          inherit system;
        };

        modules = [
          attrs.home-manager.nixosModules.home-manager
            {
              home-manager.useGlobalPkgs = true;
              home-manager.useUserPackages = true;
            }
          attrs.disko.nixosModules.disko
          stylix.nixosModules.stylix
          nixvim.nixosModules.nixvim
          attrs.nixos-hardware.nixosModules.common-cpu-amd
          attrs.nixos-hardware.nixosModules.common-cpu-amd-pstate
          attrs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
          attrs.nixos-hardware.nixosModules.common-gpu-amd
          ./hosts
          ./users/willifan
        ];

      };

      Anton = let
        system = "x86_64-linux";
      in
      lib.nixosSystem {

        specialArgs = {
          hostname = "Anton";
          type = "server";
          inherit pkgs;
          inherit pkgs-unstable;
          inherit system;
        };

        modules = [
          attrs.home-manager.nixosModules.home-manager
            {
              home-manager.useGlobalPkgs = true;
              home-manager.useUserPackages = true;
            }
          attrs.disko.nixosModules.disko
          stylix.nixosModules.stylix
          nixvim.nixosModules.nixvim
          attrs.nixos-hardware.nixosModules.common-cpu-amd
          attrs.nixos-hardware.nixosModules.common-cpu-amd-pstate
          attrs.nixos-hardware.nixosModules.common-cpu-amd-zenpower
          ./hosts
          ./users/willifan
        ];
        
      };

    };
  };
}