Working on Emacs
This commit is contained in:
parent
f4b2a68ba0
commit
b4d239d34b
10 changed files with 186 additions and 116 deletions
|
@ -3,10 +3,10 @@
|
|||
A complete, declarative and reproducible configuration of my entire
|
||||
Nix fleet, this includes the following machines:
|
||||
|
||||
- my main home workstation ~pc~
|
||||
- homeserver (mainly a nas) ~hs~ *(to do, soon)*
|
||||
- my arm based [[https://wiki.pine64.org/wiki/Pinebook_Pro][PineBook Pro]] ~pbp~, almost completely open hardware
|
||||
- MacBook PRO that I use for work, for this I'll use [[https://github.com/LnL7/nix-darwin][nix-darwin]] keeping macOs 11 Big Sur *(to do, not soon)*
|
||||
- [X] my main home workstation ~pc~
|
||||
- [ ] homeserver (mainly a nas) ~hs~
|
||||
- [X] my arm based [[https://wiki.pine64.org/wiki/Pinebook_Pro][PineBook Pro]] ~pbp~, almost completely open hardware
|
||||
- [X] MacBook PRO that I use for work, for this I'll use [[https://github.com/LnL7/nix-darwin][nix-darwin]] keeping macOs 11 Big Sur
|
||||
|
||||
The different confgurations share many profiles, in fact my original
|
||||
goal was to avoid to rewrite the same Nix derivations for my
|
||||
|
|
220
flake.nix
220
flake.nix
|
@ -63,132 +63,132 @@
|
|||
, ...
|
||||
} @ inputs:
|
||||
|
||||
digga.lib.mkFlake
|
||||
{
|
||||
inherit self inputs;
|
||||
digga.lib.mkFlake
|
||||
{
|
||||
inherit self inputs;
|
||||
|
||||
channelsConfig = { allowUnfree = true; };
|
||||
channelsConfig = { allowUnfree = true; };
|
||||
|
||||
channels =
|
||||
let
|
||||
commonOverlays = [
|
||||
digga.overlays.patchedNix
|
||||
nur.overlay
|
||||
emacs-overlay.overlay
|
||||
nvfetcher.overlay
|
||||
deploy.overlay
|
||||
nixpkgs-wayland.overlay
|
||||
./pkgs/default.nix
|
||||
];
|
||||
in
|
||||
{
|
||||
stable = {
|
||||
imports = [ (digga.lib.importOverlays ./overlays) ];
|
||||
overlays = commonOverlays;
|
||||
};
|
||||
unstable = {
|
||||
imports = [ (digga.lib.importOverlays ./overlays) ];
|
||||
overlays = commonOverlays;
|
||||
};
|
||||
};
|
||||
channels =
|
||||
let
|
||||
commonOverlays = [
|
||||
digga.overlays.patchedNix
|
||||
nur.overlay
|
||||
emacs-overlay.overlay
|
||||
nvfetcher.overlay
|
||||
deploy.overlay
|
||||
nixpkgs-wayland.overlay
|
||||
./pkgs/default.nix
|
||||
];
|
||||
in
|
||||
{
|
||||
stable = {
|
||||
imports = [ (digga.lib.importOverlays ./overlays) ];
|
||||
overlays = commonOverlays;
|
||||
};
|
||||
unstable = {
|
||||
imports = [ (digga.lib.importOverlays ./overlays) ];
|
||||
overlays = commonOverlays;
|
||||
};
|
||||
};
|
||||
|
||||
lib = import ./lib { lib = digga.lib // nixos.lib; };
|
||||
lib = import ./lib { lib = digga.lib // nixos.lib; };
|
||||
|
||||
sharedOverlays = [
|
||||
(
|
||||
final: prev: {
|
||||
__dontExport = true;
|
||||
lib = prev.lib.extend (
|
||||
lfinal: lprev: {
|
||||
our = self.lib;
|
||||
}
|
||||
);
|
||||
}
|
||||
)
|
||||
];
|
||||
sharedOverlays = [
|
||||
(
|
||||
final: prev: {
|
||||
__dontExport = true;
|
||||
lib = prev.lib.extend (
|
||||
lfinal: lprev: {
|
||||
our = self.lib;
|
||||
}
|
||||
);
|
||||
}
|
||||
)
|
||||
];
|
||||
|
||||
nixos = {
|
||||
hostDefaults = {
|
||||
channelName = "unstable";
|
||||
imports = [ (digga.lib.importModules ./modules) ];
|
||||
externalModules = [
|
||||
{ lib.our = self.lib; }
|
||||
digga.nixosModules.bootstrapIso
|
||||
digga.nixosModules.nixConfig
|
||||
home.nixosModules.home-manager
|
||||
bud.nixosModules.bud
|
||||
];
|
||||
};
|
||||
hosts = {
|
||||
# mbp is added bypassing Digga's mkFlake and adding a specific output to this flake
|
||||
pc = {
|
||||
system = "x86_64-linux";
|
||||
imports = [{ modules = ./hosts/pc; }];
|
||||
};
|
||||
pbp = {
|
||||
system = "aarch64-linux";
|
||||
imports = [{ modules = ./hosts/pbp; }];
|
||||
modules = [
|
||||
"${pinebook-pro}/pinebook_pro.nix"
|
||||
nixos = {
|
||||
hostDefaults = {
|
||||
channelName = "unstable";
|
||||
imports = [ (digga.lib.importModules ./modules) ];
|
||||
externalModules = [
|
||||
{ lib.our = self.lib; }
|
||||
digga.nixosModules.bootstrapIso
|
||||
digga.nixosModules.nixConfig
|
||||
home.nixosModules.home-manager
|
||||
bud.nixosModules.bud
|
||||
];
|
||||
};
|
||||
};
|
||||
# imports = [ (digga.lib.importHosts ./hosts) ]; # same reason as above
|
||||
importables = rec {
|
||||
profiles = digga.lib.rakeLeaves ./profiles // {
|
||||
users = digga.lib.rakeLeaves ./users;
|
||||
};
|
||||
suites = with profiles; rec {
|
||||
base = [ core users.ccr users.root ];
|
||||
};
|
||||
pbpKernelLatest = (
|
||||
import pinebook-pro-kernel-latest {
|
||||
hosts = {
|
||||
# mbp is added bypassing Digga's mkFlake and adding a specific output to this flake
|
||||
pc = {
|
||||
system = "x86_64-linux";
|
||||
imports = [ { modules = ./hosts/pc; } ];
|
||||
};
|
||||
pbp = {
|
||||
system = "aarch64-linux";
|
||||
overlays = [
|
||||
(import "${pinebook-pro}/overlay.nix")
|
||||
imports = [ { modules = ./hosts/pbp; } ];
|
||||
modules = [
|
||||
"${pinebook-pro}/pinebook_pro.nix"
|
||||
];
|
||||
config.allowUnfree = true;
|
||||
}
|
||||
).pkgs.linuxPackages_pinebookpro_latest;
|
||||
};
|
||||
};
|
||||
|
||||
home = {
|
||||
imports = [ (digga.lib.importModules ./users/modules) ];
|
||||
externalModules = [ ];
|
||||
importables = rec {
|
||||
profiles = digga.lib.rakeLeaves ./users/profiles;
|
||||
suites = with profiles; rec {
|
||||
base = [ direnv git zsh gpg password-store ];
|
||||
shell = [ zsh exa fzf ];
|
||||
gui = [ sway xdg gtk foot bat ];
|
||||
browser = [ firefox chromium qutebrowser ];
|
||||
multimedia = [ mpv zathura ];
|
||||
dev = [ vim emacs vscode lorri direnv ];
|
||||
};
|
||||
};
|
||||
# imports = [ (digga.lib.importHosts ./hosts) ]; # same reason as above
|
||||
importables = rec {
|
||||
profiles = digga.lib.rakeLeaves ./profiles // {
|
||||
users = digga.lib.rakeLeaves ./users;
|
||||
};
|
||||
suites = with profiles; rec {
|
||||
base = [ core users.ccr users.root ];
|
||||
};
|
||||
pbpKernelLatest = (
|
||||
import pinebook-pro-kernel-latest {
|
||||
system = "aarch64-linux";
|
||||
overlays = [
|
||||
(import "${pinebook-pro}/overlay.nix")
|
||||
];
|
||||
config.allowUnfree = true;
|
||||
}
|
||||
).pkgs.linuxPackages_pinebookpro_latest;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
devshell = ./shell;
|
||||
home = {
|
||||
imports = [ (digga.lib.importModules ./users/modules) ];
|
||||
externalModules = [];
|
||||
importables = rec {
|
||||
profiles = digga.lib.rakeLeaves ./users/profiles;
|
||||
suites = with profiles; rec {
|
||||
base = [ direnv git zsh gpg password-store ];
|
||||
shell = [ zsh exa fzf ];
|
||||
gui = [ sway xdg gtk foot bat ];
|
||||
browser = [ firefox chromium qutebrowser ];
|
||||
multimedia = [ mpv zathura ];
|
||||
dev = [ vim emacs vscode lorri direnv ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations;
|
||||
devshell = ./shell;
|
||||
|
||||
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { };
|
||||
homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations;
|
||||
|
||||
defaultTemplate = self.templates.bud;
|
||||
templates.bud.path = ./.;
|
||||
templates.bud.description = "bud template";
|
||||
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations {};
|
||||
|
||||
defaultTemplate = self.templates.bud;
|
||||
templates.bud.path = ./.;
|
||||
templates.bud.description = "bud template";
|
||||
|
||||
}
|
||||
// {
|
||||
budModules = { devos = import ./bud; };
|
||||
# checks.aarch64-linux = { }; # this line will be uncommented by Github Action in order since it can't build aarch64 derivations
|
||||
}
|
||||
// {
|
||||
budModules = { devos = import ./bud; };
|
||||
# checks.aarch64-linux = { }; # this line will be uncommented by Github Action in order since it can't build aarch64 derivations
|
||||
}
|
||||
// {
|
||||
darwinConfigurations."mbp" = darwin.lib.darwinSystem {
|
||||
system = "x86_64-darwin";
|
||||
modules = [ home.darwinModules.home-manager ./hosts/mbp ];
|
||||
inputs = { inherit darwin; };
|
||||
// {
|
||||
darwinConfigurations."mbp" = darwin.lib.darwinSystem {
|
||||
system = "x86_64-darwin";
|
||||
modules = [ home.darwinModules.home-manager ./hosts/mbp ];
|
||||
inputs = { inherit darwin; };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -14,15 +14,20 @@ emacsWithPackages (
|
|||
evil-collection
|
||||
helm
|
||||
projectile
|
||||
helm-projectile
|
||||
magit
|
||||
company
|
||||
helm-company
|
||||
fira-code-mode
|
||||
org-superstar
|
||||
nix-mode
|
||||
lsp-python-ms
|
||||
lispy
|
||||
lsp-mode
|
||||
dap-mode
|
||||
which-key
|
||||
sudo-utils
|
||||
rainbow-delimiters
|
||||
treemacs
|
||||
treemacs-evil
|
||||
treemacs-projectile
|
||||
|
|
|
@ -10,4 +10,12 @@
|
|||
enable = true;
|
||||
package = pkgs.customEmacs;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
python-language-server
|
||||
fd
|
||||
ag
|
||||
nixpkgs-fmt
|
||||
rnix-lsp
|
||||
];
|
||||
}
|
||||
|
|
|
@ -23,6 +23,11 @@
|
|||
(scroll-bar-mode -1)
|
||||
(fringe-mode 1)
|
||||
(display-time-mode 1)
|
||||
(global-hl-line-mode 1)
|
||||
|
||||
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
|
||||
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
|
||||
(add-hook 'prog-mode-hook #'show-paren-mode)
|
||||
|
||||
|
||||
(provide 'aesthetics)
|
||||
(provide 'aesthetics)
|
||||
|
|
35
users/profiles/emacs/emacs.d/config/config-company.el
Normal file
35
users/profiles/emacs/emacs.d/config/config-company.el
Normal file
|
@ -0,0 +1,35 @@
|
|||
(use-package company
|
||||
:init
|
||||
(setq company-backends '(company-capf
|
||||
company-keywords
|
||||
company-semantic
|
||||
company-files
|
||||
company-etags
|
||||
company-elisp
|
||||
company-jedi
|
||||
company-ispell
|
||||
company-yasnippet)
|
||||
company-tooltip-limit 20
|
||||
company-show-numbers t
|
||||
company-idle-delay 0
|
||||
company-echo-delay 0)
|
||||
:bind
|
||||
(("C-c ." . company-complete)
|
||||
("C-c C-." . company-complete)
|
||||
("C-c s s" . company-yasnippet)
|
||||
:map company-active-map
|
||||
("C-n" . company-select-next)
|
||||
("C-p" . company-select-previous)
|
||||
("C-d" . company-show-doc-buffer)
|
||||
("M-." . company-show-location)))
|
||||
|
||||
(use-package helm-company
|
||||
:after (helm company)
|
||||
:bind (("C-c C-;" . helm-company))
|
||||
:commands (helm-company)
|
||||
:init
|
||||
(define-key company-mode-map (kbd "C-;") 'helm-company)
|
||||
(define-key company-active-map (kbd "C-;") 'helm-company))
|
||||
|
||||
|
||||
(provide 'config-company)
|
|
@ -4,6 +4,7 @@
|
|||
(setq lsp-keymap-prefix "C-c l")
|
||||
:hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode)
|
||||
(nix-mode . lsp)
|
||||
(python-mode . lsp)
|
||||
;; if you want which-key integration
|
||||
(lsp-mode . lsp-enable-which-key-integration))
|
||||
(before-save . lsp-format-buffer)
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
(projectile-mode +1)
|
||||
:bind (:map projectile-mode-map
|
||||
("s-p" . projectile-command-map)
|
||||
("C-c p" . projectile-command-map)))
|
||||
("C-c p" . projectile-command-map))
|
||||
:config
|
||||
(helm-projectile-on))
|
||||
|
||||
|
||||
(provide 'config-projectile)
|
||||
|
|
9
users/profiles/emacs/emacs.d/config/config-python.el
Normal file
9
users/profiles/emacs/emacs.d/config/config-python.el
Normal file
|
@ -0,0 +1,9 @@
|
|||
(use-package lsp-python-ms
|
||||
:ensure t
|
||||
:hook (python-mode . (lambda ()
|
||||
(require 'lsp-python-ms)
|
||||
(lsp)))
|
||||
:init
|
||||
(setq lsp-python-ms-executable (executable-find "python-language-server")))
|
||||
|
||||
(provide 'config-python)
|
|
@ -7,7 +7,11 @@
|
|||
(require 'config-emacs)
|
||||
(require 'config-evil)
|
||||
(require 'config-helm)
|
||||
(require 'config-org)
|
||||
(require 'config-projectile)
|
||||
(require 'config-company)
|
||||
(require 'config-magit)
|
||||
(require 'config-treemacs)
|
||||
(require 'config-lsp)
|
||||
(require 'config-python)
|
||||
(require 'nix)
|
||||
|
|
Loading…
Add table
Reference in a new issue