mirror of
https://github.com/nix-community/emacs-overlay.git
synced 2025-12-15 15:21:01 -08:00
Merge pull request #331 from nix-community/align-attr-names
Align with nixpkgs attribute syntax since https://github.com/NixOS/nixpkgs/pull/233301
This commit is contained in:
commit
609869d20b
2 changed files with 87 additions and 81 deletions
24
flake.nix
24
flake.nix
|
|
@ -34,27 +34,23 @@
|
|||
# for backward compatibility, is safe to delete, not referenced anywhere
|
||||
overlay = self.overlays.default;
|
||||
} // 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.lib.filterAttrs
|
||||
(n: v: builtins.typeOf v == "set" && ! pkgs.lib.isDerivation v)
|
||||
(pkgs.emacsPackagesFor emacs)
|
||||
);
|
||||
|
||||
in
|
||||
{
|
||||
emacsen = {
|
||||
inherit (pkgs) emacsUnstable emacsUnstable-nox;
|
||||
inherit (pkgs) emacsGit emacsGit-nox;
|
||||
inherit (pkgs) emacsPgtk;
|
||||
inherit (pkgs) emacs-unstable emacs-unstable-nox;
|
||||
inherit (pkgs) emacs-git emacs-git-nox;
|
||||
inherit (pkgs) emacs-pgtk;
|
||||
};
|
||||
|
||||
emacsen-cross =
|
||||
|
|
@ -69,20 +65,20 @@
|
|||
in
|
||||
lib.mapAttrs' (name: job: lib.nameValuePair "${name}-${target}" job)
|
||||
({
|
||||
inherit (targetPkgs) emacsUnstable emacsUnstable-nox;
|
||||
inherit (targetPkgs) emacsGit emacsGit-nox;
|
||||
inherit (targetPkgs) emacsPgtk;
|
||||
inherit (targetPkgs) emacs-unstable emacs-unstable-nox;
|
||||
inherit (targetPkgs) emacs-git emacs-git-nox;
|
||||
inherit (targetPkgs) emacs-pgtk;
|
||||
}))
|
||||
crossTargets);
|
||||
|
||||
packages = mkEmacsSet pkgs.emacs;
|
||||
packages-unstable = mkEmacsSet pkgs.emacsUnstable;
|
||||
packages-unstable = mkEmacsSet pkgs.emacs-unstable;
|
||||
};
|
||||
|
||||
in
|
||||
{
|
||||
"22.11" = mkHydraJobs (importPkgs nixpkgs-stable { inherit system; });
|
||||
"unstable" = mkHydraJobs pkgs;
|
||||
"unstable" = mkHydraJobs (importPkgs nixpkgs { inherit system; };);
|
||||
};
|
||||
}) // flake-utils.lib.eachDefaultSystem (system: (
|
||||
let
|
||||
|
|
|
|||
|
|
@ -88,11 +88,22 @@ let
|
|||
)
|
||||
]);
|
||||
|
||||
emacsGit = let base = (super.lib.makeOverridable (mkGitEmacs "emacs-git" ../repos/emacs/emacs-master.json) { withSQLite3 = true; withWebP = true; });
|
||||
# TODO: remove when we drop support for < 23.05, and instead move withTreeSitter to the above line with the other arguments
|
||||
maybeOverridden = if super.lib.hasAttr "treeSitter" base then base.override { withTreeSitter = true; } else base;
|
||||
in
|
||||
maybeOverridden.overrideAttrs (
|
||||
emacs-git = let base = (super.lib.makeOverridable (mkGitEmacs "emacs-git" ../repos/emacs/emacs-master.json) { withSQLite3 = true; withWebP = true; });
|
||||
# TODO: remove when we drop support for < 23.05, and instead move withTreeSitter to the above line with the other arguments
|
||||
maybeOverridden = if super.lib.hasAttr "treeSitter" base then base.override { withTreeSitter = true; } else base;
|
||||
in
|
||||
maybeOverridden.overrideAttrs (
|
||||
oa: {
|
||||
patches = oa.patches ++ [
|
||||
# XXX: #318
|
||||
./bytecomp-revert.patch
|
||||
]; }
|
||||
);
|
||||
|
||||
emacs-pgtk = let base = super.lib.makeOverridable (mkGitEmacs "emacs-pgtk" ../repos/emacs/emacs-master.json) { withSQLite3 = true; withWebP = true; withPgtk = true; };
|
||||
# TODO: remove when we drop support for < 23.05, and instead move withTreeSitter to the above line with the other arguments
|
||||
maybeOverridden = if super.lib.hasAttr "treeSitter" base then base.override { withTreeSitter = true; } else base;
|
||||
in maybeOverridden.overrideAttrs (
|
||||
oa: {
|
||||
patches = oa.patches ++ [
|
||||
# XXX: #318
|
||||
|
|
@ -100,81 +111,80 @@ let
|
|||
]; }
|
||||
);
|
||||
|
||||
emacsPgtk = let base = super.lib.makeOverridable (mkGitEmacs "emacs-pgtk" ../repos/emacs/emacs-master.json) { withSQLite3 = true; withWebP = true; withPgtk = true; };
|
||||
# TODO: remove when we drop support for < 23.05, and instead move withTreeSitter to the above line with the other arguments
|
||||
maybeOverridden = if super.lib.hasAttr "treeSitter" base then base.override { withTreeSitter = true; } else base;
|
||||
in maybeOverridden.overrideAttrs (
|
||||
oa: {
|
||||
patches = oa.patches ++ [
|
||||
# XXX: #318
|
||||
./bytecomp-revert.patch
|
||||
]; }
|
||||
);
|
||||
emacs-unstable = let base = super.lib.makeOverridable (mkGitEmacs "emacs-unstable" ../repos/emacs/emacs-unstable.json) { withSQLite3 = true; withWebP = true; };
|
||||
# TODO: remove when we drop support for < 23.05, and instead move withTreeSitter to the above line with the other arguments
|
||||
maybeOverridden = if super.lib.hasAttr "treeSitter" base then base.override { withTreeSitter = true; } else base;
|
||||
in maybeOverridden;
|
||||
|
||||
emacsUnstable = let base = super.lib.makeOverridable (mkGitEmacs "emacs-unstable" ../repos/emacs/emacs-unstable.json) { withSQLite3 = true; withWebP = true; };
|
||||
# TODO: remove when we drop support for < 23.05, and instead move withTreeSitter to the above line with the other arguments
|
||||
maybeOverridden = if super.lib.hasAttr "treeSitter" base then base.override { withTreeSitter = true; } else base;
|
||||
in maybeOverridden;
|
||||
emacs-unstable-pgtk = let base = super.lib.makeOverridable (mkGitEmacs "emacs-unstable" ../repos/emacs/emacs-unstable.json) { withSQLite3 = true; withWebP = true; withPgtk = true; };
|
||||
# TODO: remove when we drop support for < 23.05, and instead move withTreeSitter to the above line with the other arguments
|
||||
maybeOverridden = if super.lib.hasAttr "treeSitter" base then base.override { withTreeSitter = true; } else base;
|
||||
in maybeOverridden;
|
||||
|
||||
emacsUnstablePgtk = let base = super.lib.makeOverridable (mkGitEmacs "emacs-unstable" ../repos/emacs/emacs-unstable.json) { withSQLite3 = true; withWebP = true; withPgtk = true; };
|
||||
# TODO: remove when we drop support for < 23.05, and instead move withTreeSitter to the above line with the other arguments
|
||||
maybeOverridden = if super.lib.hasAttr "treeSitter" base then base.override { withTreeSitter = true; } else base;
|
||||
in maybeOverridden;
|
||||
emacs-lsp = let base = super.lib.makeOverridable (mkGitEmacs "emacs-lsp" ../repos/emacs/emacs-lsp.json) { };
|
||||
# TODO: remove when we drop support for < 23.05, and instead move withTreeSitter to the above line with the other arguments
|
||||
maybeOverridden = if super.lib.hasAttr "treeSitter" base then base.override { withTreeSitter = false; } else base;
|
||||
in maybeOverridden;
|
||||
|
||||
emacsLsp = let base = super.lib.makeOverridable (mkGitEmacs "emacs-lsp" ../repos/emacs/emacs-lsp.json) { };
|
||||
# TODO: remove when we drop support for < 23.05, and instead move withTreeSitter to the above line with the other arguments
|
||||
maybeOverridden = if super.lib.hasAttr "treeSitter" base then base.override { withTreeSitter = false; } else base;
|
||||
in maybeOverridden;
|
||||
emacs-git-nox = (
|
||||
(
|
||||
emacs-git.override {
|
||||
withNS = false;
|
||||
withX = false;
|
||||
withGTK2 = false;
|
||||
withGTK3 = false;
|
||||
withWebP = false;
|
||||
}
|
||||
).overrideAttrs (
|
||||
oa: {
|
||||
name = "${oa.name}-nox";
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
emacs-unstable-nox = (
|
||||
(
|
||||
emacs-unstable.override {
|
||||
withNS = false;
|
||||
withX = false;
|
||||
withGTK2 = false;
|
||||
withGTK3 = false;
|
||||
withWebP = false;
|
||||
}
|
||||
).overrideAttrs (
|
||||
oa: {
|
||||
name = "${oa.name}-nox";
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
in
|
||||
{
|
||||
inherit emacsGit emacsUnstable;
|
||||
inherit emacs-git emacs-unstable;
|
||||
|
||||
inherit emacsPgtk emacsUnstablePgtk;
|
||||
inherit emacs-pgtk emacs-unstable-pgtk;
|
||||
|
||||
emacsGit-nox = (
|
||||
(
|
||||
emacsGit.override {
|
||||
withNS = false;
|
||||
withX = false;
|
||||
withGTK2 = false;
|
||||
withGTK3 = false;
|
||||
withWebP = false;
|
||||
}
|
||||
).overrideAttrs (
|
||||
oa: {
|
||||
name = "${oa.name}-nox";
|
||||
}
|
||||
)
|
||||
);
|
||||
inherit emacs-git-nox emacs-unstable-nox;
|
||||
|
||||
emacsUnstable-nox = (
|
||||
(
|
||||
emacsUnstable.override {
|
||||
withNS = false;
|
||||
withX = false;
|
||||
withGTK2 = false;
|
||||
withGTK3 = false;
|
||||
withWebP = false;
|
||||
}
|
||||
).overrideAttrs (
|
||||
oa: {
|
||||
name = "${oa.name}-nox";
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
inherit emacsLsp;
|
||||
inherit emacs-lsp;
|
||||
|
||||
emacsWithPackagesFromUsePackage = import ../elisp.nix { pkgs = self; };
|
||||
|
||||
emacsWithPackagesFromPackageRequires = import ../packreq.nix { pkgs = self; };
|
||||
|
||||
} // super.lib.optionalAttrs (super.config.allowAliases or true) {
|
||||
emacsGcc = builtins.trace "emacsGcc has been renamed to emacsGit, please update your expression." emacsGit;
|
||||
emacsGitNativeComp = builtins.trace "emacsGitNativeComp has been renamed to emacsGit, please update your expression." emacsGit;
|
||||
emacsGitTreeSitter = builtins.trace "emacsGitTreeSitter has been renamed to emacsGit, please update your expression." emacsGit;
|
||||
emacsNativeComp = builtins.trace "emacsNativeComp has been renamed to emacsUnstable, please update your expression." emacsUnstable;
|
||||
emacsPgtkGcc = builtins.trace "emacsPgtkGcc has been renamed to emacsPgtk, please update your expression." emacsPgtk;
|
||||
emacsPgtkNativeComp = builtins.trace "emacsPgtkNativeComp has been renamed to emacsPgtk, please update your expression." emacsPgtk;
|
||||
emacsGcc = builtins.trace "emacsGcc has been renamed to emacs-git, please update your expression." emacs-git;
|
||||
emacsGitNativeComp = builtins.trace "emacsGitNativeComp has been renamed to emacs-git, please update your expression." emacs-git;
|
||||
emacsGitTreeSitter = builtins.trace "emacsGitTreeSitter has been renamed to emacs-git, please update your expression." emacs-git;
|
||||
emacsNativeComp = builtins.trace "emacsNativeComp has been renamed to emacs-unstable, please update your expression." emacs-unstable;
|
||||
emacsPgtkGcc = builtins.trace "emacsPgtkGcc has been renamed to emacs-pgtk, please update your expression." emacs-pgtk;
|
||||
emacsPgtkNativeComp = builtins.trace "emacsPgtkNativeComp has been renamed to emacs-pgtk, please update your expression." emacs-pgtk;
|
||||
|
||||
emacsGit = builtins.trace "emacsGit has been renamed to emacs-git, please update your expression." emacs-git;
|
||||
emacsUnstable = builtins.trace "emacsUnstable has been renamed to emacs-unstable, please update your expression." emacs-unstable;
|
||||
emacsPgtk = builtins.trace "emacsPgtk has been renamed to emacs-pgtk, please update your expression." emacs-pgtk;
|
||||
emacsUnstablePgtk = builtins.trace "emacsUnstablePgtk has been renamed to emacs-unstable-pgtk, please update your expression." emacs-unstable-pgtk;
|
||||
emacsGitNox = builtins.trace "emacsGitNox has been renamed to emacs-git-nox, please update your expression." emacs-git-nox;
|
||||
emacsUnstableNox = builtins.trace "emacsUnstableNox has been renamed to emacs-unstable-nox, please update your expression." emacs-unstable-nox;
|
||||
emacsLsp = builtins.trace "emacsLsp has been renamed to emacs-lsp, please update your expression." emacs-lsp;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue