Compare commits

...

3 commits

Author SHA1 Message Date
37b9e4585f
loki: Get root user info for microvms from module 2023-11-14 14:46:22 +01:00
5f351fe376
emacs: Set font according to screen DPI 2023-11-14 14:44:16 +01:00
7ad29c469c
flake.lock: Update
Flake lock file updates:

• Updated input 'disko':
    'github:nix-community/disko/72bc1526268fda374cd17315e37b64ba340c5bf2' (2023-11-08)
  → 'github:nix-community/disko/2d7d77878c5d70f66f3d676ff66708d8d4f9d7df' (2023-11-12)
• Updated input 'emacs-overlay':
    'github:nix-community/emacs-overlay/a791cc561a2fe5a1c13a0b102a06bfbab4bb121f' (2023-11-09)
  → 'github:nix-community/emacs-overlay/1d4ed29d4d9d076210485697c325f8d6914d908f' (2023-11-14)
• Updated input 'emacs-overlay/nixpkgs-stable':
    'github:NixOS/nixpkgs/41de143fda10e33be0f47eab2bfe08a50f234267' (2023-11-06)
  → 'github:NixOS/nixpkgs/da4024d0ead5d7820f6bd15147d3fe2a0c0cec73' (2023-11-10)
• Updated input 'home-manager':
    'github:nix-community/home-manager/6a8444467c83c961e2f5ff64fb4f422e303c98d3' (2023-11-07)
  → 'github:nix-community/home-manager/280721186ab75a76537713ec310306f0eba3e407' (2023-11-12)
• Updated input 'nixos-hardware':
    'github:NixOS/nixos-hardware/627bc9b88256379578885a7028c9e791c29fb581' (2023-11-05)
  → 'github:NixOS/nixos-hardware/df9bb8a436607da124e8cfa0fd19e70e9d9e0b7b' (2023-11-14)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/85f1ba3e51676fa8cc604a3d863d729026a6b8eb' (2023-11-04)
  → 'github:nixos/nixpkgs/e44462d6021bfe23dfb24b775cc7c390844f773d' (2023-11-12)
• Updated input 'rust-overlay':
    'github:oxalica/rust-overlay/603e4962d7d2225ba2caf66b0eabfcaa9a93c490' (2023-11-09)
  → 'github:oxalica/rust-overlay/e485313fc485700a9f1f9b8b272ddc0621d08357' (2023-11-14)
• Updated input 'sops':
    'github:Mic92/sops-nix/664187539871f63857bda2d498f452792457b998' (2023-11-06)
  → 'github:Mic92/sops-nix/0e3a94167dcd10a47b89141f35b2ff9e04b34c46' (2023-11-14)
• Updated input 'sops/nixpkgs-stable':
    'github:NixOS/nixpkgs/78f3a4ae19f0e99d5323dd2e3853916b8ee4afee' (2023-11-04)
  → 'github:NixOS/nixpkgs/9502d0245983bb233da8083b55d60d96fd3c29ff' (2023-11-12)
2023-11-14 10:56:10 +01:00
6 changed files with 82 additions and 102 deletions

View file

