From 7672318e8435164746e0a0d9a4def8be6820c3fa Mon Sep 17 00:00:00 2001 From: Mel Date: Sat, 18 Jul 2026 18:51:08 +0200 Subject: Add support for fourmi display via custom DRM kernel driver flake Signed-off-by: Mel --- flake.nix | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index c52d5d8..ac30df6 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,11 @@ url = "github:NousResearch/hermes-agent"; inputs.nixpkgs.follows = "nixpkgs-unstable"; }; + + mhs35-drm = { + url = "git+https://git.rnrd.eu/mhs35-drm"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = inputs @ { self, nixpkgs, nixpkgs-unstable, home-manager, agenix, ... }: @@ -77,7 +82,23 @@ overlays = [ agenix.overlays.default ]; - packageSetsForSystem = system: let + # per-machine overlays. + # as we only work with immutable package sets, we need to make sure + # all injected overlays are correct ourselves right here, which modules + # would mutate our package set to achieve automatically. + machineOverlays = { + fourmi = [ + # `hardware.raspberry-pi."4".apply-overlays-dtmerge.enable`. + (final: prev: { + deviceTree = prev.deviceTree // { + applyOverlays = final.callPackage + "${inputs.nixos-hardware}/raspberry-pi/4/apply-overlays-dtmerge.nix" { }; + }; + }) + ]; + }; + + packageSetsWith = { system, overlays }: let pkgsInputs = i: { inherit system; config = import ./config.nix; } // i; in rec { @@ -88,13 +109,21 @@ auxiliaryPkgs = import ./pkgs (pkgsInputs { inherit pkgs unstablePkgs; }); }; + packageSetsForSystem = system: + packageSetsWith { inherit system overlays; }; + + packageSetsForMachine = machine: packageSetsWith { + inherit (machine) system; + overlays = overlays ++ (machineOverlays.${machine.name} or [ ]); + }; + inherit (nixpkgs) lib; in { nixosConfigurations = lib.mergeAttrsList (map (machine: { ${machine.name} = nixpkgs.lib.nixosSystem { specialArgs = inputs // { - inherit (packageSetsForSystem machine.system) unstablePkgs auxiliaryPkgs; + inherit (packageSetsForMachine machine) unstablePkgs auxiliaryPkgs; inherit machines; me = machine // { is = mkMachineIdentities machines machine; }; keys = import ./secrets/keys.nix; @@ -103,7 +132,7 @@ modules = [ nixpkgs.nixosModules.readOnlyPkgs - { nixpkgs.pkgs = (packageSetsForSystem machine.system).pkgs; } + { nixpkgs.pkgs = (packageSetsForMachine machine).pkgs; } ./machines/${machine.name} -- cgit 1.4.1