nix-config/homes/x86_64-linux/marshall@navis/default.nix

307 lines
8 KiB
Nix
Raw Normal View History

2024-05-07 03:23:55 -04:00
{
lib,
pkgs,
inputs,
...
}: {
2024-07-28 02:49:27 -04:00
imports = with inputs; [
catppuccin.homeManagerModules.catppuccin
chaotic.homeManagerModules.default
hyprland.homeManagerModules.default
nix-colors.homeManagerModules.default
nix-index-database.hmModules.nix-index
2024-07-28 21:52:06 -04:00
./hyprland
./screenshot
2024-07-28 02:49:27 -04:00
];
2024-07-31 01:03:58 -04:00
snowfallorg.user = {
enable = true;
name = "marshall";
};
colorScheme = inputs.nix-colors.colorSchemes.catppuccin-mocha;
2024-05-07 03:23:55 -04:00
home = {
packages = with pkgs;
[
2024-07-28 02:49:27 -04:00
alejandra
2024-06-26 03:14:20 -04:00
beeper
2024-05-28 04:08:06 -04:00
duf
2024-05-16 02:40:39 -04:00
eternal-terminal
2024-06-13 23:47:00 -04:00
glow
2024-05-07 03:23:55 -04:00
grc
2024-05-16 02:40:39 -04:00
iamb
2024-05-07 03:23:55 -04:00
jamesdsp
2024-06-13 23:47:00 -04:00
jdk21
2024-05-16 02:40:39 -04:00
killall
2024-05-28 04:08:06 -04:00
libnotify
2024-05-16 02:40:39 -04:00
lm_sensors
2024-05-28 04:08:06 -04:00
loupe
2024-06-26 03:14:20 -04:00
neovide
2024-05-16 02:40:39 -04:00
playerctl
prismlauncher
2024-06-13 23:47:00 -04:00
slack
2024-05-16 02:40:39 -04:00
telegram-desktop
2024-05-28 04:08:06 -04:00
vesktop
2024-05-16 02:40:39 -04:00
youki
2024-07-28 02:49:27 -04:00
(pkgs.buildFHSUserEnv {
name = "zed";
targetPkgs = pkgs:
with pkgs; [
zed-editor
];
runScript = "zed";
})
2024-05-07 03:23:55 -04:00
]
2024-07-28 02:49:27 -04:00
++ (with jetbrains; [
clion
rust-rover
webstorm
idea-ultimate
])
2024-05-07 03:23:55 -04:00
++ (with inputs; [
nixvim.packages.${pkgs.system}.default
])
++ (with inputs.chaotic.packages.${pkgs.system}; [
distrobox_git
2024-05-28 04:08:06 -04:00
firefox_nightly
2024-05-07 03:23:55 -04:00
]);
stateVersion = "24.05";
};
2024-05-16 02:40:39 -04:00
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"];
uris = ["qemu:///system"];
};
};
xdg.enable = true;
catppuccin = {
enable = true;
2024-05-28 04:08:06 -04:00
flavor = "mocha";
2024-05-16 02:40:39 -04:00
accent = "green";
2024-06-26 03:14:20 -04:00
pointerCursor.enable = true;
2024-05-16 02:40:39 -04:00
};
2024-06-26 03:14:20 -04:00
gtk = let
gradiencePreset = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/GradienceTeam/Community/next/official/catppuccin-macchiato.json";
hash = "sha256-FgQvmK/Pjn980o+UVc2a70kGa6sGse045zPS9hzCs14=";
};
gradienceBuild = pkgs.stdenv.mkDerivation {
name = "gradience-build";
phases = ["buildPhase" "installPhase"];
nativeBuildInputs = [pkgs.gradience];
buildPhase = ''
shopt -s nullglob
export HOME=$TMPDIR
mkdir -p $HOME/.config/presets
gradience-cli apply -p ${gradiencePreset} --gtk both
'';
installPhase = ''
mkdir -p $out
cp -r .config/gtk-4.0 $out/
cp -r .config/gtk-3.0 $out/
'';
};
in {
2024-05-16 02:40:39 -04:00
enable = true;
2024-06-26 03:14:20 -04:00
theme.name = "adw-gtk3-dark";
theme.package = pkgs.adw-gtk3;
2024-05-16 02:40:39 -04:00
2024-06-26 03:14:20 -04:00
gtk3 = {
extraCss = builtins.readFile "${gradienceBuild}/gtk-3.0/gtk.css";
extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
};
gtk4 = {
extraCss = builtins.readFile "${gradienceBuild}/gtk-4.0/gtk.css";
extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
2024-05-16 02:40:39 -04:00
};
};
2024-05-28 04:22:41 -04:00
qt = {
enable = true;
2024-07-28 02:49:27 -04:00
platformTheme.name = "kvantum";
2024-05-28 04:22:41 -04:00
style.name = "kvantum";
style.catppuccin.enable = true;
};
2024-05-07 03:23:55 -04:00
programs = {
2024-08-12 00:31:35 -04:00
emacs = {
enable = true;
package = pkgs.emacs29-pgtk;
extraPackages = epkgs:
with epkgs; [
catppuccin-theme
company
dashboard
direnv
doom-modeline
eglot
evil
evil-leader
flycheck
flycheck-inline
nix-mode
treemacs
treemacs-evil
treesit-auto
treesit-grammars.with-all-grammars
tree-sitter-langs
vterm
];
extraConfig = ''
; Catppuccin theme
(load-theme 'catppuccin :no-confirm)
; Doom modeline
(require 'doom-modeline)
(doom-modeline-mode 1)
; Set font
(set-frame-font "Maple Mono NF 12" nil t)
; Change default indent size to 2 spaces
(setq-default indent-tabs-mode nil) ;; Use spaces instead of tabs
(setq-default standard-indent 2) ;; Change indent
(setq-default tab-width 2) ;; Change tab width
; Evil mode
(setq evil-want-C-u-scroll t)
(require 'evil)
(evil-mode 1)
;; Treemacs (+ evil mode support)
(require 'treemacs)
(require 'treemacs-evil) ; Optional: if you want Evil keybindings for Treemacs
;; Evil leader
(global-evil-leader-mode)
(evil-leader/set-leader "<SPC>")
(evil-leader/set-key "e" 'treemacs)
;; Centered scrolling
(defun my/evil-scroll-up ()
"Scroll up half a screen and center the line."
(interactive)
(evil-scroll-up nil)
(recenter))
(defun my/evil-scroll-down ()
"Scroll down half a screen and center the line."
(interactive)
(evil-scroll-down nil)
(recenter))
(define-key evil-normal-state-map (kbd "C-u") 'my/evil-scroll-up)
(define-key evil-normal-state-map (kbd "C-d") 'my/evil-scroll-down)
; Disable menubar and toolbar
(menu-bar-mode -1)
(tool-bar-mode -1)
; Dashboard
(require 'dashboard)
(dashboard-setup-startup-hook)
(setq dashboard-startup-banner 'logo)
; Direnv
(direnv-mode)
; Nix setup
(require 'nix-mode)
(add-to-list 'auto-mode-alist '("\\.nix\\'" . nix-mode))
; Tree-sitter setup
(require 'treesit)
(require 'tree-sitter-langs)
(require 'treesit-auto)
(global-treesit-auto-mode)
(add-hook 'prog-mode-hook #'tree-sitter-mode)
(add-hook 'prog-mode-hook #'tree-sitter-hl-mode)
;; Use Tree-sitter for better syntax highlighting
(dolist (lang treesit-language-source-alist)
(let ((mode (intern (format "%s-ts-mode" (car lang)))))
(when (fboundp mode)
(add-to-list 'major-mode-remap-alist
(cons (intern (car lang)) mode)))))
; Eglot setup
(add-hook 'prog-mode-hook 'eglot-ensure)
(add-hook 'nix-mode-hook 'eglot-ensure)
;; Function to format the buffer using Eglot
(defun my/eglot-format-buffer-on-save ()
"Format the current buffer if Eglot is active."
(when (bound-and-true-p eglot--managed-p)
(eglot-format-buffer)))
;; Add the function to the save-hook
(add-hook 'before-save-hook #'my/eglot-format-buffer-on-save)
; Flycheck setup
(require 'flycheck)
(global-flycheck-mode)
; Flycheck-inline setup
(require 'flycheck-inline)
(add-hook 'flycheck-mode-hook #'flycheck-inline-mode)
; Disable Flycheck modeline error messages
(setq-default flycheck-mode-line-prefix "")
(setq-default flycheck-display-errors-function #'flycheck-inline-display-errors)
; Company mode setup
(require 'company)
(global-company-mode) ; Enable Company mode globally
; Key bindings for company mode
(setq company-idle-delay 0.2) ; Start completion after a short delay
(setq company-minimum-prefix-length 1) ; Start completion after typing 1 character
(setq company-show-numbers t) ; Show numbers for completion candidates
(global-set-key (kbd "M-/") 'company-complete) ; Trigger completion manually with M-/
(defun my/compile-and-focus-treemacs ()
"Run `compile` and focus on the project root in `Treemacs`."
(interactive)
(let ((default-directory (project-root (project-current t))))
(compile (read-shell-command "Compile command: " (concat (or compile-command "make") " ")))
(treemacs-select-window)))
(global-set-key (kbd "C-c C-c") 'my/compile-and-focus-treemacs)
'';
};
2024-07-28 21:52:06 -04:00
wezterm.extraConfig = builtins.readFile ./wezterm.lua;
2024-05-07 03:23:55 -04:00
2024-07-28 21:52:06 -04:00
git = {
extraConfig.credential.helper = "libsecret";
signing.key = "0FF5B8826803F895";
2024-05-07 03:23:55 -04:00
};
2024-07-31 01:03:58 -04:00
mpv = {
enable = true;
scripts = [pkgs.mpvScripts.uosc];
catppuccin.enable = true;
};
2024-05-16 02:40:39 -04:00
};
2024-05-28 04:08:06 -04:00
systemd.user.startServices = "sd-switch";
2024-05-07 03:23:55 -04:00
2024-07-31 01:03:58 -04:00
nix.package = lib.mkForce inputs.nix-super.packages.${pkgs.system}.default;
2024-05-07 03:23:55 -04:00
}