mirror of
https://github.com/nix-community/emacs-overlay.git
synced 2025-12-06 02:40:25 -08:00
flake.nix: Only expose hydraJobs on x86_64-linux
This commit is contained in:
parent
908711c0c6
commit
8a84e2bfae
1 changed files with 47 additions and 41 deletions
88
flake.nix
88
flake.nix
|
|
@ -17,7 +17,14 @@
|
|||
, nixpkgs
|
||||
, nixpkgs-stable
|
||||
, flake-utils
|
||||
}: {
|
||||
}:
|
||||
let
|
||||
importPkgs = path: attrs: import path (attrs // {
|
||||
config.allowAliases = false;
|
||||
overlays = [ self.overlays.default ];
|
||||
});
|
||||
in
|
||||
{
|
||||
# self: super: must be named final: prev: for `nix flake check` to be happy
|
||||
overlays = {
|
||||
default = final: prev: import ./overlays final prev;
|
||||
|
|
@ -26,41 +33,24 @@
|
|||
};
|
||||
# for backward compatibility, is safe to delete, not referenced anywhere
|
||||
overlay = self.overlays.default;
|
||||
} // flake-utils.lib.eachDefaultSystem (system: (
|
||||
let
|
||||
} // flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
|
||||
let
|
||||
pkgs = importPkgs nixpkgs { inherit system; };
|
||||
inherit (pkgs) lib;
|
||||
in
|
||||
{
|
||||
hydraJobs =
|
||||
let
|
||||
mkHydraJobs = pkgs:
|
||||
let
|
||||
mkEmacsSet = emacs: pkgs.recurseIntoAttrs (
|
||||
lib.filterAttrs
|
||||
(n: v: builtins.typeOf v == "set" && ! lib.isDerivation v)
|
||||
(pkgs.emacsPackagesFor emacs)
|
||||
);
|
||||
|
||||
importPkgs = path: import path {
|
||||
inherit system;
|
||||
config.allowAliases = false;
|
||||
overlays = [ self.overlays.default ];
|
||||
};
|
||||
pkgs = importPkgs nixpkgs;
|
||||
|
||||
inherit (pkgs) lib;
|
||||
overlayAttributes = lib.pipe (import ./. pkgs pkgs) [
|
||||
builtins.attrNames
|
||||
(lib.partition (n: lib.isDerivation pkgs.${n}))
|
||||
];
|
||||
attributesToAttrset = attributes: lib.pipe attributes [
|
||||
(map (n: lib.nameValuePair n pkgs.${n}))
|
||||
lib.listToAttrs
|
||||
];
|
||||
|
||||
in
|
||||
{
|
||||
lib = attributesToAttrset overlayAttributes.wrong;
|
||||
packages = attributesToAttrset overlayAttributes.right;
|
||||
|
||||
hydraJobs =
|
||||
let
|
||||
mkHydraJobs = pkgs: let
|
||||
mkEmacsSet = emacs: pkgs.recurseIntoAttrs (
|
||||
lib.filterAttrs
|
||||
(n: v: builtins.typeOf v == "set" && ! lib.isDerivation v)
|
||||
(pkgs.emacsPackagesFor emacs)
|
||||
);
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
emacsen = {
|
||||
inherit (pkgs) emacsUnstable emacsUnstable-nox;
|
||||
inherit (pkgs) emacsGit emacsGit-nox;
|
||||
|
|
@ -85,17 +75,33 @@
|
|||
}))
|
||||
crossTargets);
|
||||
|
||||
|
||||
packages = mkEmacsSet pkgs.emacs;
|
||||
packages-unstable = mkEmacsSet pkgs.emacsUnstable;
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
"22.11" = mkHydraJobs (importPkgs nixpkgs-stable);
|
||||
"unstable" = mkHydraJobs pkgs;
|
||||
};
|
||||
in
|
||||
{
|
||||
"22.11" = mkHydraJobs (importPkgs nixpkgs-stable { inherit system; });
|
||||
"unstable" = mkHydraJobs pkgs;
|
||||
};
|
||||
}) // flake-utils.lib.eachDefaultSystem (system: (
|
||||
let
|
||||
pkgs = importPkgs nixpkgs { inherit system; };
|
||||
inherit (pkgs) lib;
|
||||
|
||||
overlayAttributes = lib.pipe (import ./. pkgs pkgs) [
|
||||
builtins.attrNames
|
||||
(lib.partition (n: lib.isDerivation pkgs.${n}))
|
||||
];
|
||||
attributesToAttrset = attributes: lib.pipe attributes [
|
||||
(map (n: lib.nameValuePair n pkgs.${n}))
|
||||
lib.listToAttrs
|
||||
];
|
||||
|
||||
in
|
||||
{
|
||||
lib = attributesToAttrset overlayAttributes.wrong;
|
||||
packages = attributesToAttrset overlayAttributes.right;
|
||||
}
|
||||
));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue