{
  description = "My flakes configuration";

  inputs = {
    nixpkgs.url = "nixpkgs/nixos-unstable";
    nixos-cosmic = {
      url = "github:lilyinstarlight/nixos-cosmic";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    stylix = {
      url = "github:danth/stylix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    zen-browser.url = "github:0xc000022070/zen-browser-flake";
    master.url = "github:NixOS/nixpkgs/master";
    home-manager.url = "github:nix-community/home-manager";
    nixvim = {
      url = "github:nix-community/nixvim";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nixos-apple-silicon = {
      url = "github:tpwrules/nixos-apple-silicon";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    astal = {
      url = "github:aylur/astal";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = { self, stylix, astal, nixpkgs, nixos-cosmic, home-manager, zen-browser, master, nixos-apple-silicon, nixvim }@inputs:
    {
      nixosConfigurations = {
        nixos = nixpkgs.lib.nixosSystem {
          system = "x86_64-linux";
	  specialArgs = {inherit nixvim;};
	  specialArgs.inputs = inputs;
          modules = [
            {
              nix.settings = {
                substituters = [ "https://cosmic.cachix.org/" ];
                trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ];
              };
            }
	    #stylix.nixosModules.stylix
	    nixos-cosmic.nixosModules.default
            ./hosts/desktop/configuration.nix
	    home-manager.nixosModules.home-manager 
	    {
	      home-manager.useUserPackages = true;
	      home-manager.extraSpecialArgs = {inherit inputs;};
	      home-manager.users.joshuaelm = {
		imports = [ ./hosts/desktop/home.nix nixvim.homeManagerModules.nixvim stylix.homeModules.stylix ];
	      };
	    }  
	  ];
        };
        nixos-laptop = nixpkgs.lib.nixosSystem {
          system = "x86_64-linux";
	  specialArgs = {inherit nixvim;};
	  specialArgs.inputs = inputs;
          modules = [
            {
              nix.settings = {
                substituters = [ "https://cosmic.cachix.org/" ];
                trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ];
              };
            }
            nixos-apple-silicon.nixosModules.apple-silicon-support
	    #stylix.nixosModules.stylix
	    nixos-cosmic.nixosModules.default
            ./hosts/mac-laptop/configuration.nix
	    home-manager.nixosModules.home-manager
	    {
	      home-manager.useUserPackages = true;
	      home-manager.extraSpecialArgs = {inherit inputs;};
	      home-manager.users.joshuaelm = {
		imports = [ ./hosts/mac-laptop/home.nix nixvim.homeManagerModules.nixvim stylix.homeModules.stylix ];
	      };
	    }
	  ];
        };
      };
    };
}

