Compare commits

...

2 Commits

Author SHA1 Message Date
marc
e22078b34a Modified emacs config 2022-11-13 19:42:32 +01:00
marc
f2f5227384 First working doom emacs config 2022-11-13 17:46:29 +01:00
13 changed files with 236 additions and 127 deletions

View File

@@ -3,91 +3,90 @@
** Fresh system (nixos USB drive) ** Fresh system (nixos USB drive)
1. Open a nix-shell with git: 1. Open a nix-shell with git:
#+BEGIN_SRC bash #+BEGIN_SRC bash
nix-shell -p git nix-shell -p git
#+END_SRC #+END_SRC
1. Clone the flake 2. Clone the flake
#+BEGIN_SRC bash #+BEGIN_SRC bash
git clone https://git.lajuntament.space/marc/samfelag.git git clone https://git.lajuntament.space/marc/samfelag.git
#+END_SRC #+END_SRC
1. Partition the disk 3. Partition the disk
1. Locate the disk 1. Locate the disk
#+BEGIN_SRC bash #+BEGIN_SRC bash
lsblk lsblk
#+END_SRC #+END_SRC
1. Create a GPT partition table 2. Create a GPT partition table
#+BEGIN_SRC bash #+BEGIN_SRC bash
sudo parted /dev/nvme0n1 -- mklabel gpt sudo parted /dev/nvme0n1 -- mklabel gpt
#+END_SRC #+END_SRC
1. Create the root partition 3. Create the root partition
#+BEGIN_SRC bash #+BEGIN_SRC bash
sudo parted /dev/nvme0n1 -- mkpart primary 512MB -8GB sudo parted /dev/nvme0n1 -- mkpart primary 512MB -8GB
#+END_SRC #+END_SRC
1. Create the swap partition 4. Create the swap partition
#+BEGIN_SRC bash #+BEGIN_SRC bash
sudo parted /dev/nvme0n1 -- mkpart primary linux-swap -8GB 100% sudo parted /dev/nvme0n1 -- mkpart primary linux-swap -8GB 100%
#+END_SRC #+END_SRC
1. Create the boot partition 5. Create the boot partition
#+BEGIN_SRC bash #+BEGIN_SRC bash
sudo parted /dev/nvme0n1 -- mkpart ESP fat32 1MB 512MB sudo parted /dev/nvme0n1 -- mkpart ESP fat32 1MB 512MB
sudo parted /dev/nvme0n1 -- set 3 esp on sudo parted /dev/nvme0n1 -- set 3 esp on
#+END_SRC #+END_SRC
1. Format the partitions 4. Format the partitions
1. Root partition 1. Root partition
#+BEGIN_SRC bash #+BEGIN_SRC bash
sudo mkfs.ext4 -L nixos /dev/nvme0n1p1 sudo mkfs.ext4 -L nixos /dev/nvme0n1p1
#+END_SRC #+END_SRC
1. Swap partition 2. Swap partition
#+BEGIN_SRC bash #+BEGIN_SRC bash
sudo mkswap -L swap /dev/nvme0n1p2 sudo mkswap -L swap /dev/nvme0n1p2
#+END_SRC #+END_SRC
1. Boot partition 3. Boot partition
#+BEGIN_SRC bash #+BEGIN_SRC bash
sudo mkfs.fat -F 32 -n BOOT /dev/nvme0n1p3 sudo mkfs.fat -F 32 -n BOOT /dev/nvme0n1p3
#+END_SRC #+END_SRC
1. Mount the filesystems 5. Mount the filesystems
1. Root partition 1. Root partition
#+BEGIN_SRC bash #+BEGIN_SRC bash
sudo mount /dev/disk/by-label/nixos /mnt sudo mount /dev/disk/by-label/nixos /mnt
#+END_SRC #+END_SRC
1. Boot partition 2. Boot partition
#+BEGIN_SRC bash #+BEGIN_SRC bash
sudo mkdir -p /mnt/boot sudo mkdir -p /mnt/boot
sudo mount /dev/disk/by-label/BOOT /mnt/boot sudo mount /dev/disk/by-label/BOOT /mnt/boot
#+END_SRC #+END_SRC
1. Swap partition (if needed) 3. Swap partition (if needed)
#+BEGIN_SRC bash #+BEGIN_SRC bash
sudo swapon /dev/disk/by-label/swap sudo swapon /dev/disk/by-label/swap
#+END_SRC #+END_SRC
1. Create the host nix configuration 6. Create the host nix configuration
If the host is not present under system/hosts, create a new folder for the host. If the host is not present under system/hosts, create a new folder for the host.
Generate the hardware configuration file, you can use nixos-generate-config as a base: Generate the hardware configuration file, you can use nixos-generate-config as a base:
#+BEGIN_SRC bash #+BEGIN_SRC bash
nixos-generate-config --dir <<host directory>> --no-filesystems nixos-generate-config --dir <<host directory>> --no-filesystems
#+END_SRC #+END_SRC
1. Install nixos! 7. Install nixos!
#+BEGIN_SRC bash
sudo nixos-install --impure --root /mnt --flake .#reykjavik
#+END_SRC
#+BEGIN_SRC bash 8. Set up the user
sudo nixos-install --impure --root /mnt --flake .#reykjavik You'll set the root password during the installation. You can then reboot and use the installed OS. First thing you'll have to do is log in as root and set the password for your user:
#+END_SRC #+BEGIN_SRC bash
passwd marc
1. Set up the user #+END_SRC
You'll set the root password during the installation. You can then reboot and use the installed OS. First thing you'll have to do is log in as root and set the password for your user:
#+BEGIN_SRC bash
passwd marc
#+END_SRC

