commit 87c5c650b9ae6162fa53bbedcb6d99eb88cadf95 Author: Daniel Ziltener Date: Wed Nov 15 17:09:47 2023 +0100 In the beginning there was darkness. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f754bc0 --- /dev/null +++ b/.gitignore @@ -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 +*~ + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3aaf286 --- /dev/null +++ b/Makefile @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..d9f2d43 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# nixconfig + diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..5e30e1e --- /dev/null +++ b/configuration.nix @@ -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? + +} + diff --git a/disko-config.nix b/disko-config.nix new file mode 100644 index 0000000..0d6f188 --- /dev/null +++ b/disko-config.nix @@ -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"; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/emacs/emacs.nix b/emacs/emacs.nix new file mode 100644 index 0000000..e13e639 --- /dev/null +++ b/emacs/emacs.nix @@ -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 + ]; + }; +} diff --git a/emacs/init.el b/emacs/init.el new file mode 100644 index 0000000..2a11cdc --- /dev/null +++ b/emacs/init.el @@ -0,0 +1,525 @@ +;;; init.el --- Description -*- lexical-binding: t; -*- +;; +;; Copyright (C) 2023 Daniel Ziltener +;; +;; Author: Daniel Ziltener +;; Maintainer: Daniel Ziltener +;; 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 "")) + (evil-set-leader 'normal (kbd "z") t) + (evil-mode 1) + :bind + (:map evil-normal-state-map + ("f" . 'find-file) + ("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 + ("" . 'consult-find) + ("es" . 'consult-eglot-symbols) + ("b" . 'consult-buffer) + ("g/" . 'consult-git-grep) + ("/" . 'consult-grep) + ("/" . 'consult-line))) + +(use-package embark + :bind + ("C-" . 'embark-act) + ("C-M-" . '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 "") #'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 + ("," . 'lispyville-comment-or-uncomment) + ("." . 'lispyville-comment-and-clone-dwim) + ("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 "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. + ) diff --git a/emacs/templates b/emacs/templates new file mode 100644 index 0000000..682abe5 --- /dev/null +++ b/emacs/templates @@ -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: diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..7e84a48 --- /dev/null +++ b/flake.lock @@ -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 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f278dd2 --- /dev/null +++ b/flake.nix @@ -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 + ]; + } + ]; + }; + }; + }; +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..f4e10c7 --- /dev/null +++ b/home.nix @@ -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; }; + + # services.fusuma = { + # enable = true; + # }; + + services.copyq = { enable = true; }; + + # programs.vdirsyncer = { + # enable = true; + # }; + + services.vdirsyncer = { enable = true; }; + + # programs.khal = { + # enable = true; + # }; + + # programs.khard = { + # enable = true; + # }; + + programs.aerc = { + enable = true; + extraConfig = { general = { unsafe-accounts-conf = true; }; }; + }; + + services.kdeconnect = { + enable = true; + indicator = true; + }; + + programs.ssh = { + enable = true; + matchBlocks = { + "github.com" = { + user = "git"; + hostname = "github.com"; + identitiesOnly = true; + identityFile = "~/.ssh/personal_ed"; + }; + "gitea.lyrion.ch" = { + user = "git"; + hostname = "gitea.lyrion.ch"; + port = 7920; + identitiesOnly = true; + identityFile = "~/.ssh/personal_ed"; + }; + }; + }; + + # services.ssh-agent.enable = true; + + services.nextcloud-client = { + enable = true; + startInBackground = true; + }; + + programs.swaylock = { + enable = true; + package = "${pkgs.swaylock-effects}"; + settings = { + screenshots = true; + clock = true; + indicator-idle-visible = true; + grace = 3; + fade-in = 3; + effect-blur = "7x5"; + effect-vignette = "0.5:0.5"; + }; + }; + + services.swayidle = { + enable = true; + events = [ ]; + timeouts = [{ + timeout = 600; + command = "${pkgs.swaylock-effects}/bin/swaylock"; + }]; + }; + + services.mako = { + enable = true; + defaultTimeout = 5000; + }; + + services.gammastep = { + enable = true; + provider = "geoclue2"; + temperature = { + day = 5500; + night = 2700; + }; + }; + + # programs.waybar = { + # enable = true; + # systemd.enable = true; + # style = builtins.readFile ./waybar/style.css; + # settings = import ./waybar/settings.nix; + # }; + + programs.wlogout = { enable = true; }; + + programs.fuzzel = { + enable = true; + settings = { + main = { + terminal = "${pkgs.kitty}/bin/kitty"; + width = 100; + fields = "filename,name,generic,exec"; + filter-desktop = false; + layer = "overlay"; + }; + }; + }; + + home.file.tofi-conf = { + enable = true; + target = ".config/tofi/config"; + text = '' + drun-launch = true + font = Victor Mono Nerd Font + font-size = 12 + text-cursor = true + terminal = kitty + width = 1200 + height = 720 + '' + (builtins.readFile (pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "tofi"; + rev = "2e74ddba0c582b2ca2d9d06f67f5a902c3a093fb"; + sha256 = "sha256-XUwixvy2WyfaSRHM8cTnOn8lKv+vbhheDA1Z47ap+Mc="; + } + /catppuccin-latte)); + }; + + qt = { + enable = true; + style.name = "breeze"; + }; + + programs.firefox = { + enable = true; + profiles.default = { isDefault = true; }; + }; + + programs.thunderbird = { + enable = true; + profiles.default = { isDefault = true; }; + }; +} diff --git a/hyprland/hyprland.nix b/hyprland/hyprland.nix new file mode 100644 index 0000000..40c9e26 --- /dev/null +++ b/hyprland/hyprland.nix @@ -0,0 +1,171 @@ +{ config, lib, pkgs, hyprland, wayland, split-monitor-workspaces, ... }: + +{ + + home.file.hyprland-catppuccino = let flavour = "frappe"; + in { + enable = true; + target = ".config/hypr/catppuccino.conf"; + text = builtins.readFile (pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "hyprland"; + rev = "99a88fd21fac270bd999d4a26cf0f4a4222c58be"; + sha256 = "sha256-07B5QmQmsUKYf38oWU3+2C6KO4JvinuTwmW1Pfk8CT8="; + } + /themes/${flavour}.conf); + }; + + wayland.windowManager.hyprland = { + enable = true; + systemd.enable = true; + package = hyprland.packages.${pkgs.system}.hyprland; + plugins = [ + split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces + ]; + settings = { + source = + [ "~/.config/hypr/monitors.conf" "~/.config/hypr/catppuccino.conf" ]; + input = { + kb_layout = "de"; + kb_options = "caps:swapescape"; + follow_mouse = 1; + touchpad = { natural_scroll = false; }; + sensitivity = 0; + }; + general = { + gaps_in = 15; + gaps_out = 15; + border_size = 1; + resize_on_border = true; + "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + "col.inactive_border" = "rgba(595959aa)"; + layout = "master"; + }; + misc = { + vfr = true; + vrr = 1; + animate_manual_resizes = true; + }; + decoration = { + rounding = 10; + drop_shadow = true; + shadow_range = 4; + shadow_render_power = 3; + "col.shadow" = "rgba(1a1a1aee)"; + blur = { enabled = true; }; + }; + animations = { + enabled = true; + bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; + animation = [ + "windows, 1, 7, myBezier" + "windowsOut, 1, 7, default, popin 80%" + "border, 1, 10, default" + "borderangle, 1, 8, default" + "fade, 1, 7, default" + "workspaces, 1, 6, default" + ]; + }; + dwindle = { + pseudotile = false; + preserve_split = true; + force_split = 0; + default_split_ratio = 1.5; + }; + master = { + new_is_master = false; + orientation = "center"; + always_center_master = true; + mfact = 0.5; + special_scale_factor = 0.8; + }; + gestures = { workspace_swipe = false; }; + + "$lockscreen" = "${pkgs.swaylock-effects}/bin/swaylock"; + "$mainMod" = "SUPER"; + + bind = [ + "$mainMod, Q, exec, ${pkgs.kitty}/bin/kitty" + "$mainMod, C, killactive," + #"$mainMod, M, exit," + "$mainMod, M, exec, ${pkgs.wlogout}/bin/wlogout" + "$mainMod, E, exec, dolphin" + "$mainMod, V, togglefloating," + #"$mainMod, R, exec, ${pkgs.fuzzel}/bin/fuzzel" + "$mainMod, R, exec, ${pkgs.tofi}/bin/tofi-drun" + "$mainMod, P, pseudo," # dwindle + "$mainMod, J, togglesplit," # dwindle + "$mainMod, T, togglegroup," + "$mainMod, A, layoutmsg, swapwithmaster master" + "$mainMod, I, layoutmsg, orientationcenter" + "$mainMod, H, layoutmsg, orientationleft" + "$mainMod, L, layoutmsg, orientationright" + # Screenshots + #"SHIFT, PRINT, exec, hyprshot -m region" + '' + SHIFT, PRINT, exec, ${pkgs.grim}/bin/grim -g "$(${pkgs.slurp}/bin/slurp)" - | ${pkgs.swappy}/bin/swappy -f -'' + "$mainMod SHIFT, L, exec, $lockscreen" + # Move focus + "$mainMod, left, movefocus, l" + "$mainMod, right, movefocus, r" + "$mainMod, up, movefocus, u" + "$mainMod, down, movefocus, d" + + # Move windows inside a workspace + "$mainMod SHIFT, h, movewindoworgroup, l" + "$mainMod SHIFT, l, movewindoworgroup, r" + + #Handle tabbed windows + "$mainMod, tab, changegroupactive," + "$mainMod SHIFT, T, lockactivegroup, toggle" + + # Switch workspaces + "$mainMod, 1, split-workspace, 1" + "$mainMod, 2, split-workspace, 2" + "$mainMod, 3, split-workspace, 3" + "$mainMod, 4, split-workspace, 4" + "$mainMod, 5, split-workspace, 5" + "$mainMod, 6, split-workspace, 6" + "$mainMod, 7, split-workspace, 7" + "$mainMod, 8, split-workspace, 8" + "$mainMod, 9, split-workspace, 9" + # Move windows to workspaces + "$mainMod SHIFT, 1, split-movetoworkspace, 1" + "$mainMod SHIFT, 2, split-movetoworkspace, 2" + "$mainMod SHIFT, 3, split-movetoworkspace, 3" + "$mainMod SHIFT, 4, split-movetoworkspace, 4" + "$mainMod SHIFT, 5, split-movetoworkspace, 5" + "$mainMod SHIFT, 6, split-movetoworkspace, 6" + "$mainMod SHIFT, 7, split-movetoworkspace, 7" + "$mainMod SHIFT, 8, split-movetoworkspace, 8" + "$mainMod SHIFT, 9, split-movetoworkspace, 9" + "$mainMod SHIFT, ß, split-movetoworkspace, special" + # Scroll through workspaces + "$mainMod, mouse_down, workspace, e+1" + "$mainMod, mouse_up, workspace, e-1" + # Special workspace + "SHIFT ALT, RETURN, togglespecialworkspace" + ]; + + # Mouse bindings + # 274: Middle mouse button + # 275: left near + # 276: left far + # 277: right near + # 278: right far + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + + windowrulev2 = [ "tile,class:(pharo)" ]; + + # Autostart + exec-once = [ + "[workspace special] ${pkgs.kitty}/bin/kitty" + "sleep 1; hyprctl dispatch layoutmsg orientationleft; hyprctl dispatch togglespecialworkspace" + "hyprpaper" + ]; + }; + }; + +} diff --git a/iso.nix b/iso.nix new file mode 100644 index 0000000..968c313 --- /dev/null +++ b/iso.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: +{ + imports = [ + + + # Provide an initial copy of the NixOS channel so that the user + # doesn't need to run "nix-channel --update" first. + + ]; + + environment.systemPackages = with pkgs; [ + networkmanager + ]; +} diff --git a/waybar/settings.nix b/waybar/settings.nix new file mode 100644 index 0000000..f86628e --- /dev/null +++ b/waybar/settings.nix @@ -0,0 +1,103 @@ +{ config, lib, pkgs, programs, ... }: + +{ + programs.waybar = { + enable = true; + systemd.enable = true; + style = builtins.readFile ./style.css; + settings = { + mainBar = { + spacing = 4; + layer = "top"; + modules-left = [ "hyprland/workspaces" "wlr/mode" "wlr/scratchpad" "user" ]; + modules-center = [ "hyprland/window" ]; + modules-right = [ + "idle_inhibitor" + "network" + "cpu" + "memory" + "temperature" + "backlight" + "battery" + "battery#bat2" + "clock" + "wireplumber" + "tray" + ]; + "hyprland/workspaces" = { + on-scroll-up = "${pkgs.hyprland}/bin/hyprctl dispatch workspace e+1"; + on-scroll-down = + "${pkgs.hyprland}/bin/hyprctl dispatch workspace e-1"; + on-click = "activate"; + format = "{id}: {icon}"; + }; + "hyprland/window" = { format = "{}"; }; + "wlr/mode" = { format = ''{}''; }; + "wlr/scratchpad" = { + format = "{icon} {count}"; + show-empty = true; + format-icons = [ "" "" ]; + tooltip = true; + tooltip-format = "{app}: {title}"; + }; + user = { + format = "{user} (up {work_d} days ↑)"; + interval = 60; + icon = true; + }; + idle_inhibitor = { + format = "{icon}"; + format-icons = [ " " " " ]; + }; + tray = { spacing = 10; }; + clock = { + format = "{:%H:%M}  "; + tooltip-format = '' + {:%Y %B} + {calendar}''; + format-alt = "{:%Y-%m-%d}  "; + }; + cpu = { + format = "{usage}% {icon0} {icon1} {icon2} {icon3} {icon4} {icon5} {icon6} {icon7}"; + format-icons = [ "▁" "▂" "▃" "▄" "▅" "▆" "▇" "█" ]; + tooltip = false; + }; + memory = { format = "{}% "; }; + temperature = { + critical-threshold = 80; + format = "{temperatureC}°C"; + format-icons = [ "" ]; + }; + backlight = { + device = "intel_backlight"; + format = "{percent}% {icon}"; + format-icons = [ "" "" "" "" "" "" "" "" "" ]; + }; + battery = { + states = { + warning = 30; + critical = 15; + }; + format = "{capacity}% {icon}"; + format-icons = [ "" "" "" "" "" ]; + }; + "battery#bat2" = { bat = "BAT2"; }; + network = { + format-wifi = "{essid} ({signalStrength}%)  "; + format-ethernet = "{ipaddr}/{cidr} "; + tooltip-format = "{ifname} via {gwaddr} "; + format-linked = "{ifname} (No IP) "; + format-disconnected = "Disconnected ⚠"; + format-alt = "{ifname}: {ipaddr}/{cidr}"; + }; + wireplumber = { + format = "{volume}% {icon}"; + format-muted = "🔇"; + on-click = "${pkgs.pwvucontrol}/bin/pwvucontrol"; + format-icons = [ "" "" "" ]; + }; + }; + }; + + }; +} diff --git a/waybar/style.css b/waybar/style.css new file mode 100644 index 0000000..1b6610a --- /dev/null +++ b/waybar/style.css @@ -0,0 +1,280 @@ +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: 'MPlus Nerd Font', FontAwesome, Roboto, Helvetica, Arial, sans-serif; + font-size: 13px; +} + +window#waybar { + background-color: rgba(43, 48, 59, 0.5); + border-bottom: 3px solid rgba(100, 114, 125, 0.5); + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +/* +window#waybar.empty { + background-color: transparent; +} +window#waybar.solo { + background-color: #FFFFFF; +} +*/ + +window#waybar.termite { + background-color: #3F3F3F; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} + +button { + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 0; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +button:hover { + background: inherit; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button { + padding: 0 5px; + background-color: transparent; + color: #ffffff; +} + +#workspaces button:hover { + background: rgba(0, 0, 0, 0.2); +} + +#workspaces button.focused { + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#wireplumber, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#scratchpad, +#mpd { + padding: 0 10px; + color: #ffffff; +} + +#window, +#workspaces { + margin: 0 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; +} + +#clock { + background-color: #64727D; +} + +#battery { + background-color: #ffffff; + color: #000000; +} + +#battery.charging, #battery.plugged { + color: #ffffff; + background-color: #26A65B; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +#cpu { + background-color: #2ecc71; + color: #000000; +} + +#memory { + background-color: #9b59b6; +} + +#disk { + background-color: #964B00; +} + +#backlight { + background-color: #90b1b1; +} + +#network { + background-color: #2980b9; +} + +#network.disconnected { + background-color: #f53c3c; +} + +#pulseaudio { + background-color: #f1c40f; + color: #000000; +} + +#pulseaudio.muted { + background-color: #90b1b1; + color: #2a5c45; +} + +#wireplumber { + background-color: #fff0f5; + color: #000000; +} + +#wireplumber.muted { + background-color: #f53c3c; +} + +#custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; +} + +#custom-media.custom-spotify { + background-color: #66cc99; +} + +#custom-media.custom-vlc { + background-color: #ffa000; +} + +#temperature { + background-color: #f0932b; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#tray { + background-color: #2980b9; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +#idle_inhibitor { + background-color: #2d3436; +} + +#idle_inhibitor.activated { + background-color: #ecf0f1; + color: #2d3436; +} + +#mpd { + background-color: #66cc99; + color: #2a5c45; +} + +#mpd.disconnected { + background-color: #f53c3c; +} + +#mpd.stopped { + background-color: #90b1b1; +} + +#mpd.paused { + background-color: #51a37a; +} + +#language { + background: #00b093; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state > label { + padding: 0 5px; +} + +#keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); +} + +#scratchpad { + background: rgba(0, 0, 0, 0.2); +} + +#scratchpad.empty { + background-color: transparent; +}