diff --git a/examples/devos/flake.nix b/examples/devos/flake.nix index 02db321b3..4c5e8fb35 100644 --- a/examples/devos/flake.nix +++ b/examples/devos/flake.nix @@ -73,7 +73,13 @@ }; nixpkgs-darwin-stable = { imports = [ (digga.lib.importOverlays ./overlays) ]; - overlays = [ ]; + overlays = [ + # TODO: restructure overlays directory for per-channel overrides + # `importOverlays` will import everything under the path given + (channels: final: prev: { + inherit (channels.latest) mas; + } // prev.lib.optionalAttrs true { }) + ]; }; latest = { }; }; diff --git a/examples/devos/hosts/darwin/Mac.nix b/examples/devos/hosts/darwin/Mac.nix index a44314ecc..80fb0794a 100644 --- a/examples/devos/hosts/darwin/Mac.nix +++ b/examples/devos/hosts/darwin/Mac.nix @@ -3,4 +3,8 @@ { imports = with suites; base; + + # The `mas` package is included here as a test for platform-specific package + # support in Digga. Feel free to remove it in your config. + environment.systemPackages = with pkgs; [mas]; } diff --git a/flake.lock b/flake.lock index 510763bab..e95737995 100644 --- a/flake.lock +++ b/flake.lock @@ -130,15 +130,16 @@ "flake-utils": "flake-utils_2" }, "locked": { - "lastModified": 1657226504, - "narHash": "sha256-GIYNjuq4mJlFgqKsZ+YrgzWm0IpA4axA3MCrdKYj7gs=", + "lastModified": 1654029967, + "narHash": "sha256-my3GQ3mQIw/1f6GPV1IhUZrcYQSWh0YJAMPNBjhXJDw=", "owner": "gytis-ivaskevicius", "repo": "flake-utils-plus", - "rev": "2bf0f91643c2e5ae38c1b26893ac2927ac9bd82a", + "rev": "6271cf3842ff9c8a9af9e3508c547f86bc77d199", "type": "github" }, "original": { "owner": "gytis-ivaskevicius", + "ref": "refs/pull/120/head", "repo": "flake-utils-plus", "type": "github" } diff --git a/flake.nix b/flake.nix index b2b686d45..79b11d42a 100644 --- a/flake.nix +++ b/flake.nix @@ -28,7 +28,7 @@ devshell.url = "github:numtide/devshell"; devshell.inputs.nixpkgs.follows = "nixpkgs"; - flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus"; + flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus/?ref=refs/pull/120/head"; flake-compat = { url = "github:edolstra/flake-compat"; diff --git a/src/mkFlake/fup-adapter.nix b/src/mkFlake/fup-adapter.nix index 19f76eb8b..cf57e3299 100644 --- a/src/mkFlake/fup-adapter.nix +++ b/src/mkFlake/fup-adapter.nix @@ -41,7 +41,12 @@ let }) ]; - unifyOverlays = channels: map (o: if builtins.isFunction (o null null) then o channels else o); + unifyOverlays = channels: + let + getChannel = inputs."${channelName}".legacyPackages.x86_64-linux; + channelName = builtins.elemAt (builtins.attrNames channels) 0; + in + map (o: if builtins.isFunction (o getChannel getChannel) then o channels else o); stripChannel = channel: removeAttrs channel [ # arguments in our channels api that shouldn't be passed to fup