{
  description = "A flake using my config";
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-25.05";
    musnix.url = "github:musnix/musnix";
    home-manager = {
      url = "github:nix-community/home-manager/release-25.05";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    stylix = {
      url = "github:danth/stylix/release-25.05";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    sops-nix = {
      url = "github:Mic92/sops-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nixvim = {
      url = "github:nix-community/nixvim/nixos-25.05";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    zen-browser = {
      url = "github:youwen5/zen-browser-flake";
    };
    cosmic-manager = {
      url = "github:HeitorAugustoLN/cosmic-manager";
      inputs = {
        nixpkgs.follows = "nixpkgs";
        home-manager.follows = "home-manager";
      };
    };
  };

  outputs = {nixvim, ...} @ inputs: let
    system = "x86_64-linux";
    pkgs = import inputs.nixpkgs {inherit system;};
    user = "tristan";
    userFullname = "Tristan Beedell";
    auto-login = import ./nixos/programs/auto-login.nix;

    mkConf = import ./lib/mkconf.nix {inherit inputs system user userFullname;};
  in {
    formatter.${system} = pkgs.alejandra;
    nixosConfigurations = {
      zenix = mkConf {
        nixos-modules = [
          ./hardware/zenix.nix
          ./nixos/programs/cosmic.nix
          ./nixos/programs/gamer.nix
          ./nixos/programs/personal.nix
          ./nixos/services/musnix.nix
          ./nixos/workstation.nix
        ];
        home-modules = [
          ./home/programs/graphical.nix
          ./home/programs/gamer.nix
          ./home/programs/personal/.
          ./home/desktop/cosmic/.
        ];
      };

      framework-13 = mkConf {
        nixos-modules = [
          ./hardware/framework-13.nix
          ./nixos/workstation.nix
          ./nixos/modules/work.nix
          ./nixos/programs/cosmic.nix
        ];
        home-modules = [
          ./home/programs/work.nix
          ./home/programs/graphical.nix
          ./home/desktop/cosmic/.
        ];
      };

      alpine = mkConf {
        nixos-modules = [
          ./hardware/alpine.nix
          ./nixos/services/anki.nix
          ./nixos/services/forgejo.nix
          ./nixos/services/vaultwarden.nix
          ./nixos/services/jellyfin.nix
          ./nixos/services/prometheus.nix
          ./nixos/services/grafana.nix
          ./nixos/services/loki.nix
          ./nixos/services/synapse/.
          ./nixos/services/mautrix/whatsapp.nix
          ./nixos/services/mautrix/signal.nix
          ./nixos/services/nextcloud.nix
          ./nixos/services/ntfy.nix
          ./nixos/services/authentik.nix
          ./nixos/services/monero.nix
          ./nixos/services/arr.nix
        ];
      };

      vm-cosmic =
        mkConf
        {
          nixos-modules = [
            ./hardware/vm.nix
            ./nixos/workstation.nix
            ./nixos/programs/cosmic.nix
          ];
          home-modules = [
            ./home/workstation.nix
          ];
        };

      vm-tty =
        mkConf
        {
          nixos-modules = [
            ./hardware/vm.nix
          ];
        };
    };

    packages.${system} = {
      nixvim = let
        nixvim' = nixvim.legacyPackages.${system};
        nixvimModule = {
          inherit pkgs;
          module = import ./lib/nixvim.nix;
        };
        nvim = nixvim'.makeNixvimWithModule nixvimModule;
      in
        nvim;
    };
  };
}
