{ self, inputs, ... }: {
  flake.nixosModules.uConsoleConfiguration =
    {
      self,
      lib,
      pkgs,
      modulesPath,
      config,
      inputs,
      ...
    }:
    {
      # Workaround for NixOS/nixpkgs#398456.
      disabledModules = [ (modulesPath + "/rename.nix") ];

      imports = [
        # Workaround for NixOS/nixpkgs#398456.
        (lib.mkAliasOptionModule
          [ "environment" "checkConfigurationOptions" ]
          [ "_module" "check" ])

        self.nixosModules.uConsoleHardware
        inputs.home-manager.nixosModules.home-manager
        inputs.sops-nix.nixosModules.sops

        self.nixosModules.system
        self.nixosModules.desktop
        self.nixosModules.users

        self.nixosModules."client-services"
        ./_private/platform.nix
        ./_private/wifi-brcmfmac.nix
        ./_private/services.nix
        ./_private/cockpit.nix
        ./_private/activation.nix
        ./_private/4g/default.nix
      ];

      nix.settings = {
        experimental-features = [ "nix-command" "flakes" ];
        require-sigs = false;
      };

      sops = {
        defaultSopsFile = ../../../secrets/secrets.yaml;
        defaultSopsFormat = "yaml";
        age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
      };

      sops.secrets."users/olivier/hashedPassword".neededForUsers = true;
      sops.secrets."caching/attic/token" = {
        owner = "olivier";
        group = "users";
        mode = "0400";
      };
      sops.secrets."swiftshare/API_KEY" = {
        owner = "olivier";
        group = "users";
        mode = "0400";
      };

      chiasson.system.librepods.enable = true;
      chiasson.system.palera1n.enable = true;

      # ─────────────────────── Attic (pull + push + CLI token) ────────────────────
      chiasson.system.caching.attic = {
        enable = true;
        cacheName = "nixos-new";
        endpoint = "http://192.168.2.238:8080/";
        publicKey = "nixos-new:8NySIcT0HP7KvGQKgBRWoWESxxRA8BVYo8S85UNpNX0=";
        tokenFile = config.sops.secrets."caching/attic/token".path;
        push.enable = true;
        userCli.enable = true;
      };
      # ─────────────────────── Display Server & Desktop ──────────────────────────

      chiasson.desktop = {
        # Pi 5 + RP1 DSI: see `modules/desktop/niri/pi5-workarounds.nix` and `chiasson.desktop.niri.raspberryPi5DrmWorkaround`.
        # After login, `niri msg outputs` — add `outputs."…"` under `extraSettings` only if you need mode/transform.
        niri = {
          enable = true;
          raspberryPi5DrmWorkaround = true;
        };
        defaultSession = "niri";
        shell = "dms";
        shells.dms = {
          enableWvkbdToggle = true;
        };
      };
      chiasson.system = {
        audio.enable = true;
        networking = {
          hostName = "uConsole";
          networkManager = {
            enable = true;
            unmanaged = [ ];
          };
          wifi.tools.enabled = true;
        };
        extraPackages = with pkgs; [ gitMinimal ];
      };

      chiasson.users.enabled = [ "olivier" ];

      chiasson.users.extraModules.olivier = [
        self.homeManagerModules.wisdomFilebrowsersDolphin
        self.homeManagerModules.wisdomTerminalsKitty
        self.homeManagerModules.wisdomBrowsersZen
        self.homeManagerModules.wisdomEditorsKate
        self.homeManagerModules.wisdomShellFish
        self.homeManagerModules.wisdomShellOhMyPosh
        self.homeManagerModules.wisdomAppsSpotify
        self.homeManagerModules.wisdomAppsLocalsend
        self.homeManagerModules.wisdomDesktopScreenshot
        self.homeManagerModules.wisdomHardwareUconsoleGamepad
        {
          chiasson.home = {
            shell = {
              fish.enable = true;
              ohMyPosh.enable = true;
            };
            terminals.kitty.enable = true;
            filebrowsers.dolphin.enable = true;
            browsers.zen.enable = true;
            editors.kate.enable = true;
            apps.spotify.enable = true;
            apps.localsend.enable = true;
            desktop = {
              screenshot = {
                enable = true;
                swiftshareApiKeyFile = "/run/secrets/swiftshare/API_KEY"; #TODO[epic=sops] redo this by passing sops file output directly
              };
            };
            hardware.uconsoleGamepad.enable = true;
          };
        }
      ];

      console.packages = with pkgs; [ terminus_font ];
    };
}
