2024-04-28 12:26:05 +10:00
|
|
|
# Copyright 2024 Google LLC
|
|
|
|
|
#
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
#
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
#
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
2024-03-04 01:29:47 +11:00
|
|
|
{
|
|
|
|
|
inputs = {
|
|
|
|
|
nixpkgs.url = "nixpkgs";
|
|
|
|
|
doomemacs = {
|
|
|
|
|
url = "github:doomemacs/doomemacs";
|
|
|
|
|
flake = false;
|
|
|
|
|
};
|
2024-03-18 20:52:48 +11:00
|
|
|
emacs-overlay = {
|
|
|
|
|
url = "github:nix-community/emacs-overlay";
|
|
|
|
|
inputs = {
|
|
|
|
|
nixpkgs-stable.follows = "nixpkgs";
|
|
|
|
|
};
|
|
|
|
|
};
|
2024-03-04 01:29:47 +11:00
|
|
|
};
|
|
|
|
|
|
2024-04-06 23:41:35 +11:00
|
|
|
outputs = { doomemacs, nixpkgs, emacs-overlay, ... }: let
|
|
|
|
|
systems = [ "x86_64-linux" ];
|
|
|
|
|
perSystemPackages = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
|
2024-05-04 22:48:11 +10:00
|
|
|
# Hack to avoid pkgs.extend having to instantiate an additional nixpkgs.
|
|
|
|
|
#
|
|
|
|
|
# We need emacsPackagesFor from the overlay, but neither the overlay itself
|
|
|
|
|
# (it only uses "super", not "self") nor us actually needs anything overlaid
|
|
|
|
|
# on nixpkgs. So we can call the overlay and pass emacsPackagesFor through
|
|
|
|
|
# directly instead of having pkgs.callPackage do it.
|
|
|
|
|
emacsPackagesForFromOverlay = pkgs: (emacs-overlay.overlays.package {} pkgs).emacsPackagesFor;
|
2024-04-06 23:41:35 +11:00
|
|
|
in {
|
|
|
|
|
packages = perSystemPackages (pkgs:
|
2024-03-04 01:29:47 +11:00
|
|
|
let
|
2024-04-25 23:08:06 +10:00
|
|
|
common = {
|
|
|
|
|
doomSource = doomemacs;
|
2024-04-28 16:54:00 +10:00
|
|
|
# TODO: drop after NixOS 24.05 release.
|
|
|
|
|
emacs = pkgs.emacs29;
|
2024-04-25 23:08:06 +10:00
|
|
|
doomLocalDir = "~/.local/share/nix-doom-unstraightened";
|
2024-05-04 22:48:11 +10:00
|
|
|
emacsPackagesFor = emacsPackagesForFromOverlay pkgs;
|
2024-04-25 23:08:06 +10:00
|
|
|
};
|
2024-04-06 23:41:35 +11:00
|
|
|
in {
|
2024-03-04 01:29:47 +11:00
|
|
|
# Current Doom + NixOS 23.11 requires emacs-overlay: Doom pins
|
|
|
|
|
# emacs-fish-completion, which moved from gitlab to github recently
|
|
|
|
|
# enough stable nixpkgs pulls it from the wrong source.
|
2024-05-04 22:48:11 +10:00
|
|
|
doom-minimal = (pkgs.callPackages ./doom.nix (common // { doomDir = ./doomdirs/minimal; })).doomEmacs;
|
|
|
|
|
doom-full = (pkgs.callPackages ./doom.nix (common // { full = true; doomDir = ./doomdirs/minimal; })).doomEmacs;
|
|
|
|
|
doom-example = (pkgs.callPackages ./doom.nix (common // { doomDir = ./doomdirs/example; })).doomEmacs;
|
|
|
|
|
doom-example-without-loader = (pkgs.callPackages ./doom.nix (common // {
|
2024-04-28 18:58:26 +10:00
|
|
|
doomDir = ./doomdirs/example;
|
|
|
|
|
profileName = "";
|
|
|
|
|
})).doomEmacs;
|
2024-04-06 23:41:35 +11:00
|
|
|
});
|
2024-04-25 23:08:06 +10:00
|
|
|
overlays.default = final: prev:
|
|
|
|
|
let
|
2024-05-04 22:48:11 +10:00
|
|
|
callPackages = args: (final.callPackages ./doom.nix ({
|
2024-04-25 23:08:06 +10:00
|
|
|
doomSource = doomemacs;
|
2024-05-04 22:48:11 +10:00
|
|
|
emacsPackagesFor = emacsPackagesForFromOverlay final;
|
2024-04-27 16:14:28 +10:00
|
|
|
} // args));
|
|
|
|
|
in {
|
|
|
|
|
doomEmacs = args: (callPackages args).doomEmacs;
|
|
|
|
|
emacsWithDoom = args: (callPackages args).emacsWithDoom;
|
2024-04-25 23:08:06 +10:00
|
|
|
};
|
2024-04-29 14:58:41 +10:00
|
|
|
hmModule = import ./home-manager.nix {
|
|
|
|
|
doomSource = doomemacs;
|
|
|
|
|
emacsOverlay = emacs-overlay.overlays.package;
|
|
|
|
|
};
|
2024-03-04 01:29:47 +11:00
|
|
|
};
|
|
|
|
|
}
|