View File

@@ -67,7 +67,7 @@
;; ----------------------------------------------------------------------------- ;; -----------------------------------------------------------------------------
(use-package vterm (use-package vterm
:config :config
(setq vterm-shell "fish")) (setq vterm-shell "zsh"))
;; ----------------------------------------------------------------------------- ;; -----------------------------------------------------------------------------
@@ -93,7 +93,6 @@
:config :config
(setq py-autopep8-options '("--max-line-length=120"))) (setq py-autopep8-options '("--max-line-length=120")))
(use-package pipenv (use-package pipenv
:config :config
(setq pipenv-with-projectile t) (setq pipenv-with-projectile t)
@@ -106,17 +105,6 @@
(setq org-directory "~/org/") (setq org-directory "~/org/")
(defun org-set-trello-mode ()
(let ((filename (buffer-file-name (current-buffer))))
(when (and filename (string= "trello" (file-name-extension filename)))
(org-trello-mode))))
(use-package org
:config
(add-to-list 'auto-mode-alist '("\\.trello$" . org-mode))
(add-hook! 'org-mode-hook 'org-set-trello-mode))
(use-package org-roam (use-package org-roam
:ensure t :ensure t
:init :init
@@ -136,37 +124,6 @@
:config :config
(org-roam-setup)) (org-roam-setup))
(use-package org-trello
:config
;; (setq org-trello-current-prefix-keybinding "SPC r")
(defun org-trello-bindings ()
"Set the keybindings for org-trello mode"
(defun set-key (key fn)
(evil-define-key* 'normal org-trello-mode-map
(kbd (concat "SPC r" " " key)) fn))
(set-key "v" 'org-trello-version)
(set-key "i" 'org-trello-install-key-and-token)
(set-key "I" 'org-trello-install-board-metadata)
(set-key "c" 'org-trello-sync-card)
(set-key "s" 'org-trello-sync-buffer)
(set-key "a" 'org-trello-assign-me)
(set-key "d" 'org-trello-check-setup)
(set-key "D" 'org-trello-delete-setup)
(set-key "b" 'org-trello-create-board-and-install-metadata)
(set-key "k" 'org-trello-kill-entity)
(set-key "K" 'org-trello-kill-cards)
(set-key "a" 'org-trello-archive-card)
(set-key "A" 'org-trello-archive-cards)
(set-key "j" 'org-trello-jump-to-trello-card)
(set-key "J" 'org-trello-jump-to-trello-board)
(set-key "C" 'org-trello-add-card-comments)
(set-key "o" 'org-trello-show-card-comments)
(set-key "l" 'org-trello-show-card-labels)
(set-key "u" 'org-trello-update-board-metadata)
(set-key "h" 'org-trello-help-describing-bindings))
(add-hook! 'org-trello-mode-hook 'org-trello-bindings))
(use-package! websocket (use-package! websocket
:after org-roam) :after org-roam)
@@ -203,12 +160,9 @@
("not in" "") ("not in" "")
("in" "")) ("in" ""))
(pretty-hook emacs-lisp-mode) (pretty-hook emacs-lisp-mode)
;; ("defun" "𝙛") ;; ("defun" "𝙛")
;; (pretty-hook org-mode
(pretty-hook org-mode ;; ("[ ]" "☐")
("[ ]" "") ;; ("[X]" "☑"))
("[X]" ""))

View File

@@ -35,7 +35,8 @@
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra ;;hydra
;;indent-guides ; highlighted indent columns ;;indent-guides ; highlighted indent columns
(ligatures +iosevka) ; ligatures and symbols to make your code pretty again (ligatures
+iosevka) ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side ;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API modeline ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink cursor line after big motions ;;nav-flash ; blink cursor line after big motions
@@ -144,7 +145,7 @@
;;lua ; one-based indices? one-based indices ;;lua ; one-based indices? one-based indices
markdown ; writing docs for people to ignore markdown ; writing docs for people to ignore
;;nim ; python + lisp at the speed of c ;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!" nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel ;;ocaml ; an objective camel
(org (org
+journal +journal

View File

@@ -58,7 +58,6 @@
(package! py-autopep8) (package! py-autopep8)
;; Org ;; Org
(package! org-trello)
;; Org-Roam UI ;; Org-Roam UI
(unpin! org-roam) (unpin! org-roam)

17
flake.lock generated
View File

@@ -1,5 +1,21 @@
{ {
"nodes": { "nodes": {
"doom-emacs": {
"flake": false,
"locked": {
"lastModified": 1667229496,
"narHash": "sha256-SURAFrtblyvkflQz1cEQogfo31UzSvKd+UOgczUyJ8k=",
"owner": "doomemacs",
"repo": "doomemacs",
"rev": "9d4d5b756a8598c4b5c842e9f1f33148af2af8fd",
"type": "github"
},
"original": {
"owner": "doomemacs",
"repo": "doomemacs",
"type": "github"
}
},
"emacs-overlay": { "emacs-overlay": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
@@ -87,6 +103,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"doom-emacs": "doom-emacs",
"emacs-overlay": "emacs-overlay", "emacs-overlay": "emacs-overlay",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"

View File

@@ -12,7 +12,7 @@
}; };
outputs = { self, nixpkgs, home-manager, ... }: outputs = inputs @ { self, nixpkgs, home-manager, ... }:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { pkgs = import nixpkgs {
@@ -53,6 +53,7 @@
reykjavik = lib.nixosSystem { reykjavik = lib.nixosSystem {
inherit system; inherit system;
inherit pkgs; inherit pkgs;
specialArgs = { inherit inputs; };
modules = [ modules = [
./system/modules ./system/modules
@@ -60,6 +61,7 @@
./system/hosts/reykjavik ./system/hosts/reykjavik
home-manager.nixosModules.home-manager { home-manager.nixosModules.home-manager {
home-manager.extraSpecialArgs = { inherit inputs; };
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.users.marc = { home-manager.users.marc = {

View File

@@ -9,6 +9,7 @@
discord.enable = true; discord.enable = true;
spotify.enable = true; spotify.enable = true;
}; };
editors.emacs.enable = true;
}; };
profiles = { profiles = {
desktop.enable = true; desktop.enable = true;

View File

@@ -2,5 +2,6 @@
{ {
imports = [ imports = [
./emacs.nix
]; ];
} }

View File

@@ -0,0 +1,14 @@
{ config, inputs, lib, options, pkgs, ... }:
with lib;
let
cfg = config.samfelag.modules.editors.emacs;
in {
options.samfelag.modules.editors.emacs = {
enable = mkEnableOption "emacs";
};
config = mkIf cfg.enable {
# xdg.configFile."doom".src = ../../../config/doom;
};
}

View File

@@ -17,6 +17,7 @@
samfelag.modules = { samfelag.modules = {
user.name = "marc"; user.name = "marc";
bluetooth.enable = true; bluetooth.enable = true;
editors.emacs.enable = true;
}; };

View File

@@ -2,5 +2,6 @@
{ {
imports = [ imports = [
./emacs.nix
]; ];
} }

View File

@@ -0,0 +1,119 @@
{ config, inputs, lib, options, pkgs, ... }:
with lib;
let
cfg = config.samfelag.modules.editors.emacs;
in {
options.samfelag.modules.editors.emacs = {
enable = mkEnableOption "emacs";
};
config = mkIf cfg.enable {
nixpkgs.overlays = [ inputs.emacs-overlay.overlay ];
# home.file.doom-emacs = {
# source = ./doom-emacs;
# target = ".config/doom";
# recursive = true;
# # onChange = "doom upgrade";
# };
# home.programs.emacs = {
# enable = true;
# # package = pkgs.emacsPgtkGcc;
# extraPackages = epkgs: [ epkgs.vterm ];
# };
# home.services.emacs = {
# enable = true;
# client.enable = true;
# socketActivation.enable = true;
# };
environment.systemPackages = with pkgs; [
## Emacs itself
binutils
emacs
# emacsPgtkGcc
## Doom dependencies
git
(ripgrep.override { withPCRE2 = true; })
gnutls
## Opt deps
fd
imagemagick
pinentry_emacs
zstd
# ## Modules deps
# # :lang cc
# ccls
# cmake
# gcc
# glslang
# # :lang haskell
# stack
# haskellPackages.ghcide
# haskellPackages.hoogle
# # :lang latex && :lang org (latex preview)
# (texlive.combine { inherit (texlive) scheme-full; })
# # biber
# # :lang nix
# nixfmt
# # :lang python
# black
# python3
# python3Packages.isort
# # python3Packages.python-language-server
# python3Packages.pytest
# python3Packages.setuptools
# nodePackages.pyright
# # :tools lookup & :lang org +roam
# sqlite
# # :tools direnv
# direnv
# # :tools vterm
# gcc
# gnumake
# libtool
# Fonts
emacs-all-the-icons-fonts
# fira-code
# fira-code-symbols
graphviz
];
fonts.fonts = [ pkgs.emacs-all-the-icons-fonts ];
# env.PATH = [ "$XDG_CONFIG_HOME/emacs/bin" ];
environment.sessionVariables = rec {
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_BIN_HOME = "$HOME/.local/bin";
XDG_DATA_HOME = "$HOME/.local/share";
PATH = [
"$HOME/.config/emacs/bin"
];
};
home-manager.users.marc.xdg.configFile."doom".source = ../../../config/doom;
system.userActivationScripts = {
installDoomEmacs = ''
EMACS_FOLDER="$HOME/.config/emacs"
echo $XDG_CONFIG_HOME
echo $EMACS_FOLDER
if [ ! -d "$EMACS_FOLDER" ]; then
${pkgs.git}/bin/git clone --depth=1 --single-branch "https://github.com/doomemacs/doomemacs" "$EMACS_FOLDER"
fi
'';
};
};
}

View File

@@ -12,7 +12,7 @@
gc = { gc = {
automatic = true; automatic = true;
dates = "weekly"; dates = "weekly";
options = "--delete-older-than 30d"; options = "--delete-older-than 14d";
}; };
}; };