Error: flake 'path:/etc/nixos' does not provide attribute

hello, I recently tried out flake to install gstreamer.

I followed the guide found here

I created a flake.nix file under /etc/nixos/ and copy the whole thing from that guide in, which looks like this:

# file: flake.nix
  description = "A GStreamer development flake";

  outputs = { self, nixpkgs }:
      system = "x86_64-linux";
      pkgs = nixpkgs.legacyPackages.${system};
    in {
      devShells.${system}.default = pkgs.mkShell {
        buildInputs = with pkgs; [
          # Video/Audio data composition framework tools like "gst-inspect", "gst-launch" ...
          # Common plugins like "filesrc" to combine within e.g. gst-launch
          # Specialized plugins separated by quality
          # Plugins to reuse ffmpeg to play almost every video format
          # Support the Video Audio (Hardware) Acceleration API

then i did nix develop command to install GStreamer

but when i rebuild my system with nixos-rebuild switch, it throws me an error:

error: flake 'path:/etc/nixos' does not provide attribute 'packages.x86_64-linux.nixosConfigurations."Windows11"', 'legacyPackages.x86_64-linux.nixosConfigurations."Windows11"' or 'nixosConfigurations."Windows11"'

It feels like I’m missing something obvious here and i hope someone can please help me

That flake defines a devShell, which is activated by nix develop and is meant to be a temporary environment for development. It does not provide a NixOS system configuration. The NixOS configuration is usually the wrong place to put development libraries anyway.