feat: refactor emacs package declaring

this is a ton better because:

this makes the flake look cleaner

this means I can declare multiple packages in the flake

without repeating myself as much as i would have had to.
This commit is contained in:
Artur Manuel 2024-09-09 16:34:39 +01:00
commit 95ef7816f0
Failed to generate hash of commit
4 changed files with 105 additions and 84 deletions

View file

@ -11,24 +11,38 @@
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs:
outputs =
inputs:
inputs.parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
];
perSystem = { pkgs, self', config, system, ... }: {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
(import inputs.emacs)
];
perSystem =
{
pkgs,
self',
config,
system,
...
}:
let
inherit (import ./package/mkEmacs.nix pkgs) mkEmacs;
in
{
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
(import inputs.emacs)
];
};
packages = {
pankomacs = mkEmacs pkgs.emacs29-pgtk;
pankomacs-x11 = mkEmacs pkgs.emacs-gtk;
};
formatter = pkgs.nixfmt-rfc-style;
};
packages.pankomacs = pkgs.callPackage ./package { };
packages.default = self'.packages.pankomacs;
formatter = pkgs.nixpkgs-fmt;
};
};
}