big refactor into modules
This commit is contained in:
parent
15339d8355
commit
d9afa8cc61
@ -19,7 +19,7 @@
|
|||||||
};
|
};
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
ivand = home-manager.lib.homeManagerConfiguration {
|
ivand = home-manager.lib.homeManagerConfiguration {
|
||||||
modules = [ ./home/laptop.nix nix-doom-emacs.hmModule ];
|
modules = [ ./home/laptop nix-doom-emacs.hmModule ];
|
||||||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
189
home/laptop.nix
189
home/laptop.nix
@ -1,186 +1,5 @@
|
|||||||
{ pkgs, lib, ... }: {
|
{ config, lib, pkgs, ... }:
|
||||||
home = {
|
|
||||||
username = "ivand";
|
{
|
||||||
homeDirectory = "/home/ivand";
|
|
||||||
stateVersion = "23.05";
|
|
||||||
sessionPath = [ "$HOME/.local/bin/" "$HOME/.local/share/pnpm" ];
|
|
||||||
pointerCursor = {
|
|
||||||
name = "Bibata-Modern-Amber";
|
|
||||||
package = pkgs.bibata-cursors;
|
|
||||||
};
|
|
||||||
file = {
|
|
||||||
".local/bin/ec" = {
|
|
||||||
text = ''
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
emacsclient -c -a 'emacs'
|
|
||||||
'';
|
|
||||||
executable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
packages = with pkgs; [
|
|
||||||
bemenu
|
|
||||||
brave
|
|
||||||
direnv
|
|
||||||
gopass
|
|
||||||
gopass-jsonapi
|
|
||||||
pavucontrol
|
|
||||||
nixfmt
|
|
||||||
sqlite
|
|
||||||
ripgrep
|
|
||||||
];
|
|
||||||
};
|
|
||||||
programs = {
|
|
||||||
home-manager = { enable = true; };
|
|
||||||
git = {
|
|
||||||
enable = true;
|
|
||||||
userName = "Ivan Dimitrov";
|
|
||||||
userEmail = "ivan@idimitrov.dev";
|
|
||||||
extraConfig = {
|
|
||||||
color.ui = "auto";
|
|
||||||
pull.rebase = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
kitty = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
enable_tab_bar = false;
|
|
||||||
background_opacity = "0.96";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
tmux = {
|
|
||||||
enable = true;
|
|
||||||
clock24 = true;
|
|
||||||
plugins = with pkgs.tmuxPlugins; [ tilish catppuccin ];
|
|
||||||
extraConfig = ''
|
|
||||||
set -g default-command "''${SHELL}"
|
|
||||||
set -g default-terminal "tmux-256color"
|
|
||||||
set -g base-index 1
|
|
||||||
set -s escape-time 0
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
swaylock = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
color = "000000";
|
|
||||||
line-color = "ffffff";
|
|
||||||
show-failed-attempts = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
neovim = {
|
|
||||||
enable = true;
|
|
||||||
viAlias = true;
|
|
||||||
extraPackages = with pkgs; [
|
|
||||||
alejandra
|
|
||||||
black
|
|
||||||
go
|
|
||||||
gopls
|
|
||||||
libclang
|
|
||||||
lua
|
|
||||||
lua-language-server
|
|
||||||
nodePackages_latest.prettier
|
|
||||||
nodePackages_latest.typescript
|
|
||||||
nodePackages_latest.typescript-language-server
|
|
||||||
nodePackages_latest."@tailwindcss/language-server"
|
|
||||||
nodePackages_latest."@prisma/language-server"
|
|
||||||
python311Packages.python-lsp-black
|
|
||||||
python311Packages.python-lsp-server
|
|
||||||
ripgrep
|
|
||||||
rnix-lsp
|
|
||||||
stylua
|
|
||||||
];
|
|
||||||
plugins = with pkgs.vimPlugins; [
|
|
||||||
nvim-surround
|
|
||||||
nvim-ts-autotag
|
|
||||||
vim-prisma
|
|
||||||
autoclose-nvim
|
|
||||||
barbar-nvim
|
|
||||||
cmp-nvim-lsp
|
|
||||||
comment-nvim
|
|
||||||
gitsigns-nvim
|
|
||||||
luasnip
|
|
||||||
nightfox-nvim
|
|
||||||
nvim-cmp
|
|
||||||
nvim-lspconfig
|
|
||||||
nvim-treesitter.withAllGrammars
|
|
||||||
nvim-web-devicons
|
|
||||||
plenary-nvim
|
|
||||||
telescope-nvim
|
|
||||||
telescope-nvim
|
|
||||||
toggleterm-nvim
|
|
||||||
vim-vinegar
|
|
||||||
];
|
|
||||||
extraLuaConfig = lib.fileContents ./cfg/nvim/init.lua;
|
|
||||||
};
|
|
||||||
doom-emacs = {
|
|
||||||
enable = true;
|
|
||||||
doomPrivateDir = ./cfg/doom.d;
|
|
||||||
};
|
|
||||||
zsh = {
|
|
||||||
enable = true;
|
|
||||||
syntaxHighlighting.enable = true;
|
|
||||||
enableAutosuggestions = true;
|
|
||||||
loginExtra = ''
|
|
||||||
[ "$(tty)" = "/dev/tty1" ] && exec sway
|
|
||||||
'';
|
|
||||||
shellAliases = {
|
|
||||||
gad = "git add . && git diff --cached";
|
|
||||||
gac = "ga && gc";
|
|
||||||
ga = "git add .";
|
|
||||||
gc = "git commit";
|
|
||||||
dev = "nix develop --command $SHELL";
|
|
||||||
};
|
|
||||||
history = {
|
|
||||||
size = 1000;
|
|
||||||
save = 1000;
|
|
||||||
expireDuplicatesFirst = true;
|
|
||||||
};
|
|
||||||
plugins = [
|
|
||||||
{
|
|
||||||
name = "zsh-powerlevel10k";
|
|
||||||
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
|
|
||||||
file = "powerlevel10k.zsh-theme";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "zsh-nix-shell";
|
|
||||||
file = "nix-shell.plugin.zsh";
|
|
||||||
src = "${pkgs.zsh-nix-shell}/share/zsh-nix-shell";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
initExtra = ''
|
|
||||||
source "$HOME/.p10k.zsh"
|
|
||||||
eval "$(direnv hook zsh)"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
obs-studio = {
|
|
||||||
enable = true;
|
|
||||||
plugins = with pkgs.obs-studio-plugins; [ wlrobs ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
wayland = {
|
|
||||||
windowManager.sway = {
|
|
||||||
enable = true;
|
|
||||||
config = null;
|
|
||||||
extraConfig = builtins.readFile ./cfg/sway/config;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
xdg.configFile = {
|
|
||||||
"nix/nix.conf" = {
|
|
||||||
text = ''
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
"user-dirs.dirs" = {
|
|
||||||
source = pkgs.writeText "user-dirs.dirs" ''
|
|
||||||
XDG_DESKTOP_DIR="dt"
|
|
||||||
XDG_DOCUMENTS_DIR="doc"
|
|
||||||
XDG_DOWNLOAD_DIR="dl"
|
|
||||||
XDG_MUSIC_DIR="snd"
|
|
||||||
XDG_PICTURES_DIR="pic"
|
|
||||||
XDG_PUBLICSHARE_DIR="pub"
|
|
||||||
XDG_TEMPLATES_DIR="tp"
|
|
||||||
XDG_VIDEOS_DIR="vid"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services = { emacs = { enable = true; }; };
|
|
||||||
}
|
}
|
||||||
|
5
home/laptop/default.nix
Normal file
5
home/laptop/default.nix
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{ ... }: {
|
||||||
|
imports = [
|
||||||
|
./home.nix
|
||||||
|
];
|
||||||
|
}
|
51
home/laptop/home.nix
Normal file
51
home/laptop/home.nix
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
{ pkgs, lib, ... }: {
|
||||||
|
imports = [ ./programs ./packages ];
|
||||||
|
home = {
|
||||||
|
username = "ivand";
|
||||||
|
homeDirectory = "/home/ivand";
|
||||||
|
stateVersion = "23.05";
|
||||||
|
sessionPath = [ "$HOME/.local/bin/" "$HOME/.local/share/pnpm" ];
|
||||||
|
pointerCursor = {
|
||||||
|
name = "Bibata-Modern-Amber";
|
||||||
|
package = pkgs.bibata-cursors;
|
||||||
|
};
|
||||||
|
file = {
|
||||||
|
".local/bin/ec" = {
|
||||||
|
text = ''
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
emacsclient -c -a 'emacs'
|
||||||
|
'';
|
||||||
|
executable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
programs.home-manager = { enable = true; };
|
||||||
|
|
||||||
|
wayland = {
|
||||||
|
windowManager.sway = {
|
||||||
|
enable = true;
|
||||||
|
config = null;
|
||||||
|
extraConfig = builtins.readFile ../cfg/sway/config;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
xdg.configFile = {
|
||||||
|
"nix/nix.conf" = {
|
||||||
|
text = ''
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
"user-dirs.dirs" = {
|
||||||
|
source = pkgs.writeText "user-dirs.dirs" ''
|
||||||
|
XDG_DESKTOP_DIR="dt"
|
||||||
|
XDG_DOCUMENTS_DIR="doc"
|
||||||
|
XDG_DOWNLOAD_DIR="dl"
|
||||||
|
XDG_MUSIC_DIR="snd"
|
||||||
|
XDG_PICTURES_DIR="pic"
|
||||||
|
XDG_PUBLICSHARE_DIR="pub"
|
||||||
|
XDG_TEMPLATES_DIR="tp"
|
||||||
|
XDG_VIDEOS_DIR="vid"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services = { emacs = { enable = true; }; };
|
||||||
|
}
|
13
home/laptop/packages/default.nix
Normal file
13
home/laptop/packages/default.nix
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{ pkgs, ... }: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
bemenu
|
||||||
|
brave
|
||||||
|
direnv
|
||||||
|
gopass
|
||||||
|
gopass-jsonapi
|
||||||
|
pavucontrol
|
||||||
|
nixfmt
|
||||||
|
sqlite
|
||||||
|
ripgrep
|
||||||
|
];
|
||||||
|
}
|
3
home/laptop/programs/default.nix
Normal file
3
home/laptop/programs/default.nix
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{ ... }: {
|
||||||
|
imports = [ ./neovim ./doom-emacs ./git.nix ./tmux.nix ./kitty.nix ./swaylock.nix ./zsh.nix ./obs.nix ];
|
||||||
|
}
|
5
home/laptop/programs/doom-emacs/default.nix
Normal file
5
home/laptop/programs/doom-emacs/default.nix
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{ ... }: {
|
||||||
|
imports = [
|
||||||
|
./doom.nix
|
||||||
|
];
|
||||||
|
}
|
9
home/laptop/programs/doom-emacs/doom.d/config.el
Normal file
9
home/laptop/programs/doom-emacs/doom.d/config.el
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
;;; config.el --- the emacs config
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
(setq doom-theme 'doom-tokyo-night)
|
||||||
|
|
||||||
|
(use-package! lsp-tailwindcss)
|
||||||
|
|
||||||
|
;;; config.el ends here
|
8
home/laptop/programs/doom-emacs/doom.d/packages.el
Normal file
8
home/laptop/programs/doom-emacs/doom.d/packages.el
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
;;; packages.el --- a list of packages
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
(package! lsp-tailwindcss :recipe (:host github :repo "merrickluo/lsp-tailwindcss"))
|
||||||
|
|
||||||
|
|
||||||
|
;;; packages.el ends here
|
6
home/laptop/programs/doom-emacs/doom.nix
Normal file
6
home/laptop/programs/doom-emacs/doom.nix
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{ pkgs, lib, ... }: {
|
||||||
|
programs.doom-emacs = {
|
||||||
|
enable = true;
|
||||||
|
doomPrivateDir = ./doom.d;
|
||||||
|
};
|
||||||
|
}
|
11
home/laptop/programs/git.nix
Normal file
11
home/laptop/programs/git.nix
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{ pkgs, lib, ... }: {
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
userName = "Ivan Dimitrov";
|
||||||
|
userEmail = "ivan@idimitrov.dev";
|
||||||
|
extraConfig = {
|
||||||
|
color.ui = "auto";
|
||||||
|
pull.rebase = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
9
home/laptop/programs/kitty.nix
Normal file
9
home/laptop/programs/kitty.nix
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{ pkgs, lib, ... }: {
|
||||||
|
programs.kitty = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
enable_tab_bar = false;
|
||||||
|
background_opacity = "0.96";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
5
home/laptop/programs/neovim/default.nix
Normal file
5
home/laptop/programs/neovim/default.nix
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{ ... }: {
|
||||||
|
imports = [
|
||||||
|
./neovim.nix
|
||||||
|
];
|
||||||
|
}
|
47
home/laptop/programs/neovim/neovim.nix
Normal file
47
home/laptop/programs/neovim/neovim.nix
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
{ pkgs, lib, ... }: {
|
||||||
|
programs.neovim = {
|
||||||
|
enable = true;
|
||||||
|
viAlias = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
alejandra
|
||||||
|
black
|
||||||
|
go
|
||||||
|
gopls
|
||||||
|
libclang
|
||||||
|
lua
|
||||||
|
lua-language-server
|
||||||
|
nodePackages_latest.prettier
|
||||||
|
nodePackages_latest.typescript
|
||||||
|
nodePackages_latest.typescript-language-server
|
||||||
|
nodePackages_latest."@tailwindcss/language-server"
|
||||||
|
nodePackages_latest."@prisma/language-server"
|
||||||
|
python311Packages.python-lsp-black
|
||||||
|
python311Packages.python-lsp-server
|
||||||
|
ripgrep
|
||||||
|
rnix-lsp
|
||||||
|
stylua
|
||||||
|
];
|
||||||
|
plugins = with pkgs.vimPlugins; [
|
||||||
|
nvim-surround
|
||||||
|
nvim-ts-autotag
|
||||||
|
vim-prisma
|
||||||
|
autoclose-nvim
|
||||||
|
barbar-nvim
|
||||||
|
cmp-nvim-lsp
|
||||||
|
comment-nvim
|
||||||
|
gitsigns-nvim
|
||||||
|
luasnip
|
||||||
|
nightfox-nvim
|
||||||
|
nvim-cmp
|
||||||
|
nvim-lspconfig
|
||||||
|
nvim-treesitter.withAllGrammars
|
||||||
|
nvim-web-devicons
|
||||||
|
plenary-nvim
|
||||||
|
telescope-nvim
|
||||||
|
telescope-nvim
|
||||||
|
toggleterm-nvim
|
||||||
|
vim-vinegar
|
||||||
|
];
|
||||||
|
extraLuaConfig = lib.fileContents ./nvim/init.lua;
|
||||||
|
};
|
||||||
|
}
|
6
home/laptop/programs/obs.nix
Normal file
6
home/laptop/programs/obs.nix
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{ pkgs, lib, ... }: {
|
||||||
|
programs.obs-studio = {
|
||||||
|
enable = true;
|
||||||
|
plugins = with pkgs.obs-studio-plugins; [ wlrobs ];
|
||||||
|
};
|
||||||
|
}
|
10
home/laptop/programs/swaylock.nix
Normal file
10
home/laptop/programs/swaylock.nix
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{ pkgs, lib, ... }: {
|
||||||
|
programs.swaylock = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
color = "000000";
|
||||||
|
line-color = "ffffff";
|
||||||
|
show-failed-attempts = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
13
home/laptop/programs/tmux.nix
Normal file
13
home/laptop/programs/tmux.nix
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{ pkgs, lib, ... }: {
|
||||||
|
programs.tmux = {
|
||||||
|
enable = true;
|
||||||
|
clock24 = true;
|
||||||
|
plugins = with pkgs.tmuxPlugins; [ tilish catppuccin ];
|
||||||
|
extraConfig = ''
|
||||||
|
set -g default-command "''${SHELL}"
|
||||||
|
set -g default-terminal "tmux-256color"
|
||||||
|
set -g base-index 1
|
||||||
|
set -s escape-time 0
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
38
home/laptop/programs/zsh.nix
Normal file
38
home/laptop/programs/zsh.nix
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{ pkgs, lib, ... }: {
|
||||||
|
programs.zsh = {
|
||||||
|
enable = true;
|
||||||
|
syntaxHighlighting.enable = true;
|
||||||
|
enableAutosuggestions = true;
|
||||||
|
loginExtra = ''
|
||||||
|
[ "$(tty)" = "/dev/tty1" ] && exec sway
|
||||||
|
'';
|
||||||
|
shellAliases = {
|
||||||
|
gad = "git add . && git diff --cached";
|
||||||
|
gac = "ga && gc";
|
||||||
|
ga = "git add .";
|
||||||
|
gc = "git commit";
|
||||||
|
dev = "nix develop --command $SHELL";
|
||||||
|
};
|
||||||
|
history = {
|
||||||
|
size = 1000;
|
||||||
|
save = 1000;
|
||||||
|
expireDuplicatesFirst = true;
|
||||||
|
};
|
||||||
|
plugins = [
|
||||||
|
{
|
||||||
|
name = "zsh-powerlevel10k";
|
||||||
|
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
|
||||||
|
file = "powerlevel10k.zsh-theme";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "zsh-nix-shell";
|
||||||
|
file = "nix-shell.plugin.zsh";
|
||||||
|
src = "${pkgs.zsh-nix-shell}/share/zsh-nix-shell";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
initExtra = ''
|
||||||
|
source "$HOME/.p10k.zsh"
|
||||||
|
eval "$(direnv hook zsh)"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user