In the beginning there was darkness.

This commit is contained in:
Daniel Ziltener 2023-11-15 17:09:47 +01:00
commit 87c5c650b9
Signed by: zilti
GPG Key ID: B38976E82C9DAE42
15 changed files with 2284 additions and 0 deletions

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
# ---> Nix
# Ignore build outputs from performing a nix-build or `nix build` command
result
result-*
hardware-configuration.nix
# Ignore Emacs temp files
*~

29
Makefile Normal file
View File

@ -0,0 +1,29 @@
##
# Nix Configuration
#
# @file
# @version 0.1
HOST ?= ziltis-desktop
DEVICE ?= nvme0n1
#configuration.nix: hosts/${HOST}.nix
# ln -s "$<" "$@"
disko: disko-config.nix
sed -i "s|.*DEVICE_NAME| device = \"/dev/$(DEVICE)\"; # DEVICE_NAME|g" disko-config.nix
nix run \
--extra-experimental-features nix-command \
--extra-experimental-features flakes \
github:nix-community/disko -- \
--mode disko \
./disko-config.nix
install-system: configuration.nix
sed -i "s|.*DEVICE_HOSTNAME| networking.hostName = \"$(HOST)\"; # DEVICE_HOSTNAME|g" configuration.nix
nixos-generate-config --no-filesystems --root /mnt
cp configuration.nix /mnt/etc/nixos
cp disko-config.nix /mnt/etc/nixos
nixos-install
# end

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# nixconfig

171
configuration.nix Normal file
View File

@ -0,0 +1,171 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "ziltis-desktop"; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "Europe/Berlin";
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
# i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
# keyMap = "de";
useXkbConfig = true; # use xkbOptions in tty.
};
# Enable the X11 windowing system.
# services.xserver.enable = true;
programs.hyprland.enable = true;
services.flatpak.enable = true;
nixpkgs.config.allowUnfree = true;
# Configure keymap in X11
services.xserver.layout = "de";
services.xserver.xkbOptions = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
# sound.enable = true;
# hardware.pulseaudio.enable = true;
# rtkit is optional but recommended
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
services.xserver.enable = true;
services.xserver.libinput.enable = true;
services.xserver.displayManager.sddm.enable = true;
# Define a user account. Don't forget to set a password with passwd.
# users.users.alice = {
# isNormalUser = true;
# extraGroups = [ "wheel" ]; # Enable sudo for the user.
# packages = with pkgs; [
# firefox
# tree
# ];
# };
users.users.zilti = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
wget
git
];
virtualisation = {
podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
};
containers.storage.settings = {
storage = {
driver = "btrfs";
};
};
};
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
services.hardware.bolt.enable = true;
hardware.tuxedo-keyboard.enable = true;
hardware.tuxedo-rs = {
enable = true;
tailor-gui.enable = true;
};
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
networking.extraHosts = ''
127.0.0.1 l.redsky.io
::1 l.redsky.io
'';
security.pam.services.swaylock = {};
fileSystems = {
"/".options = [ "compress=zstd" ];
"/home".options = [ "compress=zstd" ];
"/nix".options = [ "compress=zstd" "noatime" ];
# "/swap".options = [ "noatime" ];
};
services.btrfs = {
autoScrub = {
enable = true;
interval = "weekly";
fileSystems = [ "/" ];
};
};
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
}

52
disko-config.nix Normal file
View File

@ -0,0 +1,52 @@
{
disko.devices = {
disk = {
main = {
#device = builtins.elemAt disks 0;
device = "/dev/nvme0n1"; # DEVICE_NAME
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
priority = 1;
name = "ESP";
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/rootfs" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/";
};
"/home" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/home";
};
"/nix" = {
mountOptions = [ "compress=zstd" "noatime" ];
mountpoint = "/nix";
};
"/swap" = {
mountOptions = [ "subvol=swap" ];
mountpoint = "/swap";
};
};
};
};
};
};
};
};
};
}

73
emacs/emacs.nix Normal file
View File

