From 7acdd41b11928b956dc559b1bd178c83aec000fa Mon Sep 17 00:00:00 2001 From: Sravan Balaji Date: Thu, 28 Mar 2024 16:26:10 -0400 Subject: [PATCH] Switch back to Vim - Change default editor back to vim since doom-emacs is broken at the moment - Conditionally include emacs or vim nix files in configuration.nix - User username to find dwm-flexipatch path on system - Add tree and btop to miscellaneous system packages - Add some cli tools like just and git to home-manager packages - Add more XDG env vars for config and cache --- flake.nix | 2 +- profiles/personal/home.nix | 1 + system/gui/dwm.nix | 4 ++-- system/utilities/miscellaneous.nix | 2 ++ user/development/cli.nix | 8 ++++++++ user/development/default.nix | 4 ++-- user/development/doom-emacs.nix | 4 ++-- user/development/vim.nix | 7 +++++++ user/utilities/xdg.nix | 2 ++ 9 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 user/development/cli.nix create mode 100644 user/development/vim.nix diff --git a/flake.nix b/flake.nix index d8ded7f..f6a2b05 100644 --- a/flake.nix +++ b/flake.nix @@ -39,7 +39,7 @@ theme = "dracula"; # Selected theme from themes directory browser = "vivaldi"; # Default browser term = "kitty"; # Default terminal command - editor = "emacsclient"; # Default editor + editor = "vim"; # Default editor spawnEditor = if (editor == "emacsclient") then "emacsclient -c -a 'emacs'" diff --git a/profiles/personal/home.nix b/profiles/personal/home.nix index 16edfe3..1ca1ec6 100644 --- a/profiles/personal/home.nix +++ b/profiles/personal/home.nix @@ -12,6 +12,7 @@ imports = [ (../../user/browser + "/${userSettings.browser}.nix") ../../user/development/default.nix + (if userSettings.editor == "emacsclient" then ../../user/development/doom-emacs.nix else (../../user/development + "/${userSettings.editor}.nix")) ../../user/gaming/default.nix ../../user/launcher/default.nix ../../user/media/default.nix diff --git a/system/gui/dwm.nix b/system/gui/dwm.nix index 7c8eae8..4ec8efe 100644 --- a/system/gui/dwm.nix +++ b/system/gui/dwm.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, userSettings, ... }: { imports = [ @@ -10,7 +10,7 @@ services.xserver.windowManager.dwm = { enable = true; package = pkgs.dwm.overrideAttrs { - src = ~/.config/dwm-flexipatch; + src = (/home + "/${userSettings.username}" + /.config/dwm-flexipatch); buildInputs = with pkgs; [ xorg.libX11.dev xorg.libXinerama diff --git a/system/utilities/miscellaneous.nix b/system/utilities/miscellaneous.nix index a6052a6..bc4edf7 100644 --- a/system/utilities/miscellaneous.nix +++ b/system/utilities/miscellaneous.nix @@ -10,5 +10,7 @@ rsync cryptsetup home-manager + tree + btop ]; } diff --git a/user/development/cli.nix b/user/development/cli.nix new file mode 100644 index 0000000..8dfac3f --- /dev/null +++ b/user/development/cli.nix @@ -0,0 +1,8 @@ +{ config, lib, pkgs, ... }: + +{ + home.packages = (with pkgs; [ + git + just + ]); +} diff --git a/user/development/default.nix b/user/development/default.nix index 26d9fb7..00b8eaf 100644 --- a/user/development/default.nix +++ b/user/development/default.nix @@ -1,8 +1,8 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, userSettings, ... }: { imports = [ ./vscode.nix - ./doom-emacs.nix + ./cli.nix ]; } diff --git a/user/development/doom-emacs.nix b/user/development/doom-emacs.nix index a316cc9..420b421 100644 --- a/user/development/doom-emacs.nix +++ b/user/development/doom-emacs.nix @@ -1,8 +1,8 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, userSettings, ... }: { programs.doom-emacs = { enable = true; - doomPrivateDir = ~/.config/doom-emacs-config; + doomPrivateDir = (/home + "/${userSettings.username}" + /.config/doom-emacs-config); }; } diff --git a/user/development/vim.nix b/user/development/vim.nix new file mode 100644 index 0000000..5c8c73b --- /dev/null +++ b/user/development/vim.nix @@ -0,0 +1,7 @@ +{ config, lib, pkgs, ... }: + +{ + home.packages = (with pkgs; [ + vim + ]); +} diff --git a/user/utilities/xdg.nix b/user/utilities/xdg.nix index 290f68b..5fb7cdf 100644 --- a/user/utilities/xdg.nix +++ b/user/utilities/xdg.nix @@ -15,6 +15,8 @@ publicShare = null; extraConfig = { XDG_GAME_DIR = "${config.home.homeDirectory}/Games"; + XDG_CONFIG_HOME = "${config.home.homeDirectory}/.config"; + XDG_CACHE_HOME = "${config.home.homeDirectory}/.cache"; }; }; xdg.mime.enable = true;