@ -81,11 +81,11 @@
]
},
"locked": {
"lastModified": 1699483000,
"narHash": "sha256-zWEj1e6r2KNJFTdj4/vpnpoJc2l+v3JHwlQCzrtkojU=",
"lastModified": 1699781810,
"narHash": "sha256-LD+PIUbm1yQmQmGIbSsc/PB1dtJtGqXFgxRc1C7LlfQ=",
"owner": "nix-community",
"repo": "disko",
"rev": "72bc1526268fda374cd17315e37b64ba340c5bf2",
"rev": "2d7d77878c5d70f66f3d676ff66708d8d4f9d7df",
"type": "github"
},
"original": {
@ -105,11 +105,11 @@
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1699496795,
"narHash": "sha256-kZirbNufd6DPfmsLy6P6BJfoLbVZ1sn80G99YsFsyVc=",
"lastModified": 1699954689,
"narHash": "sha256-gJtxMQotdEyiuGoiPPSdYqa8Pdw9ptgFFMrxKsWKj54=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "a791cc561a2fe5a1c13a0b102a06bfbab4bb121f",
"rev": "1d4ed29d4d9d076210485697c325f8d6914d908f",
"type": "github"
},
"original": {
@ -306,11 +306,11 @@
]
},
"locked": {
"lastModified": 1699368917,
"narHash": "sha256-nUtGIWf86BOkUbtksWtfglvCZ/otP0FTZlQH8Rzc7PA=",
"lastModified": 1699783872,
"narHash": "sha256-4zTwLT2LL45Nmo6iwKB3ls3hWodVP9DiSWxki/oewWE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "6a8444467c83c961e2f5ff64fb4f422e303c98d3",
"rev": "280721186ab75a76537713ec310306f0eba3e407",
"type": "github"
},
"original": {
@ -410,11 +410,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1699159446,
"narHash": "sha256-cL63IjsbPl2otS7R4kdXbVOJOXYMpGw5KGZoWgdCuCM=",
"lastModified": 1699954245,
"narHash": "sha256-CSnfeOHc/wco8amdA0j268OaLrMcI5gGtK6Zm+y3lT0=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "627bc9b88256379578885a7028c9e791c29fb581",
"rev": "df9bb8a436607da124e8cfa0fd19e70e9d9e0b7b",
"type": "github"
},
"original": {
@ -425,11 +425,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1699099776,
"narHash": "sha256-X09iKJ27mGsGambGfkKzqvw5esP1L/Rf8H3u3fCqIiU=",
"lastModified": 1699781429,
"narHash": "sha256-UYefjidASiLORAjIvVsUHG6WBtRhM67kTjEY4XfZOFs=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "85f1ba3e51676fa8cc604a3d863d729026a6b8eb",
"rev": "e44462d6021bfe23dfb24b775cc7c390844f773d",
"type": "github"
},
"original": {
@ -459,11 +459,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1699291058,
"narHash": "sha256-5ggduoaAMPHUy4riL+OrlAZE14Kh7JWX4oLEs22ZqfU=",
"lastModified": 1699596684,
"narHash": "sha256-XSXP8zjBZJBVvpNb2WmY0eW8O2ce+sVyj1T0/iBRIvg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "41de143fda10e33be0f47eab2bfe08a50f234267",
"rev": "da4024d0ead5d7820f6bd15147d3fe2a0c0cec73",
"type": "github"
},
"original": {
@ -491,11 +491,11 @@
},
"nixpkgs-stable_3": {
"locked": {
"lastModified": 1699110214,
"narHash": "sha256-L2TU4RgtiqF69W8Gacg2jEkEYJrW+Kp0Mp4plwQh5b8=",
"lastModified": 1699756042,
"narHash": "sha256-bHHjQQBsEPOxLL+klYU2lYshDnnWY12SewzQ7n5ab2M=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "78f3a4ae19f0e99d5323dd2e3853916b8ee4afee",
"rev": "9502d0245983bb233da8083b55d60d96fd3c29ff",
"type": "github"
},
"original": {
@ -618,11 +618,11 @@
]
},
"locked": {
"lastModified": 1699495996,
"narHash": "sha256-m0LWmnEJhHTY4gJX9HPsQ8voZptvr1Sx6dXkk9Xp0sI=",
"lastModified": 1699928012,
"narHash": "sha256-7WfRTTBdkRJgjiJRsSShMXlfmOG1X0FqNdHaLATAL+w=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "603e4962d7d2225ba2caf66b0eabfcaa9a93c490",
"rev": "e485313fc485700a9f1f9b8b272ddc0621d08357",
"type": "github"
},
"original": {
@ -639,11 +639,11 @@
"nixpkgs-stable": "nixpkgs-stable_3"
},
"locked": {
"lastModified": 1699311858,
"narHash": "sha256-W/sQrghPAn5J9d+9kMnHqi4NPVWVpy0V/qzQeZfS/dM=",
"lastModified": 1699951338,
"narHash": "sha256-1GeczM7XfgHcYGYiYNcdwSFu3E62vmh4d7mffWZvyzE=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "664187539871f63857bda2d498f452792457b998",
"rev": "0e3a94167dcd10a47b89141f35b2ff9e04b34c46",
"type": "github"
},
"original": {

View file

@ -55,11 +55,11 @@ Setting =lexical-binding= to =t= can improve startup time. This has to be first!
This sets some variables with my personal preferences for easy customization
#+begin_src emacs-lisp
(defvar my/default-font "Monaspace Argon-16")
(defvar my/variable-width-font "Iosevka Aile-16")
(defvar my/comment-font "Monaspace Radon-16")
(defvar my/default-font-height 13)
(defvar my/default-font-weight 'normal)
(defvar my/default-font "Monaspace Neon")
(defvar my/variable-width-font "Iosevka Aile")
(defvar my/comment-font "Monaspace Radon")
(defvar my/default-font-height 120)
(defvar my/default-font-weight 'light)
(defvar my/default-font-width 'normal)
(defvar my/variable-width-font-height 1.1)
(defvar my/config-file-path (expand-file-name "config.org" user-emacs-directory))
@ -366,7 +366,7 @@ Prefer to open frames in a horizontal split and make sure they're of a decent wi
#+begin_src emacs-lisp
(setq split-height-threshold nil
window-min-width 120)
window-min-width 100)
#+end_src
Set fill column to 80
@ -423,16 +423,30 @@ I prefer the [[https://draculatheme.com][dracula theme]]
Set fonts.
#+begin_src emacs-lisp
(defun my/set-font-size (&optional frame)
(let* ((frame (or frame (selected-frame)))
(geometry (frame-monitor-attribute 'geometry frame))
(mm-size (frame-monitor-attribute 'mm-size frame))
(width-px (caddr geometry))
(width-mm (car mm-size))
(width-in (/ width-mm 25.4))
(display-dpi (/ width-px width-in))
(font-height (cond
((< display-dpi 110) 120)
((< display-dpi 130) 140)
((< display-dpi 160) 160)
(t 160))))
(set-face-attribute 'default frame :height font-height)))
(add-hook 'server-after-make-frame-hook 'my/set-font-size)
(defun my/setup-fonts ()
; Monospace
(set-face-attribute 'default nil :font my/default-font)
(set-face-attribute 'font-lock-comment-face nil :font my/comment-font)
; Variable pitch
(set-face-attribute 'variable-pitch nil
:font my/variable-width-font
:height my/variable-width-font-height))
(set-face-attribute 'default nil :family my/default-font :weight 'light)
(set-face-attribute 'font-lock-comment-face nil :font my/comment-font)
(set-face-attribute 'variable-pitch nil
:font my/variable-width-font
:height my/variable-width-font-height))
(add-hook 'after-init-hook 'my/setup-fonts)
(add-hook 'server-after-make-frame-hook 'my/setup-fonts)
#+end_src
Emoji support
@ -1254,19 +1268,19 @@ Prefer local packages from =node_modules= to global ones
Add support for Elixir with [[https://github.com/elixir-editors/emacs-elixir][elixir-mode]]. The =elixir-format= hook sets up the correct formatter configuration when in a =projectile= project.
#+begin_src emacs-lisp
(use-package elixir-mode
:after eglot
:hook ((elixir-format . (lambda ()
(if (projectile-project-p)
(setq elixir-format-arguments
(list "--dot-formatter"
(concat (locate-dominating-file buffer-file-name ".formatter.exs") ".formatter.exs")))
(setq elixir-format-arguments nil))))
(elixir-mode . (lambda () (add-hook 'before-save-hook 'elixir-format nil t)))
(elixir-mode . eglot-ensure))
:config
;; (setq lsp-elixir-server-command '("elixir-ls"))
(add-to-list 'auto-mode-alist '("\\.[hl]eex\\'" . elixir-mode)))
(use-package elixir-mode
:after eglot
:hook ((elixir-format . (lambda ()
(if (projectile-project-p)
(setq elixir-format-arguments
(list "--dot-formatter"
(concat (locate-dominating-file buffer-file-name ".formatter.exs") ".formatter.exs")))
(setq elixir-format-arguments nil))))
(elixir-mode . (lambda () (add-hook 'before-save-hook 'elixir-format nil t)))
(elixir-mode . eglot-ensure))
:config
;; (setq lsp-elixir-server-command '("elixir-ls"))
(add-to-list 'auto-mode-alist '("\\.[hl]eex\\'" . elixir-mode)))
#+end_src
Add a [[https://github.com/ayrat555/mix.el][mix]] minor mode to call =mix= tasks from emacs.
@ -1469,15 +1483,15 @@ Tell =nil= to use =nixpkgs-fmt= for formatting nix files.
#+begin_src emacs-lisp
(with-eval-after-load 'eglot
(add-to-list 'eglot-server-programs
'(nix-mode . ("nil" :initializationOptions
`(:nil (:formatting (:command ["nixpkgs-fmt"])))))))
`(nix-mode . ("nil" :initializationOptions
(:formatting (:command ["nixpkgs-fmt"]))))))
#+end_src
*** Common Lisp
Common Lisp does not use =lsp-mode=, but has it's own environment: [[https://github.com/slime/slime][SLIME]] or Superior Lisp Interaction Mode for Emacs.
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle no
(use-package slime
:init
(setq slime-lisp-implementations
@ -1491,6 +1505,13 @@ Common Lisp does not use =lsp-mode=, but has it's own environment: [[https://git
(lisp-mode . (lambda () (slime-mode t)))
(inferior-lisp-mode . (lambda () (inferior-slime-mode t))))
#+end_src
[[https://github.com/joaotavora/sly][SLY]] is a fork of SLIME, by the same author as =eglot=, with improved UX
#+begin_src emacs-lisp
(use-package sly)
#+end_src
*** Clojure
Similar to =lisp=, there is [[https://github.com/clojure-emacs/cider][CIDER]] (Clojure Interactive Development Environment that Rocks) for Clojure(Script)

View file

@ -142,7 +142,6 @@ in
(nil.overrideAttrs (_: { doCheck = false; }))
nixpkgs-fmt
python3
# (tree-sitter.withPlugins builtins.attrValues)
] ++
(with aspellDicts; [ en en-computers en-science fy nl ]);

View file

@ -2,7 +2,10 @@
let
mkK3sNode = name: isServer: ipv4Address: ipv6Address: macAddress: {
config = {
imports = [ inputs.sops.nixosModules.sops ];
imports = [
inputs.sops.nixosModules.sops
../../users/root
];
microvm = {
mem = 1024;
@ -41,16 +44,6 @@ let
hypervisor = "cloud-hypervisor";
};
users.users.root = {
initialHashedPassword = "";
openssh.authorizedKeys.keyFiles = [
(pkgs.fetchurl {
url = "https://github.com/eboskma.keys";
sha256 = "uwK4FSLSHiwCJU9U7RBFHIoCmr7uUQLM0JM1u0bi4xo=";
})
];
};
services = {
k3s = {
enable = true;

View file

@ -22,5 +22,4 @@ _final: prev: {
patches = (prevAttrs.patches or [ ]) ++ [ ./ddccontrol-db/0001-add-del41d9.patch ];
});
monaspace = prev.pkgs.callPackage ../pkgs/monaspace { };
}

View file

@ -1,32 +0,0 @@
{ lib, stdenvNoCC, fetchzip }:
stdenvNoCC.mkDerivation rec {
pname = "monaspace";
version = "1.000";
src = fetchzip {
url = "https://github.com/githubnext/monaspace/releases/download/v${version}/monaspace-v${version}.zip";
hash = "sha256-H8NOS+pVkrY9DofuJhPR2OlzkF4fMdmP2zfDBfrk83A=";
stripRoot = false;
};
outputs = [ "out" ];
installPhase = ''
runHook preInstall
mkdir -p $out/share/fonts/monaspace
mkdir -p $out/share/fonts/monaspace-variable
cp monaspace-v${version}/fonts/otf/*.otf $out/share/fonts/monaspace
cp monaspace-v${version}/fonts/variable/*.ttf $out/share/fonts/monaspace-variable
runHook postInstall
'';
meta = with lib; {
description = "Monaspace";
longDescription = "An innovative superfamily of fonts for code.";
homepage = "https://monaspace.githubnext.com/";
license = licenses.ofl;
platforms = platforms.all;
maintainers = with maintainers; [ AndersonTorres ];
};
}