# flake for blakes nixos config
# define new devices in outputs
# generation: 378, timestamp: 2025-10-12 19:57:35
{
  description = "blakes nix config";
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-25.05";
    nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
    nix-darwin = {
      url = "github:LnL7/nix-darwin";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    home-manager = {
      url = "github:nix-community/home-manager/release-25.05";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    home-manager-unstable = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs-unstable";
    };
    nix-homebrew.url = "github:zhaofengli/nix-homebrew";
    nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=latest";
    sops-nix = {
      url = "github:Mic92/sops-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    disko = {
      url = "github:nix-community/disko/latest";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    lanzaboote = {
      url = "github:nix-community/lanzaboote/v0.4.3";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    watershot = {
      url = "github:Kirottu/watershot";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    vpn-confinement = {
      url = "github:Maroka-chan/VPN-Confinement";
    };
    nvf = {
      url = "github:notashelf/nvf/v0.8";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    autoaspm = {
      url = "github:notthebee/AutoASPM";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    stylix = {
      url = "github:nix-community/stylix";
      inputs.nixpkgs.follows = "nixpkgs-unstable";
    };
    copyparty.url = "github:9001/copyparty";
    slippi = {
      url = "github:lytedev/slippi-nix";
      inputs.nixpkgs.follows = "nixpkgs-unstable";
    };
  };
  outputs = {
    self,
    nixpkgs,
    nixpkgs-unstable,
    nix-darwin,
    nix-homebrew,
    ...
  } @ inputs: let
    systems = {
      x86_64 = "x86_64-linux";
      arm64 = "aarch64-linux";
      darwin = "aarch64-darwin";
    };
    stable_pkgs = builtins.mapAttrs (k: v: import nixpkgs {system = v;}) systems;
    unstable_pkgs = builtins.mapAttrs (k: v: import nixpkgs-unstable {system = v;}) systems;
  in {
    nixosConfigurations = {
      snowbelle = nixpkgs.lib.nixosSystem {
        system = systems.x86_64;
        specialArgs = {inherit inputs stable_pkgs unstable_pkgs;};
        modules = [
          ./hosts/nixos/snowbelle/configuration.nix
          inputs.home-manager.nixosModules.default
        ];
      };
      yveltal = nixpkgs-unstable.lib.nixosSystem {
        system = systems.x86_64;
        specialArgs = {inherit inputs stable_pkgs unstable_pkgs;};
        modules = [
          ./hosts/nixos/yveltal/configuration.nix
          ./hosts/nixos/yveltal/disko.nix
          inputs.home-manager-unstable.nixosModules.default
          inputs.disko.nixosModules.disko
        ];
      };
      vaniville = nixpkgs.lib.nixosSystem {
        system = systems.x86_64;
        specialArgs = {inherit inputs stable_pkgs unstable_pkgs;};
        modules = [
          ./hosts/nixos/vaniville/configuration.nix
          inputs.home-manager.nixosModules.default
        ];
      };
    };
    darwinConfigurations = {
      CEN-IT-07 = nix-darwin.lib.darwinSystem {
        system = systems.darwin;
        specialArgs = {inherit inputs stable_pkgs unstable_pkgs nix-homebrew;};
        modules = [
          ./hosts/darwin/cen-it-07/configuration.nix
          inputs.home-manager.darwinModules.default
          nix-homebrew.darwinModules.nix-homebrew
          {
            nix-homebrew = {
              enable = true;  # install homebrew
              enableRosetta = true;   # install homebrew for rosetta as well
              user = "blake";  # user owning homebrew prefix
            };
          }
        ];
      };
    };
  };
}
