{
  description = "A very basic flake";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
    flake-base = {
      url = "git+https://khs.codes/nix/flake-base";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    disko = {
      url = "github:nix-community/disko";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    terranix = {
      url = "github:terranix/terranix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    home-manager = {
      url = "github:nix-community/home-manager/release-25.05";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    terranix-hcloud = {
      url = "github:terranix/terranix-hcloud";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    crane.url = "github:ipetkov/crane";
    advisory-db = {
      url = "github:rustsec/advisory-db";
      flake = false;
    };
    rust-overlay = {
      url = "github:oxalica/rust-overlay";
      inputs = {
        nixpkgs.follows = "nixpkgs";
      };
    };
    nixos-anywhere = {
      url = "github:nix-community/nixos-anywhere/1.11.0";
      inputs = {
        nixpkgs.follows = "nixpkgs";
      };
    };
    stylix = {
      url = "github:nix-community/stylix/release-25.05";
      inputs = {
        nixpkgs.follows = "nixpkgs";
      };
    };
    cosmic-manager = {
      url = "github:HeitorAugustoLN/cosmic-manager";
      inputs = {
        nixpkgs.follows = "nixpkgs";
        home-manager.follows = "home-manager";
      };
    };
  };

  outputs =
    inputs@{ self, ... }:
    let
      inputNixosModules = [
        inputs.disko.nixosModules.disko
        inputs.stylix.nixosModules.stylix
      ];
      inputHomeModules = [
        inputs.cosmic-manager.homeManagerModules.cosmic-manager
      ];
      allowUnfreePackages = [
        "spotify"
        "google-chrome"
      ];
    in
    (inputs.flake-base.lib.mkFlake {
      inherit inputs;
      src = ./.;
      channels-config = {
        allowUnfreePredicate = pkg: builtins.elem (inputs.nixpkgs.lib.getName pkg) allowUnfreePackages;
      };
      systems.modules.nixos = inputNixosModules;
      homes.modules = inputHomeModules;
      snowfall = {
        root = ./nix;
        namespace = "khscodes";
        meta = {
          title = "Nix machines for KHS";
          name = "Machines";
        };
      };
      overlays = [ inputs.rust-overlay.overlays.default ];
    })
    // {
      terranixModules.cloudflare = import ./nix/modules/terranix/cloudflare {
        inherit inputs;
        khscodesLib = inputs.self.lib;
      };
      terranixModules.hcloud = import ./nix/modules/terranix/hcloud {
        inherit inputs;
        khscodesLib = inputs.self.lib;
      };
      terranixModules.vault = import ./nix/modules/terranix/vault {
        inherit inputs;
        khscodesLib = inputs.self.lib;
      };
      terranixModules.s3 = import ./nix/modules/terranix/s3 {
        inherit inputs;
        khscodesLib = inputs.self.lib;
      };
      terranixModules.openstack = import ./nix/modules/terranix/openstack {
        inherit inputs;
        khscodesLib = inputs.self.lib;
      };
      terranixModules.unifi = import ./nix/modules/terranix/unifi {
        inherit inputs;
        khscodesLib = inputs.self.lib;
      };
    };
}