@ -0,0 +1,73 @@
{ config, lib, pkgs, ...}:
{
home.file.".emacs.d/early-init.el" = {
enable = false;
text = "(setq package-enable-at-startup nil)";
};
home.file.".emacs.d/init.el" = {
enable = true;
text = builtins.readFile ./init.el;
};
home.file.".emacs.d/templates" = {
enable = true;
text = builtins.readFile ./templates;
};
programs.emacs = {
enable = true;
package = pkgs.emacs29-gtk3;
extraConfig = builtins.readFile ./init.el;
extraPackages = epkgs: with epkgs; [
cape
catppuccin-theme
cider
circe
clojure-ts-mode
code-review
color-theme-modern
consult
consult-eglot
corfu
corfu-terminal
dhall-mode
editorconfig
eglot
el-patch
embark
embark-consult
evil
evil-collection
forge
geiser
git-gutter
goto-chg
keychain-environment
lispy
lispyville
lsp-scheme
magit
magit-todos
marginalia
moe-theme
nerd-icons-completion
nerd-icons-corfu
nix-ts-mode
orderless
org
org-modern
org-rainbow-tags
org-roam
org-roam-ui
pass
password-store
password-store-otp
rainbow-delimiters
tempel
tree-sitter
tree-sitter-langs
vertico
websocket
which-key
];
};
}

525
emacs/init.el Normal file
View File

