core: add apps

This commit is contained in:
xeals 2021-01-04 12:02:59 +11:00
parent 95e5685f53
commit 0a29cfdf1e
Signed by: xeals
GPG Key ID: A498C7AF27EC6B5C

View File

@ -8,27 +8,39 @@
outputs = { self, nixpkgs, flake-utils }: outputs = { self, nixpkgs, flake-utils }:
let let
inherit (flake-utils.lib) defaultSystems flattenTree; inherit (flake-utils.lib) eachDefaultSystem flattenTree;
inherit (nixpkgs.lib.attrsets) filterAttrs genAttrs mapAttrs; inherit (nixpkgs.lib.attrsets) filterAttrs mapAttrs;
in in
{ {
nixosModules = mapAttrs (_: path: import path) (import ./modules); nixosModules = mapAttrs (_: path: import path) (import ./modules);
overlay = final: prev: {
xeals = nixpkgs.lib.composeExtensions self.overlays.pkgs;
};
overlays = import ./overlays // { overlays = import ./overlays // {
pkgs = final: prev: import ./pkgs/top-level/all-packages.nix { pkgs = prev; }; pkgs = final: prev: import ./pkgs/top-level/all-packages.nix { pkgs = prev; };
}; };
packages = genAttrs defaultSystems
(system: overlay = final: prev: {
xeals = nixpkgs.lib.composeExtensions self.overlays.pkgs;
};
} // eachDefaultSystem (system:
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
xPkgs = import ./pkgs/top-level/all-packages.nix { inherit pkgs; }; xPkgs = import ./pkgs/top-level/all-packages.nix { inherit pkgs; };
mkApp = opts: { type = "app"; } // opts;
in in
filterAttrs rec {
(attr: drv: packages = filterAttrs
builtins.elem system drv.meta.platforms or [ ]) (attr: drv: builtins.elem system (drv.meta.platforms or [ ]))
xPkgs (flattenTree xPkgs);
);
apps = flattenTree {
alacritty = mkApp { program = "${packages.alacritty-ligatures}/bin/alacritty"; };
protonmail-bridge = mkApp { program = "${packages.protonmail-bridge}/bin/protonmail-bridge"; };
protonmail-bridge-headless = mkApp { program = "${packages.protonmail-bridge}/bin/protonmail-bridge"; };
psst = {
cli = mkApp { program = "${packages.psst}/bin/psst-cli"; };
gui = mkApp { program = "${packages.psst}/bin/psst-gui"; };
}; };
spotify-ripper = mkApp { program = "${packages.spotify-ripper}/bin/spotify-ripper"; };
};
});
} }