diff --git a/checks.nix b/checks.nix index 949d435..18cc82b 100644 --- a/checks.nix +++ b/checks.nix @@ -2,6 +2,7 @@ { self, nixpkgs, emacs-overlay, ... }@inputs: let + inherit (self.outputs.packages.${system}) doom-emacs-example; pkgs = import nixpkgs { inherit system; # we are not using emacs-overlay's flake.nix here, @@ -32,13 +33,8 @@ in }; }; }).activationPackage; - init-example-el = self.outputs.package.${system} { - doomPrivateDir = ./test/doom.d; - dependencyOverrides = inputs; - }; - init-example-el-emacsGit = self.outputs.package.${system} { - doomPrivateDir = ./test/doom.d; - dependencyOverrides = inputs; + init-example-el = doom-emacs-example; + init-example-el-emacsGit = doom-emacs-example.override { emacsPackages = with pkgs; emacsPackagesFor emacsGit; }; init-example-el-splitdir = self.outputs.package.${system} { diff --git a/default.nix b/default.nix index 48b9972..c3671c2 100644 --- a/default.nix +++ b/default.nix @@ -50,13 +50,13 @@ See overrides.nix for addition examples. Example: - emacsPackagesOverlay = self: super: { + emacsPackagesOverlay = final: prev: { magit-delta = super.magit-delta.overrideAttrs (esuper: { buildInputs = esuper.buildInputs ++ [ pkgs.git ]; }); }; */ -, emacsPackagesOverlay ? self: super: { } +, emacsPackagesOverlay ? final: prev: { } /* Use bundled revision of github.com/nix-community/emacs-overlay as `emacsPackages`. */ diff --git a/flake.nix b/flake.nix index 6bf8ff5..dc2eecd 100644 --- a/flake.nix +++ b/flake.nix @@ -2,8 +2,8 @@ { inputs = { - home-manager.url = "github:rycee/home-manager"; - nix-doom-emacs.url = "github:nix-community/nix-doom-emacs/flake"; + home-manager.url = "github:nix-community/home-manager"; + nix-doom-emacs.url = "github:nix-community/nix-doom-emacs"; }; outputs = { @@ -88,18 +88,39 @@ flake-compat.flake = false; }; - outputs = { self, nixpkgs, flake-utils, emacs-overlay, ... }@inputs: - let inherit (flake-utils.lib) eachDefaultSystem eachSystem; + outputs = { self, nixpkgs, flake-utils, ... }@inputs: + let inherit (flake-utils.lib) eachDefaultSystem mkApp; in eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; in { - devShell = pkgs.mkShell { + apps = { + default = self.outputs.apps.${system}.doom-emacs-example; + doom-emacs-example = mkApp { + drv = self.outputs.packages.${system}.doom-emacs-example; + exePath = "/bin/emacs"; + }; + }; + + devShells.default = pkgs.mkShell { buildInputs = [ (pkgs.python3.withPackages (ps: with ps; [ PyGithub ])) ]; }; - package = { dependencyOverrides ? { }, ... }@args: - pkgs.callPackage self - (args // { dependencyOverrides = (inputs // dependencyOverrides); }); + + package = { ... }@args: + pkgs.lib.warn '' + nix-doom-emacs no longer supports the deprecated `package` flake output. + It will be removed after the release of NixOS 23.05. + + Please use `packages.${system}.default.override { ... }` instead! + '' + (pkgs.callPackage self args); + + packages = { + default = self.outputs.packages.${system}.doom-emacs-example; + doom-emacs-example = pkgs.callPackage self { + doomPrivateDir = ./test/doom.d; + }; + }; checks = import ./checks.nix { inherit system; } inputs; }) // { hmModule = import ./modules/home-manager.nix inputs; diff --git a/modules/home-manager.nix b/modules/home-manager.nix index 7aade02..49b4dd1 100644 --- a/modules/home-manager.nix +++ b/modules/home-manager.nix @@ -87,10 +87,10 @@ in package customization. ''; type = with types; overlayType; - default = self: super: { }; - defaultText = "self: super { }"; + default = final: prev: { }; + defaultText = "final: prev: { }"; example = literalExample '' - self: super: { + final: prev: { magit-delta = super.magit-delta.overrideAttrs (esuper: { buildInputs = esuper.buildInputs ++ [ pkgs.git ]; }); diff --git a/overrides.nix b/overrides.nix index 08f15c5..fa4d63d 100644 --- a/overrides.nix +++ b/overrides.nix @@ -11,7 +11,7 @@ self: super: { doom-snippets = self.straightBuild { pname = "doom-snippets"; postInstall = '' - cp -r *-mode $out/share/emacs/site-lisp + cp -r *-mode $out/share/emacs/site-lisp ''; };