@ -0,0 +1,525 @@
;;; init.el --- Description -*- lexical-binding: t; -*-
;;
;; Copyright (C) 2023 Daniel Ziltener
;;
;; Author: Daniel Ziltener <dziltener@lyrion.ch>
;; Maintainer: Daniel Ziltener <dziltener@lyrion.ch>
;; Created: November 13, 2023
;; Modified: November 13, 2023
;; Version: 0.0.1
;; Keywords: abbrev bib c calendar comm convenience data docs emulations extensions faces files frames games hardware help hypermedia i18n internal languages lisp local maint mail matching mouse multimedia news outlines processes terminals tex tools unix vc wp
;; Homepage: https://github.com/dziltener@lyrion.ch/init
;; Package-Requires: ((emacs "24.3"))
;;
;; This file is not part of GNU Emacs.
;;
;;; Commentary:
;;
;; Description
;;
;;; Code:
;;;; Early Variables
(setq custom-file "~/.emacs.d/custom.el")
(when (file-exists-p custom-file)
(load custom-file))
;;;; Personal Information Setup
(setq user-full-name "Daniel Ziltener"
user-mail-address "dziltener@lyrion.ch")
(auth-source-pass-enable)
;;;; Straight.el
;; (defvar bootstrap-version)
;; (let ((bootstrap-file
;; (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
;; (bootstrap-version 6))
;; (unless (file-exists-p bootstrap-file)
;; (with-current-buffer
;; (url-retrieve-synchronously
;; "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
;; 'silent 'inhibit-cookies)
;; (goto-char (point-max))
;; (eval-print-last-sexp)))
;; (load bootstrap-file nil 'nomessage))
;; (setq straight-use-package-by-default t)
;;;; Package Management Configuration
;; See: https://github.com/radian-software/el-patch
(use-package el-patch)
;;;; Emacs
(use-package emacs
:custom
(completion-cycle-threshold 10)
(read-extended-command-predicate #'command-completion-default-include-p)
(tab-always-indent 'complete)
(global-hl-line-mode t)
(menu-bar-mode nil)
(scroll-bar-mode nil)
(tool-bar-mode nil))
;;;; Org Mode
(use-package org
:ensure t
:hook
(org-src-mode . hack-local-variables)
:config
(setq org-directory "~/org")
(add-to-list 'org-modules 'collector))
(use-package org-roam
:ensure t
:custom
(org-roam-directory "~/org/roam")
:config
(progn (org-roam-db-autosync-mode)))
(use-package websocket
:ensure t
:after org-roam)
(use-package org-roam-ui
:ensure t
:after org-roam
:custom
(org-roam-ui-sync-theme t)
(org-roam-ui-follow t)
(org-roam-ui-update-on-save t)
(org-roam-ui-open-on-start t))
(use-package org-modern
:ensure t
:hook
((org-mode . org-modern-mode)
(org-agenda-finalize . org-modern-agenda)))
(use-package org-rainbow-tags
:hook
(org-mode . org-rainbow-tags-mode))
;;;; Design
(use-package color-theme-modern)
(use-package moe-theme)
(use-package catppuccin-theme
:custom
(catppuccin-flavor 'mocha)
(catppuccin-highlight-matches t)
(catppuccin-italic-comments t)
:custom-face
(font-lock-doc-face ((t (:inherit font-lock-comment-face
:foreground "#fab387"))))
:config
(load-theme 'catppuccin))
(set-frame-parameter nil 'alpha-background 80)
(add-to-list 'default-frame-alist '(alpha-background . 80))
(set-frame-font "Victor Mono Nerd Font-10:bold" nil t)
;;;; Security
(use-package keychain-environment
:init
(keychain-refresh-environment))
(use-package pass)
(use-package password-store)
(use-package password-store-otp)
;;;; Evil Mode
(use-package evil
;; :after evil-leader
:ensure t
:init
(setq evil-want-keybinding nil)
:config
(evil-set-leader 'normal (kbd "<SPC>"))
(evil-set-leader 'normal (kbd "z") t)
(evil-mode 1)
:bind
(:map evil-normal-state-map
("<leader>f" . 'find-file)
("<leader>k" . 'kill-buffer)))
(use-package evil-collection
:after evil
:ensure t
:custom
(evil-collection-outline-bind-tab-p 1)
:commands evil-collection-init
:init
(evil-collection-init))
;;;; Search, Completion, Execution
;;;;; Preliminary Packages
(use-package savehist
:init
(savehist-mode))
(use-package orderless
:after eglot
:config
(setq completion-styles '(orderless basic)
completion-category-defaults nil
completion-category-overrides '((file (styles partial-completion)))))
(use-package consult
:bind
(:map evil-normal-state-map
("<leader><SPC>" . 'consult-find)
("<leader>es" . 'consult-eglot-symbols)
("<leader>b" . 'consult-buffer)
("<leader>g/" . 'consult-git-grep)
("<leader>/" . 'consult-grep)
("/" . 'consult-line)))
(use-package embark
:bind
("C-<SPC>" . 'embark-act)
("C-M-<return>" . 'embark-bindings))
(use-package embark-consult
:after (embark consult)
:hook
(embark-collect-mode . consult-preview-at-point-mode))
(use-package vertico
:commands
vertico-mode
:init
(vertico-mode))
(use-package marginalia
:commands
marginalia-mode
:init
(marginalia-mode))
(use-package nerd-icons-completion
:after marginalia
:commands
nerd-icons-completion-mode
:hook
(marginalia-mode-hook . nerd-icons-completion-marginalia-setup)
:init
(nerd-icons-completion-mode))
(use-package which-key
:commands
which-key-setup-minibuffer
:init
(which-key-setup-minibuffer))
;;;;; Code Completion
(use-package cape
:config
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster))
(defun my/corfu-combined-sort (candidates)
"Sort CANDIDATES using both display-sort-function and corfu-sort-function."
(let ((candidates
(let ((display-sort-func (corfu--metadata-get 'display-sort-function)))
(if display-sort-func
(funcall display-sort-func candidates)
candidates))))
(if corfu-sort-function
(funcall corfu-sort-function candidates)
candidates)))
(use-package corfu
:custom
(corfu-cycle t)
(corfu-preselect 'prompt)
(corfu-auto t)
(corfu-scroll-margin 5)
(corfu-quit-no-match 'separator)
(evil-collection-corfu-key-themes '(tab-n-go))
:config
(setq corfu-sort-override-function #'my/corfu-combined-sort)
:commands
global-corfu-mode
:init
(global-corfu-mode)
;:bind
;; (:map corfu-map
;; ("TAB" . corfu-next)
;; ([tab] . corfu-next)
;; ("S-TAB" . corfu-previous)
;; ([backtab] . corfu-previous))
)
(use-package corfu-history
:config
(add-to-list 'savehist-additional-variables 'corfu-history)
:hook
(global-corfu-mode . corfu-history-mode))
(use-package corfu-popupinfo
:after (corfu corfu-terminal)
:custom
(corfu-popupinfo-delay '(0.1 . 0.5))
:commands
corfu-popupinfo-mode
:init
(corfu-popupinfo-mode))
(use-package nerd-icons-corfu
:after corfu
:init
(add-to-list 'corfu-margin-formatters 'nerd-icons-corfu-formatter))
(use-package corfu-terminal
:if (display-graphic-p)
:after corfu
:commands
corfu-terminal-mode
:init
(corfu-terminal-mode +1))
(use-package tempel)
;;;; Basic Navigation
(use-package goto-chg
:bind
(:map evil-normal-state-map
("g," . 'goto-last-change)
("g;" . 'goto-last-change-reverse)))
;;;; Lisp Navigation and Editing
;;;;; Basic
(use-package lispy
;;:custom
;;(lispy-compat ("cider" "edebug" "magit-blame-mode"))
:hook
emacs-lisp-mode
:config
(setq lispy-close-quotes-at-end-p t)
(evil-define-key 'insert 'prog-mode-map
"(" #'lispy-parens
"{" #'lispy-braces
"}" #'special-lispy-brackets
")" #'lispy-right-nostring
"\"" #'lispy-quotes
(kbd "<DEL>") #'lispy-delete-backward
">" #'special-lispy-slurp
"<" #'special-lispy-barf
"r" #'special-lispy-raise
"e" #'special-lispy-eval))
(use-package lispyville
:bind
(:map evil-normal-state-map
("<leader>," . 'lispyville-comment-or-uncomment)
("<leader>." . 'lispyville-comment-and-clone-dwim)
("<leader>ci" . 'lispyville-comment-or-uncomment-line))
:hook
(lispy-mode . lispyville-mode))
;;;;; Visual Aid
(use-package rainbow-delimiters
:hook
emacs-lisp-mode)
;;;; Programming
(use-package editorconfig
:commands
editorconfig-mode
:init
(editorconfig-mode 1))
(defun my/eglot-capf ()
(setq-local completion-at-point-functions
(list (cape-super-capf
#'eglot-completion-at-point
#'tempel-complete
#'cape-file
#'cape-dict))))
(use-package eglot
:custom
(eglot-connect-timeout 90)
(eglot-autoshutdown t)
(eglot-report-progress t)
:config
(defun eglot-mode ()
(eglot-inlay-hints-mode +1)
(my/eglot-capf))
(setq-default eglot-workspace-configuration
'((clojure-lsp (maxCompletions . 300))))
(add-to-list 'eglot-server-programs
'((clojure-ts-mode clojurec-ts-mode clojurescript-ts-mode)
"clojure-lsp"
:initializationOptions
(:preferences
(:includeInlayParameterNameHints
"all"
:includeInlayParameterNameHintsWhenArgumentMatchesName
t
:includeInlayFunctionParameterTypeHints
t
:includeInlayVariableTypeHints
t
:includeInlayVariableTypeHintsWhenTypeMatchesName
t
:includeInlayPRopertyDeclarationTypeHints
t
:includeInlayFunctionLikeReturnTypeHints
t
:includeInlayEnumMemberValueHints
t))))
:hook
(eglot-managed-mode . eglot-inlay-hints-mode)
(eglot-managed-mode . #'my/eglot-capf))
(use-package consult-eglot
:after (consult eglot))
(use-package tree-sitter
:ensure t)
;;;;; Clojure
(use-package clojure-ts-mode
:after (tree-sitter cider lispy)
:config
(require 'sesman)
(sesman-install-menu clojure-mode-map)
:hook
((clojure-ts-mode . eglot-ensure)
(clojure-ts-mode . rainbow-delimiters-mode)
(clojure-ts-mode . (lambda () (setq-local sesman-system 'CIDER)))
(clojure-ts-mode . (lambda () (sesman-install-menu clojure-mode-map)))
(clojurec-ts-mode . (lambda () (sesman-install-menu clojurec-mode-map)))
(clojurescript-ts-mode . (lambda () (sesman-install-menu clojurescript-mode-map))))
:mode (("\\.clj\\'" . clojure-ts-mode)
("\\.cljc\\'" . clojurec-ts-mode)
("\\.cljs\\'" . clojurescript-ts-mode))
:init
(add-to-list 'lispy-clojure-modes 'clojure-ts-mode)
(add-to-list 'lispy-clojure-modes 'clojurec-ts-mode)
(add-to-list 'lispy-clojure-modes 'clojurescript-ts-mode)
(add-to-list 'tree-sitter-major-mode-language-alist '(clojure-ts-mode . clojure))
(add-to-list 'tree-sitter-major-mode-language-alist '(clojurec-ts-mode . clojure))
(add-to-list 'tree-sitter-major-mode-language-alist '(clojurescript-ts-mode . clojure)))
(use-package cider
:hook
(clojure-ts-mode . cider-mode)
:config
(evil-define-key 'insert 'cider-mode-map
"C-x C-e" #'cider-eval-last-sexp)
(evil-define-key 'normal 'cider-mode-map
(kbd "<localleader>ce") #'cider-eval-sexp-at-point))
;;;;; Chicken Scheme
(defun flymake-chicken-init ()
(add-hook 'flymake-diagnostic-functions #'flymake-chicken-backend nil t)
(flymake-mode))
(use-package geiser
:config
(defalias 'run-geiser 'geiser))
(use-package lsp-scheme
:autoload lsp-scheme-chicken
:hook
(scheme-mode . lsp-scheme)
:custom
(lsp-scheme-implementation "chicken")
:config
(progn (add-to-list 'eglot-server-programs '(scheme-mode . ("chicken-lsp-server"))))
(require 'lsp-scheme))
;; (use-package flymake-chicken
;; :hook
;; ((scheme-mode . flymake-chicken-init)
;; (scheme-mode . flymake-mode))
;; :custom
;; (flycheck-global-modes '(not scheme-mode))
;; :config
;; (add-hook 'flymake-diagnostic-functions #'flymake-chicken-backend nil t))
;;;; Other Languages
(use-package nix-ts-mode
:hook
eglot-ensure
:mode ("\\.nix\\'" . nix-ts-mode))
;; (use-package lsp-tailwindcss
;; :init
;; (setq lsp-tailwindcss-add-on-mode t
;; lsp-tailwindcss-experimental-class-regex ["\"([^\"]*)\""])
;; :config
;; (add-to-list 'lsp-tailwindcss-major-modes 'clojurescript-ts-mode)
;; (add-to-list 'lsp-tailwindcss-major-modes 'clojurec-ts-mode))
(use-package dhall-mode
:mode "\\.dhall\'"
:hook
((dhall-mode . lsp)))
;;;; Version Control
;;;;; Git
(use-package magit
:autoload
magit)
(use-package magit-todos
:after magit
:hook
(magit-mode . magit-todos-mode))
(use-package forge
:after magit
:config
(advice-add 'magit :after (lambda (&rest _args) (call-interactively #'forge-pull))))
(use-package code-review
:after forge
:custom
(code-review-auth-login-marker 'forge))
(use-package git-gutter
:hook prog-mode)
;;;; LaTeX
;; https://github.com/politza/pdf-tools/#known-problems
(add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)
;;;; Communication
;;;;; IRC
(use-package circe
:ensure t
:hook
(circe-chat-mode . enable-circe-color-nicks)
:custom
(circe-network-options
'(("Lyrion Libera Chat"
:host "lyrion.ch"
:port 6697
:tls t
:nick "zilti"
:sasl-username "zilti/irc.libera.chat"
:sasl-password (lambda (_) (password-store-get "Privat/Soju"))))))
(provide 'init)
;;; init.el ends here
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
'("75fb82e748f32de807b3f9e8c72de801fdaeeb73c791f405d8f73711d0710856" "0527c20293f587f79fc1544a2472c8171abcc0fa767074a0d3ebac74793ab117" default))
'(magit-todos-insert-after '(bottom) nil nil "Changed by setter of obsolete option `magit-todos-insert-at'")
'(safe-local-variable-values
'((eval progn
(global-display-fill-column-indicator-mode t)
(make-variable-buffer-local 'cider-jack-in-nrepl-middlewares)
(add-to-list 'cider-jack-in-nrepl-middlewares "shadow.cljs.devtools.server.nrepl/middleware")))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

19
emacs/templates Normal file
View File

@ -0,0 +1,19 @@
fundamental-mode
(sign "-- DZ " (format-time-string "%Y-%m-%d"))
prog-mode
(vip-title (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) " " (make-string (length str) ?=) " " n
(if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) " " (s str) " " n
(if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) " " (make-string (length str) ?=) " " n)
(fixme (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "FIXME ")
(todo (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "TODO ")
(bug (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "BUG ")
(hack (if (derived-mode-p 'emacs-lisp-mode) ";; " comment-start) "HACK ")
;; Local Variables:
;; mode: lisp-data
;; outline-regexp: "[a-z]"
;; End:

284
flake.lock Normal file
View File

@ -0,0 +1,284 @@
{
"nodes": {
"flatpaks": {
"inputs": {
"nixpkgs": "nixpkgs",
"utils": "utils"
},
"locked": {
"lastModified": 1699549615,
"narHash": "sha256-llttqyX8LwAeL2nxHN97FFEQ3Kf8meyQWxShVKMva54=",
"owner": "GermanBread",
"repo": "declarative-flatpak",
"rev": "9acb7b2dbb47173fc8427e7841d8b1eade2fba66",
"type": "github"
},
"original": {
"owner": "GermanBread",
"ref": "stable",
"repo": "declarative-flatpak",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1699783872,
"narHash": "sha256-4zTwLT2LL45Nmo6iwKB3ls3hWodVP9DiSWxki/oewWE=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "280721186ab75a76537713ec310306f0eba3e407",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "home-manager",
"type": "github"
}
},
"hyprland": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"nixpkgs": "nixpkgs_2",
"systems": "systems_2",
"wlroots": "wlroots",
"xdph": "xdph"
},
"locked": {
"lastModified": 1699893778,
"narHash": "sha256-Sq/l7BPoeCMtTFQ/B0qdAmNgrykDMAz8Vv2neZqGJbU=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "5edb4e4a304bbef1de30a36f7b921ea328d7efc6",
"type": "github"
},
"original": {
"owner": "hyprwm",
"ref": "main",
"repo": "Hyprland",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1691753796,
"narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"nix-filter": {
"locked": {
"lastModified": 1693833173,
"narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "nix-filter",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1697777081,
"narHash": "sha256-n2vQARhKevRGyeo+LAa8g+CdUQsdH/caNk8jnylcPhY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "679cadfdfed2b90311a247b2d6ef6dfd3d6cab73",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1698134075,
"narHash": "sha256-foCD+nuKzfh49bIoiCBur4+Fx1nozo+4C/6k8BYk4sg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8efd5d1e283604f75a808a20e6cde0ef313d07d4",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1699781429,
"narHash": "sha256-UYefjidASiLORAjIvVsUHG6WBtRhM67kTjEY4XfZOFs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e44462d6021bfe23dfb24b775cc7c390844f773d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flatpaks": "flatpaks",
"home-manager": "home-manager",
"hyprland": "hyprland",
"nixpkgs": "nixpkgs_3",
"split-monitor-workspaces": "split-monitor-workspaces"
}
},
"split-monitor-workspaces": {
"inputs": {
"hyprland": [
"hyprland"
],
"nix-filter": "nix-filter"
},
"locked": {
"lastModified": 1698179193,
"narHash": "sha256-zDW+72enuRGuLLRbO1+pYk8FgRjQrBGksIAOk88OwOI=",
"owner": "Duckonaut",
"repo": "split-monitor-workspaces",
"rev": "2b1abdbf9e9de9ee660540167c8f51903fa3d959",
"type": "github"
},
"original": {
"owner": "Duckonaut",
"repo": "split-monitor-workspaces",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"wlroots": {
"flake": false,
"locked": {
"host": "gitlab.freedesktop.org",
"lastModified": 1699292815,
"narHash": "sha256-HXu98PyBMKEWLqiTb8viuLDznud/SdkdJsx5A5CWx7I=",
"owner": "wlroots",
"repo": "wlroots",
"rev": "5de9e1a99d6642c2d09d589aa37ff0a8945dcee1",
"type": "gitlab"
},
"original": {
"host": "gitlab.freedesktop.org",
"owner": "wlroots",
"repo": "wlroots",
"rev": "5de9e1a99d6642c2d09d589aa37ff0a8945dcee1",
"type": "gitlab"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": [
"hyprland",
"hyprland-protocols"
],
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1697981233,
"narHash": "sha256-y8q4XUwx+gVK7i2eLjfR32lVo7TYvEslyzrmzYEaPZU=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "22e7a65ff9633e1dedfa5317fdffc49f68de2ff2",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

57
flake.nix Normal file
View File

@ -0,0 +1,57 @@
{
description = "zilti's NixOS";
nixConfig = {
experimental-features = [ "nix-command" "flakes" ];
substituters = [
"https://cache.nixos.org"
];
extra-substituters = [
"https://cache.nixos.org"
"https://hyprland.cachix.org"
"https://nix-community.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
url = "github:hyprwm/Hyprland/main";
};
split-monitor-workspaces = {
url = "github:Duckonaut/split-monitor-workspaces";
inputs.hyprland.follows = "hyprland";
};
flatpaks.url = "github:GermanBread/declarative-flatpak/stable";
};
outputs = inputs@{ nixpkgs, home-manager, hyprland, split-monitor-workspaces, flatpaks, ... }: {
nixosConfigurations = {
"ziltis-desktop" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
#specialArgs = { inherit inputs; };
modules = [
/etc/nixos/configuration.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.zilti = import ./home.nix;
home-manager.extraSpecialArgs = inputs;
home-manager.sharedModules = [
flatpaks.homeManagerModules.default
];
}
];
};
};
};
}

495
home.nix Normal file
View File

@ -0,0 +1,495 @@
args@{ config, pkgs, hyprland, split-monitor-workspaces, flatpaks, ... }:
{
home.username = "zilti";
home.homeDirectory = "/home/zilti";
home.packages = with pkgs; [
pwvucontrol
sysstat
lm_sensors
pciutils
usbutils
coreutils-full
unzip
(nerdfonts.override { fonts = [ "VictorMono" "MPlus" ]; })
lagrange
stow
nixfmt
pinentry-qt
libsForQt5.ksshaskpass
swappy
grim
slurp
hyprpaper
gamescope
git-cola
fossil
nil
gcc
libgccjit
chicken
clojure
clojure-lsp
clj-kondo
babashka
podman-compose
sqlite
nodejs_20
sqlite
tofi
pinentry-qt
wlr-randr
nwg-displays
libsForQt5.okular
libsForQt5.dolphin
kteatime
discord
bitwarden
freetube
space-cadet-pinball
qtpass
ungoogled-chromium
slack
signal-desktop
telegram-desktop
zoom-us
git-filter-repo
git-doc
# For pharo
freetype
pixman
SDL2
libffi
libuuid
libsForQt5.ksshaskpass
perl538Packages.IOSocketSSL
perl538Packages.DigestHMAC
perl538Packages.TermReadKey
perl538Packages.MIMELite
perl538Packages.FileLibMagic
perl538Packages.IOSocketINET6
iconv
];
imports = [ ./hyprland/hyprland.nix ./waybar/settings.nix ./emacs/emacs.nix ];
home.stateVersion = "23.11";
programs.home-manager.enable = true;
home.sessionPath = [ "${config.home.homeDirectory}/.config/emacs/bin" ];
home.sessionVariables = {
PASSWORD_STORE_DIR =
"${config.home.homeDirectory}/.local/share/password-store";
SSH_ASKPASS = "${pkgs.libsForQt5.ksshaskpass}/bin/ksshaskpass";
};
home.pointerCursor = {
package = pkgs.catppuccin-cursors.lattePeach;
gtk.enable = true;
x11.enable = true;
name = "Catppuccin-Latte-Peach-Cursors";
size = 32;
};
accounts = {
calendar = {
basePath = "${config.home.homeDirectory}/calendars";
accounts = {
nextcloud = {
primary = true;
remote = {
type = "caldav";
url = "https://nextcloud.lyrion.ch/remote.php/dav/calendars/zilti";
userName = "dziltener@lyrion.ch";
passwordCommand = [ "pass" "Privat/Nextcloud" ];
};
vdirsyncer = {
enable = true;
auth = "guess";
itemTypes = "caldav";
};
khal = {
enable = true;
type = "discover";
};
};
};
};
contact = {
basePath = "${config.home.homeDirectory}/contacts";
accounts = {
nextcloud = {
remote = {
type = "carddav";
url =
"https://nextcloud.lyrion.ch/rempte.php/dav/addressbooks/users/zilti";
userName = "dziltener@lyrion.ch";
passwordCommand = [ "pass" "Privat/Nextcloud" ];
};
vdirsyncer = {
enable = false;
auth = "digest";
};
khal = { enable = true; };
khard = { enable = true; };
};
};
};
email = {
accounts = {
LMail = {
realName = "Daniel Ziltener";
userName = "dziltener";
passwordCommand = "pass Privat/Mailaccount | head -n 1";
primary = true;
address = "dziltener@lyrion.ch";
imap = {
host = "lyrion.ch";
tls = {
enable = true;
useStartTls = true;
};
};
smtp = {
host = "lyrion.ch";
tls = {
enable = true;
useStartTls = true;
};
};
thunderbird = { enable = true; };
aerc = { enable = true; };
};
RedSky = {
flavor = "gmail.com";
realName = "Daniel Ziltener";
userName = "dz@redsky.io";
passwordCommand = "pass Privat/RedSkyGMail";
address = "dz@redsky.io";
thunderbird = { enable = true; };
};
};
};
};
services.flatpak = {
enableModule = true;
remotes = {
"flathub" = "https://dl.flathub.org/repo/flathub.flatpakrepo";
"flathub-beta" =
"https://dl.flathub.org/beta-repo/flathub-beta.flatpakrepo";
};
packages = [
"flathub:app/com.github.tchx84.Flatseal//stable"
"flathub:app/com.usebottles.bottles//stable"
"flathub:app/com.valvesoftware.Steam//stable"
"flathub:app/info.beyondallreason.bar//stable"
];
};
fonts.fontconfig.enable = true;
services.plan9port = {
fontsrv.enable = true;
plumber.enable = true;
};
programs.kitty = {
enable = true;
environment = { };
settings = {
background_opacity = "0.85";
kitty_mod = "ctrl+shift";
enabled_layouts = "horizontal";
};
keybindings = { "kitty_mod+enter" = "new_window"; };
font = {
name = "VictorMono Nerd Font Mono";
size = 10;
};
theme = "Catppuccin-Frappe";
};
programs.bash = {
enable = true;
enableCompletion = true;
bashrcExtra = ''
eval "$(${pkgs.starship}/bin/starship init bash)"
'';
};
programs.tmux = {
enable = true;
mouse = true;
extraConfig = ''set-option -sa terminal-overrides ",xterm*:Tc"'';
};
# https://github.com/nix-community/nix-direnv
programs.direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
programs.starship = let flavour = "frappe";
in {
enable = true;
settings = {
aws.disabled = true;
gcloud.disabled = true;
format = "$all";
palette = "catppuccin_${flavour}";
} // builtins.fromTOML (builtins.readFile (pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "starship";
rev = "5629d2356f62a9f2f8efad3ff37476c19969bd4f";
sha256 = "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0=";
} + /palettes/${flavour}.toml));
};
programs.hstr = { enable = true; };
programs.htop = { enable = true; };
programs.ripgrep = { enable = true; };
programs.gpg = { enable = true; };
# services.gpg-agent = {
# enable = true;
# pinentryFlavor = "qt";
# extraConfig = ''
# allow-emacs-pinentry
# allow-loopback-pinentry
# '';
# };
home.file.gpg-agent-conf = {
enable = true;
target = ".gnupg/gpg-agent.conf";
text = ''
grab
pinentry-program ${pkgs.pinentry-qt}/bin/pinentry-qt
allow-emacs-pinentry
allow-loopback-pinentry
'';
};
programs.rbw = {
enable = true;
settings = {
base_url = "vaultwarden.lyrion.ch";
email = "dziltener@lyrion.ch";
pinentry = "qt";
};
};
programs.git = {
enable = true;
userName = "Daniel Ziltener";
userEmail = "dziltener@lyrion.ch";
signing = {
key = "37F655BAF43BC0FF300A91A1B38976E82C9DAE42";
signByDefault = true;
};
diff-so-fancy = { enable = true; };
extraConfig = {
sendemail = {
smtpserver = "lyrion.ch";
smtpuser = "dziltener";
smtpencryption = "starttls";
smtpserverport = 465;
};
rebase.autoStash = true;
pull.rebase = true;
push.autoSetupRemote = true;
};
};
programs.git-cliff = {
enable = true;
# https://git-cliff.org/docs/configuration
settings = { };
};
programs.tealdeer = { enable = true; };
# https://github.com/ianthehenry/sd
programs.script-directory = {
enable = true;
settings = { SD_EDITOR = "vim"; };
};
programs.keychain = {
enable = true;
enableBashIntegration = true;
enableXsessionIntegration = true;
agents = [ "ssh" "gpg" ];
keys =
[ "id_rsa" "personal_ed" "37F655BAF43BC0FF300A91A1B38976E82C9DAE42" ];
};
programs.password-store = {
enable = true;
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
};
programs.browserpass = { enable = true; };
services.pueue = { enable = true; };
services.network-manager-applet.enable = true;
services.batsignal = { enable = true; };