My system configuration via Nix flakes
# Thanks to https://colinramsay.co.uk/2021/10/19/migrating-a-nixos-install-to-flakes.html
{
  # the source of your packages
  inputs = {
    # Nixpkgs-wayland
    nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";

    # only needed if you use as a package set:
    nixpkgs-wayland.inputs.nixpkgs.follows = "nixpkgs";

    # Rust via rust-overlay
    rust-overlay.url = "github:oxalica/rust-overlay";

    # Mozilla overlay: firefox nightly & thunderbird daily
    # Using my fork that (jankily) adds thunderbird support
    mozilla-overlay.url = "github:finchiedev/nixpkgs-mozilla";
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

    nixos-cosmic = {
      url = "github:lilyinstarlight/nixos-cosmic";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    lix = {
      url = "git+https://git@git.lix.systems/lix-project/lix?ref=refs/tags/2.90-beta.1";
      flake = false;
    };

    lix-module = {
      url = "git+https://git.lix.systems/lix-project/nixos-module";
      inputs.lix.follows = "lix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  # Boilerplate from https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-nixos-module
  outputs = inputs@{ nixpkgs, home-manager, nixos-cosmic, lix-module, ... }: {
    nixosConfigurations = {
      # A gotcha: nixos is the HOSTNAME, need to change this eventually
      nixos = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          lix-module.nixosModules.default
          ./configuration.nix
          home-manager.nixosModules.home-manager
          {
            home-manager.useGlobalPkgs = true;
            home-manager.useUserPackages = true;
            home-manager.users.finchie = import ./home.nix;
          }
          ({
            nixpkgs.overlays = with inputs; [
              nixpkgs-wayland.overlay
              rust-overlay.overlays.default
              mozilla-overlay.overlay
            ];
          })

          nixos-cosmic.nixosModules.default
        ];

      };
    };
  };
}