IIO-sensor and Auto-rotate on NixOS

I’ve been trying to get my iio-sensor to read on Sway and Hyprland (currently using Sway for off-topic reasons) but both haven’t been able to work properly.

I’m following the guide to add the iio-sway flake.nix module

inputs = {

iio-sway.url = “github:tbaumann/iio-sway”;

};

outputs = { iio-sway, … }@inputs:

Then in configuration.nix

hardware.sensor.iio.enable = lib.mkDefault true;

Home.nix

imports = [ inputs.iio-sway.homeManagerModules.default ];

programs.iio-sway = {

enable = true;

display = “eDP-1”;

};

wayland.windowManager.sway.config.startup = [

{command = “iio-sway”; always = true;}

];

But when i run this is either get

error: undefined variable ‘inputs’

But adding ‘inputs’ to header gives me this error:

error: infinite recursion encountered

Not sure how to fix.