From e75178c27637295a93b8f194eaa81ab2a42d55a1 Mon Sep 17 00:00:00 2001 From: th3r00t Date: Tue, 16 Sep 2025 15:02:56 -0400 Subject: [PATCH] Testing emacs --- flake.lock | 477 +++++++++++++++++- flake.nix | 38 +- home/common.nix | 2 + home/emacs.org | 433 ++++++++++++++++ home/xps13.nix | 2 +- .../configurations/configuration-Athena.nix | 11 - .../configurations/configuration-common.nix | 14 + .../configurations/configuration-server.nix | 11 - .../configurations/configuration-xps13.nix | 79 ++- modules/hyprland.nix | 27 +- modules/shells.nix | 42 +- modules/tmux.nix | 2 +- 12 files changed, 1049 insertions(+), 89 deletions(-) create mode 100644 home/emacs.org diff --git a/flake.lock b/flake.lock index 48c3405..6747cfa 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,38 @@ { "nodes": { + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1755946532, + "narHash": "sha256-POePremlUY5GyA1zfbtic6XLxDaQcqHN6l+bIxdT5gc=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "81584dae2df6ac79f6b6dae0ecb7705e95129ada", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, "disko": { "inputs": { "nixpkgs": "nixpkgs" @@ -50,6 +83,22 @@ "type": "github" } }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -94,8 +143,8 @@ }, "git-hooks": { "inputs": { - "flake-compat": "flake-compat_2", - "gitignore": "gitignore", + "flake-compat": "flake-compat_3", + "gitignore": "gitignore_2", "nixpkgs": [ "neovim-nightly-overlay", "nixpkgs" @@ -116,6 +165,28 @@ } }, "gitignore": { + "inputs": { + "nixpkgs": [ + "hyprland", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_2": { "inputs": { "nixpkgs": [ "neovim-nightly-overlay", @@ -179,14 +250,303 @@ "type": "github" } }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753964049, + "narHash": "sha256-lIqabfBY7z/OANxHoPeIrDJrFyYy9jAM4GQLzZ2feCM=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "44e91d467bdad8dcf8bbd2ac7cf49972540980a5", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1757542864, + "narHash": "sha256-8i9tsVoOmLQDHJkNgzJWnmxYFGkJNsSndimYpCoqmoA=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "aa9d14963b94186934fd0715d9a7f0f2719e64bb", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprgraphics": "hyprgraphics", + "hyprland-protocols": "hyprland-protocols", + "hyprland-qtutils": "hyprland-qtutils", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": "nixpkgs_2", + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1757936652, + "narHash": "sha256-qQi/z2sfqFpVnDP+oqIBXRxwRCsmtk7HFOrQF08h6e8=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "9e74d0aea7614eaf238ef07261129026572337e7", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-plugins": { + "inputs": { + "hyprland": [ + "hyprland" + ], + "nixpkgs": [ + "hyprland-plugins", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland-plugins", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1757774228, + "narHash": "sha256-6jAtMjnWq8kty/dpPbIKxIupUG+WAE2AKMIKhxdLYNo=", + "owner": "hyprwm", + "repo": "hyprland-plugins", + "rev": "5ff379f4e525183cc6766ea95764b52ec97d8966", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-plugins", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1749046714, + "narHash": "sha256-kymV5FMnddYGI+UjwIw8ceDjdeg7ToDVjbHCvUlhn14=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "613878cb6f459c5e323aaafe1e6f388ac8a36330", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland-qt-support": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprland-qtutils", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "hyprland-qtutils", + "nixpkgs" + ], + "systems": [ + "hyprland", + "hyprland-qtutils", + "systems" + ] + }, + "locked": { + "lastModified": 1749154592, + "narHash": "sha256-DO7z5CeT/ddSGDEnK9mAXm1qlGL47L3VAHLlLXoCjhE=", + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "rev": "4c8053c3c888138a30c3a6c45c2e45f5484f2074", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "type": "github" + } + }, + "hyprland-qtutils": { + "inputs": { + "hyprland-qt-support": "hyprland-qt-support", + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprland-qtutils", + "hyprlang", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1757508108, + "narHash": "sha256-bTYedtQFqqVBAh42scgX7+S3O6XKLnT6FTC6rpmyCCc=", + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "rev": "119bcb9aa742658107b326c50dcd24ab59b309b7", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1756810301, + "narHash": "sha256-wgZ3VW4VVtjK5dr0EiK9zKdJ/SOqGIBXVG85C3LVxQA=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "3d63fb4a42c819f198deabd18c0c2c1ded1de931", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1756117388, + "narHash": "sha256-oRDel6pNl/T2tI+nc/USU9ZP9w08dxtl7hiZxa0C/Wc=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "b2ae3204845f5f2f79b4703b441252d8ad2ecfd0", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1755184602, + "narHash": "sha256-RCBQN8xuADB0LEgaKbfRqwm6CdyopE1xIEhNc67FAbw=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "b3b0f1f40ae09d4447c20608e5a4faf8bf3c492d", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, "neovim-config": { "flake": false, "locked": { - "lastModified": 1757828301, - "narHash": "sha256-vjyWq2fMUAsO+BqXxuifh5LQ7yomZfS1qnQq2VQsJ0E=", + "lastModified": 1757956531, + "narHash": "sha256-qfkl4aiAkzb2H4LY2L6ZAqHs5YrAfPEr1qLvDrxcbJ0=", "ref": "New-Master", - "rev": "fcc084630ada799cff650d34056efa38c4f1f64d", - "revCount": 34, + "rev": "a9e3cd2d6814b678cc2da6d639bcd1c0251b4ae1", + "revCount": 37, "type": "git", "url": "https://git.th3r00t.net/th3r00t/nvim-config.git" }, @@ -198,12 +558,12 @@ }, "neovim-nightly-overlay": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "flake-parts": "flake-parts", "git-hooks": "git-hooks", "hercules-ci-effects": "hercules-ci-effects", "neovim-src": "neovim-src", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -289,6 +649,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1757487488, + "narHash": "sha256-zwE/e7CuPJUWKdvvTCB7iunV4E/+G0lKfv4kk/5Izdg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ab0f3607a6c7486ea22229b92ed2d355f1482ee0", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1757746433, "narHash": "sha256-fEvTiU4s9lWgW7mYEU/1QUPirgkn+odUBTaindgiziY=", @@ -304,7 +680,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1757745802, "narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=", @@ -320,15 +696,40 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1757588530, + "narHash": "sha256-tJ7A8mID3ct69n9WCvZ3PzIIl3rXTdptn/lZmqSS95U=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "b084b2c2b6bc23e83bbfe583b03664eb0b18c411", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "disko": "disko", "home-manager": "home-manager", + "hyprland": "hyprland", + "hyprland-plugins": "hyprland-plugins", "neovim-config": "neovim-config", "neovim-nightly-overlay": "neovim-nightly-overlay", "nix-index-database": "nix-index-database", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "sops-nix": "sops-nix" } }, @@ -352,6 +753,21 @@ "type": "github" } }, + "systems": { + "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" + } + }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -372,6 +788,47 @@ "repo": "treefmt-nix", "type": "github" } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1755354946, + "narHash": "sha256-zdov5f/GcoLQc9qYIS1dUTqtJMeDqmBmo59PAxze6e4=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "a10726d6a8d0ef1a0c645378f983b6278c42eaa0", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index f164484..36f1bdf 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,11 @@ url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; + hyprland.url = "github:hyprwm/Hyprland"; + hyprland-plugins = { + url = "github:hyprwm/hyprland-plugins"; + inputs.hyprland.follows = "hyprland"; + }; nix-index-database.url = "github:nix-community/nix-index-database"; nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; @@ -25,23 +30,23 @@ self, nixpkgs, home-manager, nix-index-database, sops-nix, disko, nixos-hardware, ... }@inputs: - let - overlays = [ - inputs.neovim-nightly-overlay.overlays.default + let + overlays = [ + inputs.neovim-nightly-overlay.overlays.default (final: prev: { - dosbox-x = prev.dosbox-x.overrideAttrs (old: { - buildInputs = (old.buildInputs or []) ++ [ prev.libGL prev.glew ]; - configureFlags = (old.configureFlags or []) ++ [ - "--enable-sdl2" - "--enable-opengl" - ]; - }); - }) - ]; + dosbox-x = prev.dosbox-x.overrideAttrs (old: { + buildInputs = (old.buildInputs or []) ++ [ prev.libGL prev.glew ]; + configureFlags = (old.configureFlags or []) ++ [ + "--enable-sdl2" + "--enable-opengl" + ]; + }); + }) + ]; in { nixosConfigurations.xps13 = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - specialArgs = { inherit overlays; }; + specialArgs = { inherit overlays inputs; }; modules = [ { nixpkgs.overlays = overlays; } sops-nix.nixosModules.sops @@ -50,6 +55,7 @@ nixos-hardware.nixosModules.dell-xps-13-9370 home-manager.nixosModules.home-manager { # Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix + home-manager.extraSpecialArgs = { inherit inputs; }; # home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.sharedModules = [ {nixpkgs.overlays = overlays;} ]; @@ -69,7 +75,7 @@ }; nixosConfigurations.Titan = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - specialArgs = { inherit overlays; }; + specialArgs = { inherit overlays inputs; }; modules = [ { nixpkgs.overlays = overlays; } disko.nixosModules.disko @@ -80,6 +86,7 @@ # home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.sharedModules = [ {nixpkgs.overlays = overlays;} ]; + home-manager.extraSpecialArgs = { inherit inputs; }; home-manager.users.th3r00t = { imports = [ ./home/server.nix @@ -97,7 +104,7 @@ }; nixosConfigurations.Athena = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; - specialArgs = { inherit overlays; }; + specialArgs = { inherit overlays inputs; }; modules = [ { nixpkgs.overlays = overlays; } disko.nixosModules.disko @@ -108,6 +115,7 @@ # home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.sharedModules = [ {nixpkgs.overlays = overlays;} ]; + home-manager.extraSpecialArgs = { inherit inputs; }; home-manager.users.th3r00t = { imports = [ ./home/server.nix diff --git a/home/common.nix b/home/common.nix index c438562..ef1c51b 100644 --- a/home/common.nix +++ b/home/common.nix @@ -30,6 +30,7 @@ ]; home.packages = with pkgs; [ autossh + elinks fastfetch ranger mpv @@ -55,6 +56,7 @@ nix-output-monitor devenv direnv + dotenv-cli irssi luarocks lua5_1 diff --git a/home/emacs.org b/home/emacs.org new file mode 100644 index 0000000..99b6ecb --- /dev/null +++ b/home/emacs.org @@ -0,0 +1,433 @@ +* Emacs litterate config file +I am using straight as the backend for use package and have thusly set it in +[./early-init.el] +** Use-Package +Install use-package and enable ':ensure t' globally. +#+begin_src emacs-lisp + (straight-use-package 'use-package) + (setq use-package-always-ensure t) + (use-package straight + :custom + (straight-use-package-by-default t)) +#+end_src +As a lifetime vim user I need to evil keys set up early +** Overrides +#+begin_src emacs-lisp + (setq custom-file (locate-user-emacs-file "custom-vars.el")) + (load custom-file 'noerror 'nomessage) + (setq global-auto-revert-non-file-buffers 't) +#+end_src +** Evil Mode +*** Undo-Tree +evil mode requires undo-tree so I have it set to compress the undo files +and enable undo-tree mode globally +#+begin_src emacs-lisp + (use-package undo-tree :config + (global-undo-tree-mode) + (setq undo-tree-auto-save-history t) + (defadvice undo-tree-make-history-save-filename + (after undo-tree activate) + (setq ad-return-value (concat ad-return-value ".gz")))) +#+end_src + +*** goto-chg +It also requires goto-chg +#+begin_src emacs-lisp + (use-package goto-chg) +#+end_src +*** Evil Mode +Now I hook in Evil mode +#+begin_src emacs-lisp + (use-package evil :config + (evil-mode 1) + (setq evil-search-module 'evil-search) + (setq evil-shift-width 2) + (setq evil-split-window-below 't) + (setq evil-vsplit-window-right 't) + (setq show-paren-mode 't) + (setq evil-undo-system 'undo-tree)) + (evil-set-leader '(normal visual motion) (kbd "SPC")) + (evil-define-key 'normal 'global + (kbd "f f") 'file-file + (kbd "f s") 'save-buffer + (kbd "f r") 'recentf-open-files + (kbd "e e") 'eval-buffer) +#+end_src +*** Evil Collection +#+begin_src emacs-lisp + (use-package evil-collection :after evil + :ensure t + :config + (evil-collection-init)) + (use-package evil-org :after org + :ensure t + :hook (org-mode . (lambda () evil-org-mode)) + :config + (require 'evil-org-agenda) + (evil-org-agenda-set-keys) + (setf evil-org-key-theme '(navigation insert textobjects additional)) + (setf org-special-ctrl-a/e t)) +#+end_src + +** UI +#+begin_src emacs-lisp + (use-package treemacs :config + (evil-define-key 'normal 'global (kbd " f e") 'treemacs)) +#+end_src +Enable which key mode +#+begin_src emacs-lisp + (which-key-mode) +#+end_src +** Theming +*** Fonts / icons +Icons must be installed 'all-the-icons-install +#+begin_src emacs-lisp + (use-package all-the-icons + :if (display-graphic-p)) + (use-package rainbow-delimiters :hook (prog-mode . rainbow-delimiters-mode)) +#+end_src +*** UI System +#+begin_src emacs-lisp + (require 'recentf) + (recentf-mode 1) + (setq history-length 50) + (savehist-mode 1) + (setq recentf-max-menu-items 25) + (save-place-mode 1) + (menu-bar-mode -1) + (tool-bar-mode -1) + (scroll-bar-mode -1) + (global-display-line-numbers-mode 1) + (hl-line-mode 1) + (blink-cursor-mode 1) +#+end_src +*** Color Scheme -> load-theme here +#+begin_src emacs-lisp + (use-package doom-themes + :ensure t + :config + ;; Global settings (defaults) + (setq doom-themes-enable-bold t ; if nil, bold is universally disabled + doom-themes-enable-italic t) ; if nil, italics is universally disabled + (load-theme 'doom-tokyo-night t) + (doom-themes-visual-bell-config) + (doom-themes-neotree-config) + (setq doom-themes-treemacs-theme "doom-tokyo-night") ; use "doom-colors" for less minimal icon theme + (doom-themes-treemacs-config) + ;; Corrects (and improves) org-mode's native fontification. + (doom-themes-org-config)) +#+end_src +** Utilities +*** Completion +**** counsel +#+begin_src emacs-lisp + (use-package counsel :config (counsel-mode)) + (use-package swiper) + (use-package ivy :config + (ivy-mode) + (setq ivy-use-virtual-buffers 't) + (setq enable-recursive-minibuffers 't) + (global-set-key "\C-s" 'swiper-isearch) + (global-set-key (kbd "C-c C-r") 'ivy-resume) + (global-set-key (kbd "M-x") 'counsel-M-x) + (global-set-key (kbd "C-x C-f") 'counsel-find-file) + (global-set-key (kbd " f") 'counsel-describe-function) + (global-set-key (kbd " v") 'counsel-describe-variable) + (global-set-key (kbd " o") 'counsel-describe-symbol) + (global-set-key (kbd " l") 'counsel-find-library) + (global-set-key (kbd " i") 'counsel-info-lookup-symbol) + (global-set-key (kbd " u") 'counsel-unicode-char) + (global-set-key (kbd "C-c g") 'counsel-git) + (global-set-key (kbd "C-c j") 'counsel-git-grep) + (global-set-key (kbd "C-c k") 'counsel-ag) + (global-set-key (kbd "C-x l") 'counsel-locate) + (global-set-key (kbd "C-S-o") 'counsel-rhythmbox) + (define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history)) + (use-package all-the-icons-ivy-rich + :ensure t + :init (all-the-icons-ivy-rich-mode 1)) + + (use-package ivy-rich + :ensure t + :init (ivy-rich-mode 1)) +#+end_src +**** helpful +#+begin_src emacs-lisp + (use-package helpful + :config + (global-set-key (kbd "C-h f") #'helpful-callable) + (global-set-key (kbd "C-h v") #'helpful-variable) + (global-set-key (kbd "C-h k") #'helpful-key) + (global-set-key (kbd "C-h x") #'helpful-command) + (global-set-key (kbd "C-c C-S-d") #'helpful-at-point)) +#+end_src +** Org Mode +*** Org Roam +Presents a good example of use-package's capabilities. +#+begin_src emacs-lisp + (use-package org-roam :ensure t :after org :custom (org-roam-directory "~/org/roam") :bind + (("C-c n l" . org-roam-buffer-toggle) + ("C-c n f" . org-roam-node-find) + ("C-c n i" . org-roam-node-insert) + :map org-mode-map + ("C-M-i" . completion-at-point)) + :init (setq org-roam-v2-ack t) + :config + (org-roam-setup)) + (setq org-roam-node-display-template + (concat "${title:*} " + (propertize "${tags:10}" 'face 'org-tag))) + (setq org-roam-database-connector 'sqlite-builtin) + (setq org-roam-capture-templates '(("d" "default" plain "%?" + :target (file+head "${slug}.org" + "#+title: ${title}\n") + :unnarrowed t))) +#+end_src +#+begin_src + (org-roam-capture-templates + '(("d" "default" plain + "%?" + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") + :unnarrowed t) + ("l" "programming language" plain + "* Characteristics\n\n- Family: %?\n- Inspired by: \n\n*Reference:\n\n" + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") + :unnarrowed t) + ("b" "book notes" plain + "\n* Source\n\nAuthor: %^{Author}\nTitle: ${title}\nYear: %^{Year}\n\n* Summary\n\n%?" + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n") + :unnarrowed t) + ("p" "project" plain "* Goals\n\n%?\n\n* Tasks\n\n** TODO Add initial tasks\n\n* Dates\n\n" + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+filetags: Project") + :unnarrowed t)) +#+end_src +**** Capture Templates +#+begin_src emacs-lisp +#+end_src +*** Org Agenda +#+begin_src emacs-lisp + (setq org-columns-default-format "%50ITEM(Task) %10CLOCKSUM %16TIMESTAMP_IA") +#+end_src +*** Capture Templates +**** Agenda Related +:PROPERTIES: +:ID: e81c993e-995d-492f-af46-73928c0a4fbd +:END: +[https://d12frosted.io/posts/2020-06-23-task-management-with-roam-vol1.html] +#+begin_src emacs-lisp +(setq org-capture-templates + '(("t" "todo" entry (file org-default-notes-file) + "* TODO %?\n%u\n%a\n" :clock-in t :clock-resume t) + ("m" "Meeting" entry (file org-default-notes-file) + "* MEETING with %? :MEETING:\n%t" :clock-in t :clock-resume t) + ("d" "Diary" entry (file+datetree "~/org/diary.org") + "* %?\n%U\n" :clock-in t :clock-resume t) + ("i" "Idea" entry (file org-default-notes-file) + "* %? :IDEA: \n%t" :clock-in t :clock-resume t) + ("n" "Next Task" entry (file+headline org-default-notes-file "Tasks") + "** NEXT %? \nDEADLINE: %t") )) +#+end_src +#+begin_src emacs-lisp + (setq org-agenda-prefix-format + '((agenda . " %i %-12(vulpea-agenda-category)%?-12t% s") + (todo . " %i %-12(vulpea-agenda-category) ") + (tags . " %i %-12(vulpea-agenda-category) ") + (search . " %i %-12(vulpea-agenda-category) "))) + + (defun vulpea-agenda-category () + "Get category of item at point for agenda. + + Category is defined by one of the following items: + + - CATEGORY property + - TITLE keyword + - TITLE property + - filename without directory and extension + + Usage example: + + (setq org-agenda-prefix-format + '((agenda . \" %(vulpea-agenda-category) %?-12t %12s\"))) + + Refer to `org-agenda-prefix-format' for more information." + (let* ((file-name (when buffer-file-name + (file-name-sans-extension + (file-name-nondirectory buffer-file-name)))) + (title (vulpea-buffer-prop-get "title")) + (category (org-get-category))) + (or (if (and + title + (string-equal category file-name)) + title + category) + ""))) + (defun vulpea-buffer-prop-get (name) + "Get a buffer property called NAME as a string." + (org-with-point-at 1 + (when (re-search-forward (concat "^#\\+" name ": \\(.*\\)") + (point-max) t) + (buffer-substring-no-properties + (match-beginning 1) + (match-end 1))))) + (setq org-agenda-prefix-format + '((agenda . " %i %(vulpea-agenda-category 12)%?-12t% s") + (todo . " %i %(vulpea-agenda-category 12) ") + (tags . " %i %(vulpea-agenda-category 12) ") + (search . " %i %(vulpea-agenda-category 12) "))) + + (defun vulpea-agenda-category (&optional len) + "Get category of item at point for agenda. + + Category is defined by one of the following items: + + - CATEGORY property + - TITLE keyword + - TITLE property + - filename without directory and extension + + When LEN is a number, resulting string is padded right with + spaces and then truncated with ... on the right if result is + longer than LEN. + + Usage example: + + (setq org-agenda-prefix-format + '((agenda . \" %(vulpea-agenda-category) %?-12t %12s\"))) + + Refer to `org-agenda-prefix-format' for more information." + (let* ((file-name (when buffer-file-name + (file-name-sans-extension + (file-name-nondirectory buffer-file-name)))) + (title (vulpea-buffer-prop-get "title")) + (category (org-get-category)) + (result + (or (if (and + title + (string-equal category file-name)) + title + category) + ""))) + (if (numberp len) + (s-truncate len (s-pad-right len " " result)) + result))) + (defun vulpea-ensure-filetag () + "Add respective file tag if it's missing in the current note." + (interactive) + (let ((tags (vulpea-buffer-tags-get)) + (tag (vulpea--title-as-tag))) + (when (and (seq-contains-p tags "people") + (not (seq-contains-p tags tag))) + (vulpea-buffer-tags-add tag)))) + + (defun vulpea--title-as-tag () + "Return title of the current note as tag." + (vulpea--title-to-tag (vulpea-buffer-title-get))) + + (defun vulpea--title-to-tag (title) + "Convert TITLE to tag." + (concat "@" (s-replace " " "" title))) + (defun vulpea-tags-add () + "Add a tag to current note." + (interactive) + ;; since https://github.com/org-roam/org-roam/pull/1515 + ;; `org-roam-tag-add' returns added tag, we could avoid reading tags + ;; in `vulpea-ensure-filetag', but this way it can be used in + ;; different contexts while having simple implementation. + (when (call-interactively #'org-roam-tag-add) + (vulpea-ensure-filetag))) + + (defun org-roam-node-insert-wrapper (fn) + "Insert a link to the note using FN. + + If inserted node has PEOPLE tag on it, tag the current outline + accordingly." + (interactive) + (when-let* + ((node (funcall fn)) + (title (org-roam-node-title node)) + (tags (org-roam-node-tags node))) + (when (seq-contains-p tags "people") + (save-excursion + (ignore-errors + (org-back-to-heading) + (org-set-tags + (seq-uniq + (cons + (vulpea--title-to-tag title) + (org-get-tags nil t))))))))) + + (advice-add + #'org-roam-node-insert + :around + #'org-roam-node-insert-wrapper) + +(defun my-vulpea-insert-handle (note) + "Hook to be called on NOTE after `vulpea-insert'." + (when-let* ((title (vulpea-note-title note)) + (tags (vulpea-note-tags note))) + (when (seq-contains-p tags "people") + (save-excursion + (ignore-errors + (org-back-to-heading) + (when (eq 'todo (org-element-property + :todo-type + (org-element-at-point))) + (org-set-tags + (seq-uniq + (cons + (vulpea--title-to-tag title) + (org-get-tags nil t)))))))))) + +(defun vulpea--title-to-tag (title) + "Convert TITLE to tag." + (concat "@" (s-replace " " "" title))) + +(add-hook 'vulpea-insert-handle-functions + #'my-vulpea-insert-handle) +#+end_src + +* EXWM +#+begin_src emacs-lisp + (require 'exwm) + ;; Set the initial workspace number. + (setq exwm-workspace-number 4) + ;; Make class name the buffer name. + (add-hook 'exwm-update-class-hook + (lambda () (exwm-workspace-rename-buffer exwm-class-name))) + ;; Global keybindings. + (setq exwm-input-global-keys + `(([?\s-r] . exwm-reset) ;; s-r: Reset (to line-mode). + ([?\s-w] . exwm-workspace-switch) ;; s-w: Switch workspace. + ([?\s-&] . (lambda (cmd) ;; s-&: Launch application. + (interactive (list (read-shell-command "$ "))) + (start-process-shell-command cmd nil cmd))) + ;; s-N: Switch to certain workspace. + ,@(mapcar (lambda (i) + `(,(kbd (format "s-%d" i)) . + (lambda () + (interactive) + (exwm-workspace-switch-create ,i)))) + (number-sequence 0 9)))) + ;; Enable EXWM + ;; let's get encryption established + (setenv "GPG_AGENT_INFO" nil) ;; use emacs pinentry + (setq auth-source-debug t) + + (setq epg-gpg-program "gpg2") ;; not necessary + (require 'epa-file) + (epa-file-enable) + (setq epa-pinentry-mode 'loopback) + (setq epg-pinentry-mode 'loopback) + (pinentry-start) + + (require 'org-crypt) + (org-crypt-use-before-save-magic) + (require 'exwm-randr) + (require 'exwm-systemtray) + (setq exwm-randr-workspace-output-plist '(o "eDP-1")) + (add-hook 'exwm-randr-screen-change-hook + (lambda () + (start-process-shell-command + "xrandr" nil "xrandr --output eDP-1 --scale .5 --filter nearest"))) + (exwm-randr-enable) + (exwm-systemtray-enable) diff --git a/home/xps13.nix b/home/xps13.nix index 1713272..165a7d5 100644 --- a/home/xps13.nix +++ b/home/xps13.nix @@ -238,11 +238,11 @@ # https://github.com/kovidgoyal/kitty-themes/tree/master/themes themeFile = "tokyo_night_night"; shellIntegration = { - enableBashIntegration = true; enableZshIntegration = true; enableFishIntegration = true; }; extraConfig = '' + shell zsh dynamic_background_opacity yes background_opacity 0.7 ''; diff --git a/modules/configurations/configuration-Athena.nix b/modules/configurations/configuration-Athena.nix index 4a81568..f4ecea7 100644 --- a/modules/configurations/configuration-Athena.nix +++ b/modules/configurations/configuration-Athena.nix @@ -65,17 +65,6 @@ ]; }; - users.users.th3r00t = { - isNormalUser = true; - description = "Mike 'th3r00t' Young"; - extraGroups = [ "networkmanager" "wheel" "input" ]; - packages = with pkgs; [ - ]; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH8P/3yzsruekSaZ9b+yk429VTcfCtI1j8jnkNbPAgnr th3r00t@nixos" - ]; - }; - environment = { variables.EDITOR = "nvim"; systemPackages = with pkgs; [ diff --git a/modules/configurations/configuration-common.nix b/modules/configurations/configuration-common.nix index 1c770a0..a66d8de 100644 --- a/modules/configurations/configuration-common.nix +++ b/modules/configurations/configuration-common.nix @@ -8,6 +8,20 @@ ../services.nix ]; + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.th3r00t = { + isNormalUser = true; + description = "Mike 'th3r00t' Young"; + extraGroups = [ "networkmanager" "wheel" "input" ]; + packages = with pkgs; [ + # kdePackages.kate + # thunderbird + ]; + }; + programs.zsh.enable = true; + programs.fish.enable = true; + programs.bash.enable = true; + users.defaultUserShell = pkgs.zsh; nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.trusted-users = [ "root" "th3r00t" ]; nix.extraOptions = '' diff --git a/modules/configurations/configuration-server.nix b/modules/configurations/configuration-server.nix index 142a6ea..23e1fc9 100644 --- a/modules/configurations/configuration-server.nix +++ b/modules/configurations/configuration-server.nix @@ -59,17 +59,6 @@ ]; }; - users.users.th3r00t = { - isNormalUser = true; - description = "Mike 'th3r00t' Young"; - extraGroups = [ "networkmanager" "wheel" "input" ]; - packages = with pkgs; [ - ]; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH8P/3yzsruekSaZ9b+yk429VTcfCtI1j8jnkNbPAgnr th3r00t@nixos" - ]; - }; - environment = { variables.EDITOR = "nvim"; systemPackages = with pkgs; [ diff --git a/modules/configurations/configuration-xps13.nix b/modules/configurations/configuration-xps13.nix index 703b9cb..475db4f 100644 --- a/modules/configurations/configuration-xps13.nix +++ b/modules/configurations/configuration-xps13.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, pkgs, callPackage, ... }: { imports = @@ -27,12 +27,75 @@ options ath10k_core rawmode=1 ''; }; + nixpkgs.overlays = [ + (import (builtins.fetchTarball { + url = "https://github.com/nix-community/emacs-overlay/archive/master.tar.gz"; + sha256 = "0d04az7ghk446k7wgrlia4rynanx8863xqfw7qzcwqplpzp8h10r"; + })) + ]; security.rtkit.enable = true; # Enable touchpad support (enabled default in most desktopManager). fonts = { enableDefaultPackages = true; fontDir.enable = true; packages = with pkgs; [ + (pkgs.emacsWithPackagesFromUsePackage { + # Your Emacs config file. Org mode babel files are also + # supported. + # NB: Config files cannot contain unicode characters, since + # they're being parsed in nix, which lacks unicode + # support. + # config = ./emacs.org; + config = ../../home/emacs.org; + # config = ./emacs.el; + + # Whether to include your config as a default init file. + # If being bool, the value of config is used. + # Its value can also be a derivation like this if you want to do some + # substitution: + # defaultInitFile = pkgs.substituteAll { + # name = "default.el"; + # src = ./emacs.el; + # inherit (config.xdg) configHome dataHome; + # }; + defaultInitFile = true; + + # Package is optional, defaults to pkgs.emacs + # package = pkgs.emacs-git; + package = pkgs.emacs-unstable-pgtk; + # By default emacsWithPackagesFromUsePackage will only pull in + # packages with `:ensure`, `:ensure t` or `:ensure `. + # Setting `alwaysEnsure` to `true` emulates `use-package-always-ensure` + # and pulls in all use-package references not explicitly disabled via + # `:ensure nil` or `:disabled`. + # Note that this is NOT recommended unless you've actually set + # `use-package-always-ensure` to `t` in your config. + alwaysEnsure = true; + + # For Org mode babel files, by default only code blocks with + # `:tangle yes` are considered. Setting `alwaysTangle` to `true` + # will include all code blocks missing the `:tangle` argument, + # defaulting it to `yes`. + # Note that this is NOT recommended unless you have something like + # `#+PROPERTY: header-args:emacs-lisp :tangle yes` in your config, + # which defaults `:tangle` to `yes`. + alwaysTangle = true; + + # Optionally provide extra packages not in the configuration file. + # This can also include extra executables to be run by Emacs (linters, + # language servers, formatters, etc) + extraEmacsPackages = epkgs: [ + epkgs.cask + pkgs.shellcheck + ]; + + # Optionally override derivations. + override = final: prev: { + weechat = prev.melpaPackages.weechat.overrideAttrs(old: { + patches = [ ./weechat-el.patch ]; + }); + }; + }) noto-fonts noto-fonts-cjk-sans noto-fonts-emoji @@ -56,16 +119,6 @@ }; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.th3r00t = { - isNormalUser = true; - description = "Mike 'th3r00t' Young"; - extraGroups = [ "networkmanager" "wheel" "input" ]; - packages = with pkgs; [ - # kdePackages.kate - # thunderbird - ]; - }; # List packages installed in system profile. To search, run: # $ nix search wget @@ -110,6 +163,10 @@ pulseaudio.enable = false; libinput.enable = true; # logmein-hamachi.enable = true; + emacs = { + enable = true; + package = pkgs.emacs-unstable-pgtk; + }; }; # Open ports in the firewall. diff --git a/modules/hyprland.nix b/modules/hyprland.nix index f4a6249..383cc56 100644 --- a/modules/hyprland.nix +++ b/modules/hyprland.nix @@ -1,14 +1,15 @@ -{ config, pkgs, ... }: +{ config, pkgs, inputs, ... }: { imports = [ ./waybar.nix ]; wayland.windowManager.hyprland = { enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; systemd.enable = true; xwayland.enable = true; plugins = [ - # pkgs.hyprlandPlugins.hyprbars + # inputs.hyprland-plugins.packages.${pkgs.system}.hyprbars -- Version Mismatch ]; settings = { input = { @@ -19,7 +20,7 @@ }; }; decoration = { - rounding = "0"; + rounding = "10"; rounding_power = "2"; active_opacity = "1"; inactive_opacity = ".7"; @@ -45,8 +46,8 @@ }; extraConfig = '' general { - gaps_in = 0 - gaps_out = 0 + gaps_in = 10 + gaps_out = 20 border_size = 1 col.active_border = rgb(b000b5) col.inactive_border = rgb(1f2335) @@ -68,7 +69,7 @@ monitor = DP-2, 2560x1080@74.99,auto,1 # monitor = Virtual-1, 2800x1752@120, 1920x0, 1 $terminal-notmux = kitty - $terminal = kitty -e tmux new-session zsh -c 'tmuxstartup.sh' + $terminal = kitty -e tmux # $terminal = ghostty # $terminal = footclient # $terminal = footclient -e tmux new-session zsh -c '~/.local/usr/bin/tmuxstartup.sh' @@ -188,6 +189,20 @@ # Performance optimizations for Virtual-1 monitor workspace = name:virtual,monitor:Virtual-1,default:true,gapsin:0,gapsout:0 + + plugin { + hyprbars { + bar_height = 23 + bar_color = rgb(1f2335) + col.text = rgb(b000b5) + bar_text_align = left + bar_text_font = "FiraCode Nerd Font:style=bold" + bar_button_padding = 5 + hyprbars-button = rgb(b000b5), 15, 󰅖, hyprctl dispatch killactive + hyprbars-button = rgb(b000b5), 15, 󰖯, hyprctl dispatch fullscreen 1 + } + } + ''; }; programs.hyprlock = { diff --git a/modules/shells.nix b/modules/shells.nix index 7185e83..e315efc 100644 --- a/modules/shells.nix +++ b/modules/shells.nix @@ -1,21 +1,30 @@ { pkgs, config, ... }: { - programs.starship = { - enable = true; - # custom settings - settings = { - add_newline = false; - aws.disabled = true; - gcloud.disabled = true; - line_break.disabled = true; - }; + home.sessionVariables = { + SHELL = "${pkgs.zsh}/bin/zsh"; }; programs.zsh = { enable = true; + enableCompletion = true; + syntaxHighlighting = { + enable = true; + highlighters = [ "main" "brackets" "cursor" "root" "line" ]; + }; + autosuggestion.enable = true; + autocd = true; + defaultKeymap = "vicmd"; sessionVariables = { PATH="$PATH:$HOME/.local/usr/bin"; PYTHONBREAKPOINT="pudb.set_trace"; }; + shellAliases = { + urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'"; + urldecode = "python3 -c 'import sys, urllib.parse as ul; print(il.unquote_plus(sys.stdin.read()))'"; + ls = "eza"; + cat = "bat"; + l = "ls -lh --color=always --group-directories-first"; + la = "ls -lah --color=always --group-directories-first"; + }; oh-my-zsh = { enable = true; plugins = [ @@ -43,20 +52,7 @@ "vi-mode" "zsh-navigation-tools" ]; - # theme = "starship"; - }; - }; - programs.bash = { - enable = true; - enableCompletion = true; - bashrcExtra = '' - export PATH="$PATH:$HOME/.local/usr/bin"; - ''; - shellAliases = { - urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'"; - urldecode = "python3 -c 'import sys, urllib.parse as ul; print(il.unquote_plus(sys.stdin.read()))'"; - ls = "eza"; - cat = "bat"; + theme = "fox"; }; }; } diff --git a/modules/tmux.nix b/modules/tmux.nix index c49670b..5e4a819 100644 --- a/modules/tmux.nix +++ b/modules/tmux.nix @@ -67,7 +67,7 @@ ]; prefix = "C-a"; - # shell = "${pkgs.zsh}/bin/zsh"; + shell = "${pkgs.zsh}/bin/zsh"; # terminal = "xterm-kitty:RGB"; tmuxinator.enable = true; extraConfig = ''