{
  description = "Vproxy projects flake";
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
    nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
    disko.url   = "github:nix-community/disko";
    deploy-rs = {
      url = "github:serokell/deploy-rs";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    rust-overlay = {
      url = "github:oxalica/rust-overlay";
      inputs = {
        nixpkgs.follows = "nixpkgs-unstable";
      };
    };
    util = {
      url = "github:hectic-lab/util.nix";
      inputs = {
        nixpkgs-25-05.follows = "nixpkgs";
        rust-overlay.follows = "rust-overlay";
      };
    };
    cargo2nix = {
      url = "github:cargo2nix/cargo2nix";
      inputs = {
        nixpkgs.follows = "nixpkgs-unstable";
        rust-overlay.follows = "rust-overlay";
      };
    };
    crane = {
      url = "github:ipetkov/crane";
    };
    sops-nix = {
      url = "github:Mic92/sops-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { self, rust-overlay, deploy-rs, util, nixpkgs-unstable, nixpkgs, ... }@inputs:
  let
    flake    = builtins.warn "Using the `flake` variable may produce a huge derivation, which increases the size of data copied into the Nix store and transferred to the server during deployment. Its usage should therefore be avoided." ./.;
    lib      = import ./lib { inherit inputs flake self; };
  in
  util.lib.forAllSystemsWithPkgs lib.composedOverlays ({ system, pkgs }:
    {
      apps.${system}           = import ./app                  { inherit self system; };
      packages.${system}       = import ./package              { inherit inputs self flake; } { inherit pkgs; };
      devShells.${system}      = import ./devshell             { inherit flake self inputs; } { inherit pkgs; };
      nixosConfigurations = {
        "master_${system}"     = import ./nixos/system/banned  { inherit flake self inputs system; };
        "staging_${system}"    = import ./nixos/system/staging { inherit flake self inputs system; };
        "proxy_${system}"      = import ./nixos/system/proxy   { inherit flake self inputs system; };
      };
      deploy                   = import ./deploy               { inherit self system inputs; };
    }
  ) // {
      lib                      = lib;
      nixosModules             = import ./nixos/module         { inherit inputs flake self; };
  };
}
