diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4f42b66..81d170a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,7 +7,7 @@ on: - update_flake_lock_action jobs: - build-thinkpad: + build: if: ${{ always() }} runs-on: ubuntu-latest steps: diff --git a/flake.nix b/flake.nix index 0e45aa3..4f99b26 100644 --- a/flake.nix +++ b/flake.nix @@ -19,8 +19,8 @@ flake-parts.lib.mkFlake {inherit inputs;} { systems = ["x86_64-linux"]; imports = [ - # flake-parts.flakeModules.easyOverlay ./packages + ./hmModules ./formatter ]; diff --git a/hmModules/default.nix b/hmModules/default.nix index 334f1b1..741f062 100644 --- a/hmModules/default.nix +++ b/hmModules/default.nix @@ -1,7 +1,8 @@ -{self, inputs, ...}: { - flake.overlays.default = self: super: { - ccrEmacs = self.packages.${self.system}.ccrEmacs; - }; +{ + self, + inputs, + ... +}: { flake.hmModules = { default = self.hmModules.ccrEmacs; ccrEmacs = { @@ -22,9 +23,9 @@ ccrEmacsConfig = config.ccrEmacs; in lib.mkIf ccrEmacsConfig.enable { - nixpkgs.overlays = [(self: super: { - ccrEmacs = super.hello; - })]; + nixpkgs.overlays = [ + inputs.emacs-overlay.overlays.default + ]; programs.emacs = { enable = true; package = ccrEmacsConfig.package; @@ -62,13 +63,13 @@ ]); home.activation = { cloneCcrEmacsFlake = lib.hm.dag.entryAfter ["writeBoundary"] '' - PATH=$PATH:${lib.makeBinPath (with pkgs; [ git openssh ])} - if [ ! -d "$HOME/.config/emacs" ]; then - $DRY_RUN_CMD git clone \ - https://github.com/aciceri/emacs.git \ - "$HOME/.config/emacs" - ln -s "$HOME/.config/emacs" "$HOME/emacs" - fi + PATH=$PATH:${lib.makeBinPath (with pkgs; [git openssh])} + if [ ! -d "$HOME/.config/emacs" ]; then + $DRY_RUN_CMD git clone \ + https://github.com/aciceri/emacs.git \ + "$HOME/.config/emacs" + ln -s "$HOME/.config/emacs" "$HOME/emacs" + fi ''; }; }; diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..08193cf --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,7 @@ +{ + perSystem = {config, ...}: { + overlayAttrs = { + inherit (config.packages) ccrEmacs; + }; + }; +} diff --git a/packages/default.nix b/packages/default.nix index cbddcd0..9ed9206 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -1,21 +1,38 @@ {inputs, ...}: { + imports = [ + inputs.flake-parts.flakeModules.easyOverlay + ]; perSystem = { + config, self', inputs', pkgs, + final, ... - }: { + }: let + inherit (inputs.emacs-overlay.overlays.default pkgs pkgs) emacsPackagesFor; + in { packages = { - ccrEmacs = + ccrEmacsWithoutPackages = (inputs'.emacs-overlay.packages.emacsPgtk.override { - treeSitterPlugins = builtins.attrValues (builtins.removeAttrs pkgs.tree-sitter-grammars ["recurseForDerivations"]); + treeSitterPlugins = + builtins.attrValues + (builtins.removeAttrs pkgs.tree-sitter-grammars ["recurseForDerivations"]); }) .overrideAttrs (_: { name = "ccr-emacs-${inputs.emacs-src.rev}"; src = inputs.emacs-src.outPath; version = inputs.emacs-src.rev; }); + ccrEmacs = + (emacsPackagesFor self'.packages.ccrEmacsWithoutPackages).emacsWithPackages + (import ./packages.nix pkgs); default = self'.packages.ccrEmacs; }; + + apps = { + ccrEmacs.program = "${self'.packages.ccrEmacs}/bin/emacs"; + default = self'.apps.ccrEmacs; + }; }; } diff --git a/packages/packages.nix b/packages/packages.nix new file mode 100644 index 0000000..9114ad2 --- /dev/null +++ b/packages/packages.nix @@ -0,0 +1,46 @@ +pkgs: epkgs: +with epkgs; [ + meow + ef-themes + delight + vertico + marginalia + all-the-icons + all-the-icons-completion + consult + orderless + embark + embark-consult + fira-code-mode + vterm + setup + magit + magit-delta + diff-hl + corfu + corfu-terminal + corfu-doc + kind-icon + cape + which-key + nix-mode + envrc + flycheck + flycheck-posframe + flycheck-inline + consult-flycheck + popper + paredit + tree-sitter + tree-sitter-langs + yaml-mode + hl-todo + markdown-mode + haskell-mode + terraform-mode + org-roam-ui + org-roam + dirvish + diredfl + pdf-tools +]