feat(flake, eat): remove flake-parts, add eat

This commit is contained in:
Artur Manuel 2025-03-16 20:04:03 +00:00
commit 465da6e488
Signed by: amadaluzia
SSH key fingerprint: SHA256:Zwg7gBuZyaG48ucAZneJwltiXu0+tJb7c3lYt9AYlLg
4 changed files with 86 additions and 102 deletions

View file

@ -1,5 +1,6 @@
;; -*- lexical-binding: t -*-
(use-package emacs
:init
(setq frame-resize-pixelwise t
@ -29,20 +30,21 @@
:hook (prog-mode . display-line-numbers-mode))
(use-package mood-line
:hook (after-init . mood-line-mode))
:hook after-init)
(use-package helm
:bind (("C-x C-f" . helm-find-files)
("M-x" . helm-M-x)
("M-s o" . helm-occur)
("C-h a" . helm-apropos))
:hook (after-init . helm-mode))
("C-h a" . helm-apropos)
("C-x b" . helm-buffers))
:hook after-init)
(use-package savehist
:hook (after-init . savehist-mode))
:hook after-init)
(use-package which-key
:hook (after-init . which-key-mode))
:hook after-init)
(use-package base16-theme
:config
@ -54,8 +56,9 @@
(use-package rust-mode
:mode "\\.rs\\'")
(when (executable-find "direnv")
(use-package envrc
:hook (after-init . envrc-global-mode))
:hook after-init))
(use-package eglot
:hook (prog-mode . eglot-ensure))
@ -74,19 +77,15 @@
:config
(setq c-basic-offset 4))
(use-package vterm
:preface
(defun project-vterm (&optional arg)
(interactive)
(let* ((default-directory (project-root (project-current 1)))
(vterm-buffer-name (project-prefixed-buffer-name "vterm")))
(vterm arg)))
:bind (("C-x p t" . project-vterm)
("C-c t" . vterm)))
(use-package eat
:bind (("C-x p t" . eat-project)
("C-c t" . eat)))
(use-package spacious-padding
:config
(spacious-padding-mode)
)
(spacious-padding-mode))
(use-package notmuch
:if (executable-find "notmuch"))
(provide 'config)

23
flake.lock generated
View file

@ -53,31 +53,10 @@
"type": "github"
}
},
"parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1741352980,
"narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"root": {
"inputs": {
"emacs": "emacs",
"nixpkgs": "nixpkgs",
"parts": "parts"
"nixpkgs": "nixpkgs"
}
}
},

View file

@ -2,35 +2,36 @@
description = "Pankomacs";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
emacs = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs:
inputs.parts.lib.mkFlake {
inherit inputs;
} {
outputs =
inputs:
let
inherit (inputs.nixpkgs) lib;
systems = [
"x86_64-linux"
];
imports = [
./lib.nix
];
perSystem = {pkgs, ...}: {
formatter = pkgs.alejandra;
packages = {
pgtk = inputs.self.lib.mkEmacs {
inherit pkgs;
emacs = pkgs.emacs30-pgtk;
};
forAllSystems = lib.genAttrs systems;
pkgs = builtins.listToAttrs (
map (system: {
name = system;
value = import inputs.nixpkgs {
inherit system;
};
}) systems
);
in
{
lib = import ./lib.nix inputs;
formatter = forAllSystems (system: pkgs.${system}.nixfmt-rfc-style);
packages = forAllSystems (system: {
pgtk = inputs.self.lib.mkPankomacs {
pkgs = pkgs.${system};
emacs = pkgs.${system}.emacs30-pgtk;
};
});
};
}

51
lib.nix
View file

@ -1,22 +1,21 @@
{inputs, ...}: {
flake.lib = inputs.nixpkgs.lib.extend (_: _: let
mkEmacsPackage = {
inputs:
let
mkEmacsPackage =
{
epkgs,
pname,
version,
src,
deps ? [],
deps ? (epkgs: [ ]),
}:
epkgs.callPackage (
{trivialBuild}:
trivialBuild {
epkgs.trivialBuild {
inherit pname version src;
buildInputs = deps;
propagatedUserEnvPkgs = deps;
}
) {inherit (epkgs) trivialBuild;};
buildInputs = deps epkgs;
propagatedUserEnvPkgs = deps epkgs;
};
mkEmacs = {
mkPankomacs =
{
pkgs,
emacs,
}:
@ -24,10 +23,10 @@
package = emacs;
defaultInitFile = true;
config = ./config.el;
extraEmacsPackages = epkgs:
extraEmacsPackages =
epkgs:
builtins.attrValues {
inherit
(epkgs)
inherit (epkgs)
spacious-padding
mood-line
helm
@ -37,21 +36,27 @@
haskell-mode
qml-mode
envrc
vterm
eat
notmuch
;
treesit-grammars = epkgs.treesit-grammars.with-all-grammars;
};
override = _: prev:
builtins.listToAttrs (map (name: {
override =
_: prev:
builtins.listToAttrs (
map
(name: {
inherit name;
value = prev.emacs;
}) [
})
[
"use-package"
"savehist"
"which-key"
]);
]
);
};
in {
inherit mkEmacs mkEmacsPackage;
});
in
{
inherit mkPankomacs mkEmacsPackage;
}