diff --git a/flake.lock b/flake.lock index 218723e..7dc8ffd 100644 --- a/flake.lock +++ b/flake.lock @@ -534,6 +534,27 @@ "type": "github" } }, + "haumea": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1685133229, + "narHash": "sha256-FePm/Gi9PBSNwiDFq3N+DWdfxFq0UKsVVTJS3cQPn94=", + "owner": "nix-community", + "repo": "haumea", + "rev": "34dd58385092a23018748b50f9b23de6266dffc2", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "v0.2.2", + "repo": "haumea", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -1092,6 +1113,7 @@ "darkly": "darkly", "fenix": "fenix", "go-musicfox": "go-musicfox", + "haumea": "haumea", "home-manager": "home-manager_2", "impermanence": "impermanence", "infuse": "infuse", diff --git a/flake.nix b/flake.nix index 9dcabe5..c137c23 100644 --- a/flake.nix +++ b/flake.nix @@ -57,6 +57,9 @@ infuse.url = "git+https://codeberg.org/amjoseph/infuse.nix"; infuse.flake = false; + + haumea.url = "github:nix-community/haumea/v0.2.2"; + haumea.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = @@ -81,12 +84,25 @@ final: prev: { inherit (inputs.home-manager.lib) hm; inherit infuse; + haumea = inputs.haumea.lib; } ); infuse = (import inputs.infuse { inherit (nixpkgs) lib; }).v1.infuse; in { - packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); + packages = forAllSystems ( + system: + lib.haumea.load { + src = ./pkgs; + loader = [ + { + matches = str: builtins.match ".*\\.nix" str != null; + loader = _: path: nixpkgs.legacyPackages.${system}.callPackage path { }; + } + ]; + transformer = lib.haumea.transformers.liftDefault; + } + ); # workaround for "treefmt warning" formatter = forAllSystems ( @@ -108,7 +124,9 @@ } ); - overlays = import ./overlays { inherit inputs infuse; }; + overlays = import ./overlays { + inherit inputs lib; + }; nixosConfigurations = forAllHosts ( hostname: diff --git a/overlays/default.nix b/overlays/default.nix index 0ea4db3..e76c6e5 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,10 +1,24 @@ -{ inputs, infuse, ... }: { - additions = final: prev: import ../pkgs prev; + inputs, + lib, +}: +{ + additions = + final: prev: + lib.haumea.load { + src = ../pkgs; + loader = [ + { + matches = str: builtins.match ".*\\.nix" str != null; + loader = _: path: final.callPackage path { }; + } + ]; + transformer = lib.haumea.transformers.liftDefault; + }; modifications = final: prev: - infuse prev { + lib.infuse prev { cage.__output.patches.__append = [ ./cage-specify-output-name.patch ]; matrix-synapse.__assign = final.stable.matrix-synapse; bottles.__input.removeWarningPopup.__assign = true; diff --git a/pkgs/default.nix b/pkgs/default.nix deleted file mode 100644 index 6b7b3aa..0000000 --- a/pkgs/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -pkgs: -let - packages = [ - "win11-icon-theme" - "mono-gtk-theme" - "fcitx5-themes" - "fcitx5-lightly" - "fluent-fcitx5" - "wps-office-fonts" - "ttf-wps-fonts" - "translate-shell" - ]; -in -pkgs.lib.genAttrs packages (package: pkgs.callPackage ./${package}.nix { }) diff --git a/pkgs/fcitx5-lightly.nix b/pkgs/fcitx5-lightly/default.nix similarity index 100% rename from pkgs/fcitx5-lightly.nix rename to pkgs/fcitx5-lightly/default.nix diff --git a/pkgs/lightly/arrow.png b/pkgs/fcitx5-lightly/lightly/arrow.png similarity index 100% rename from pkgs/lightly/arrow.png rename to pkgs/fcitx5-lightly/lightly/arrow.png diff --git a/pkgs/lightly/highlight.png b/pkgs/fcitx5-lightly/lightly/highlight.png similarity index 100% rename from pkgs/lightly/highlight.png rename to pkgs/fcitx5-lightly/lightly/highlight.png diff --git a/pkgs/lightly/line.png b/pkgs/fcitx5-lightly/lightly/line.png similarity index 100% rename from pkgs/lightly/line.png rename to pkgs/fcitx5-lightly/lightly/line.png diff --git a/pkgs/lightly/mask.png b/pkgs/fcitx5-lightly/lightly/mask.png similarity index 100% rename from pkgs/lightly/mask.png rename to pkgs/fcitx5-lightly/lightly/mask.png diff --git a/pkgs/lightly/next.png b/pkgs/fcitx5-lightly/lightly/next.png similarity index 100% rename from pkgs/lightly/next.png rename to pkgs/fcitx5-lightly/lightly/next.png diff --git a/pkgs/lightly/panel.png b/pkgs/fcitx5-lightly/lightly/panel.png similarity index 100% rename from pkgs/lightly/panel.png rename to pkgs/fcitx5-lightly/lightly/panel.png diff --git a/pkgs/lightly/prev.png b/pkgs/fcitx5-lightly/lightly/prev.png similarity index 100% rename from pkgs/lightly/prev.png rename to pkgs/fcitx5-lightly/lightly/prev.png diff --git a/pkgs/lightly/radio.png b/pkgs/fcitx5-lightly/lightly/radio.png similarity index 100% rename from pkgs/lightly/radio.png rename to pkgs/fcitx5-lightly/lightly/radio.png diff --git a/pkgs/lightly/theme.conf b/pkgs/fcitx5-lightly/lightly/theme.conf similarity index 100% rename from pkgs/lightly/theme.conf rename to pkgs/fcitx5-lightly/lightly/theme.conf