Working on Emacs
- now my custom Emacs package lives inside `pkgs/` - small org-mode updates - added custom Emacs commands to rebuild NixOS
This commit is contained in:
parent
ce354185e8
commit
54a41ac797
6 changed files with 73 additions and 51 deletions
24
README.org
24
README.org
|
@ -1,35 +1,39 @@
|
||||||
* NixFleet
|
* NixFleet
|
||||||
|
|
||||||
A complete, declarative and reproducible configuration of my entire Nix fleet, this includes the following machines:
|
A complete, declarative and reproducible configuration of my entire
|
||||||
|
Nix fleet, this includes the following machines:
|
||||||
|
|
||||||
- my main home workstation ~pc~
|
- my main home workstation ~pc~
|
||||||
- homeserver (mainly a nas) ~hs~ *(to do, soon)*
|
- 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
|
- 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)*
|
- 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)*
|
||||||
|
|
||||||
The different confgurations share many profiles, in fact my original goal was to avoid to rewrite the same Nix derivations for my different machines.
|
The different confgurations share many profiles, in fact my original
|
||||||
|
goal was to avoid to rewrite the same Nix derivations for my
|
||||||
|
different machines.
|
||||||
|
|
||||||
** Commands
|
** Commands
|
||||||
Here I describe my most used commands.
|
Here I describe my most used commands. All the commands are executed
|
||||||
All the commands are executed inside the Flake's development shell.
|
inside the Flake's development shell. To enter in this shell is
|
||||||
To enter in this shell is sufficent to ~cd~ in the folder (if you use ~direnv~) or run ~nix develop~.
|
sufficent to ~cd~ in the folder (if you use ~direnv~) or run ~nix
|
||||||
|
develop~.
|
||||||
|
|
||||||
*** Checking
|
*** Checking
|
||||||
To check that the Nix Flake is [[https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake-check.html#evaluation-checks][well defined]]:
|
To check that the Nix Flake is [[https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake-check.html#evaluation-checks][well defined]]:
|
||||||
#+begin_src shell
|
#+begin_src shell
|
||||||
nix flake check
|
nix flake check
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Building
|
*** Building
|
||||||
#+begin_src shell
|
#+begin_src shell
|
||||||
nix -Lv build ".#nixosConfigurations.<host>.config.system.build.toplevel"
|
nix -Lv build
|
||||||
#+end_src
|
".#nixosConfigurations.<host>.config.system.build.toplevel" #+end_src
|
||||||
|
|
||||||
Where ~<host>~ is the hostname e.g. ~pc~.
|
Where ~<host>~ is the hostname e.g. ~pc~.
|
||||||
|
|
||||||
*** Testing new config
|
*** Testing new config
|
||||||
#+begin_src shell
|
#+begin_src shell
|
||||||
bud rebuild <host> test
|
bud rebuild <host> test
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Where ~<host>~ is the hostname e.g. ~pc~.
|
Where ~<host>~ is the hostname e.g. ~pc~.
|
||||||
|
@ -37,7 +41,7 @@ Where ~<host>~ is the hostname e.g. ~pc~.
|
||||||
|
|
||||||
*** Switching
|
*** Switching
|
||||||
#+begin_src shell
|
#+begin_src shell
|
||||||
bud rebuild <host> switch
|
bud rebuild <host> switch
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Where ~<host>~ is the hostname e.g. ~pc~.
|
Where ~<host>~ is the hostname e.g. ~pc~.
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
final: prev: {
|
final: prev: {
|
||||||
# keep sources this first
|
# keep sources this first
|
||||||
sources = prev.callPackage (import ./_sources/generated.nix) {};
|
sources = prev.callPackage (import ./_sources/generated.nix) {};
|
||||||
|
customEmacs = prev.callPackage (import ./emacs) {};
|
||||||
# then, call packages with `final.callPackage`
|
# then, call packages with `final.callPackage`
|
||||||
}
|
}
|
||||||
|
|
38
pkgs/emacs/default.nix
Normal file
38
pkgs/emacs/default.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
let
|
||||||
|
myEmacs = pkgs.emacsPgtkGcc;
|
||||||
|
emacsWithPackages = (pkgs.emacsPackagesFor myEmacs).emacsWithPackages;
|
||||||
|
in
|
||||||
|
emacsWithPackages (
|
||||||
|
epkgs: (
|
||||||
|
with epkgs.melpaStablePackages; []
|
||||||
|
) ++ (
|
||||||
|
with epkgs.melpaPackages; [
|
||||||
|
all-the-icons
|
||||||
|
use-package
|
||||||
|
evil
|
||||||
|
evil-collection
|
||||||
|
helm
|
||||||
|
projectile
|
||||||
|
magit
|
||||||
|
fira-code-mode
|
||||||
|
org-superstar
|
||||||
|
nix-mode
|
||||||
|
lispy
|
||||||
|
lsp-mode
|
||||||
|
dap-mode
|
||||||
|
which-key
|
||||||
|
sudo-utils
|
||||||
|
treemacs
|
||||||
|
treemacs-evil
|
||||||
|
treemacs-projectile
|
||||||
|
treemacs-icons-dired
|
||||||
|
treemacs-magit
|
||||||
|
treemacs-persp
|
||||||
|
]
|
||||||
|
) ++ (
|
||||||
|
with epkgs.elpaPackages; [
|
||||||
|
modus-themes
|
||||||
|
]
|
||||||
|
) ++ []
|
||||||
|
)
|
|
@ -8,42 +8,6 @@
|
||||||
|
|
||||||
programs.emacs = {
|
programs.emacs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package =
|
package = pkgs.customEmacs;
|
||||||
let
|
|
||||||
myEmacs = pkgs.emacsPgtkGcc;
|
|
||||||
emacsWithPackages = (pkgs.emacsPackagesFor myEmacs).emacsWithPackages;
|
|
||||||
in
|
|
||||||
emacsWithPackages (
|
|
||||||
epkgs: (
|
|
||||||
with epkgs.melpaStablePackages; [ ]
|
|
||||||
) ++ (
|
|
||||||
with epkgs.melpaPackages; [
|
|
||||||
all-the-icons
|
|
||||||
use-package
|
|
||||||
evil
|
|
||||||
evil-collection
|
|
||||||
helm
|
|
||||||
projectile
|
|
||||||
magit
|
|
||||||
fira-code-mode
|
|
||||||
format-all
|
|
||||||
nix-mode
|
|
||||||
lispy
|
|
||||||
lsp-mode
|
|
||||||
dap-mode
|
|
||||||
which-key
|
|
||||||
treemacs
|
|
||||||
treemacs-evil
|
|
||||||
treemacs-projectile
|
|
||||||
treemacs-icons-dired
|
|
||||||
treemacs-magit
|
|
||||||
treemacs-persp
|
|
||||||
]
|
|
||||||
) ++ (
|
|
||||||
with epkgs.elpaPackages; [
|
|
||||||
modus-themes
|
|
||||||
]
|
|
||||||
) ++ [ ]
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
(use-package org
|
(use-package org
|
||||||
:init (setq fill-column 80)
|
:init
|
||||||
:hook (org-mode . refill-mode))
|
(setq fill-column 80)
|
||||||
|
:hook
|
||||||
|
((org-mode . refill-mode)
|
||||||
|
(org-mode . (lambda () (org-superstar-mode 1)))
|
||||||
|
(org-mode . prettify-symbols-mode)))
|
||||||
|
|
||||||
|
|
||||||
(provide 'config-org)
|
(provide 'config-org)
|
||||||
|
|
|
@ -1,4 +1,14 @@
|
||||||
(use-package nix-mode
|
(use-package nix-mode
|
||||||
:mode "\\.nix\\'")
|
:mode "\\.nix\\'")
|
||||||
|
|
||||||
|
(require 'sudo-utils)
|
||||||
|
|
||||||
|
(defun nixos-rebuild-switch ()
|
||||||
|
(interactive)
|
||||||
|
(sudo-utils-shell-command "nixos-rebuild switch"))
|
||||||
|
|
||||||
|
(defun nixos-rebuild-test ()
|
||||||
|
(interactive)
|
||||||
|
(sudo-utils-shell-command "nixos-rebuild test"))
|
||||||
|
|
||||||
(provide 'nix)
|
(provide 'nix)
|
Loading…
Add table
Reference in a new issue