{
  description = "Homelab v5 Nixos Server Configurations";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-24.05";
    nixpkgs-unstable.url = "github:nixos/nixpkgs?ref=nixos-unstable";
    sops-nix.url = "github:Mic92/sops-nix";
    backup-helper.url = "git+https://git.t-juice.club/torjus/backup-helper?ref=master";
  };

  outputs = { self, nixpkgs, nixpkgs-unstable, sops-nix, backup-helper, ... }@inputs:
    let
      system = "x86_64-linux";
      overlay-unstable = final: prev: {
        unstable = import nixpkgs-unstable {
          inherit system;
          config.allowUnfree = true;
        };
      };
    in
    {
      nixosConfigurations = {
        ns1 = nixpkgs.lib.nixosSystem {
          inherit system;
          specialArgs = { inherit inputs self sops-nix; };
          modules = [
            ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
            ./hosts/ns1
            sops-nix.nixosModules.sops
          ];
        };
        ns2 = nixpkgs.lib.nixosSystem {
          inherit system;
          specialArgs = { inherit inputs self sops-nix; };
          modules = [
            ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
            ./hosts/ns2
            sops-nix.nixosModules.sops
          ];
        };
        ns3 = nixpkgs.lib.nixosSystem {
          inherit system;
          specialArgs = { inherit inputs self sops-nix; };
          modules = [
            ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
            ./hosts/ns3
            sops-nix.nixosModules.sops
          ];
        };
        ns4 = nixpkgs.lib.nixosSystem {
          inherit system;
          specialArgs = { inherit inputs self sops-nix; };
          modules = [
            ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
            ./hosts/ns4
            sops-nix.nixosModules.sops
          ];
        };
        nixos-test1 = nixpkgs.lib.nixosSystem {
          inherit system;
          specialArgs = { inherit inputs self sops-nix; };
          modules = [
            ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
            ./hosts/nixos-test1
            sops-nix.nixosModules.sops
            backup-helper.nixosModules.backup-helper
          ];
        };
        ha1 = nixpkgs.lib.nixosSystem {
          inherit system;
          specialArgs = { inherit inputs self sops-nix; };
          modules = [
            ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
            ./hosts/ha1
            sops-nix.nixosModules.sops
            backup-helper.nixosModules.backup-helper
          ];
        };
        inc1 = nixpkgs.lib.nixosSystem {
          inherit system;
          specialArgs = { inherit inputs self sops-nix; };
          modules = [
            ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
            ./hosts/inc1
            sops-nix.nixosModules.sops
            # backup-helper.nixosModules.backup-helper
          ];
        };
        inc2 = nixpkgs.lib.nixosSystem {
          inherit system;
          specialArgs = { inherit inputs self sops-nix; };
          modules = [
            ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
            ./hosts/inc2
            sops-nix.nixosModules.sops
            # backup-helper.nixosModules.backup-helper
          ];
        };
        template1 = nixpkgs.lib.nixosSystem {
          inherit system;
          specialArgs = { inherit inputs self sops-nix; };
          modules = [
            ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
            ./hosts/template
            sops-nix.nixosModules.sops
          ];
        };
      };
    };
}