Split user config in more files

This commit is contained in:
Paul-Henri Froidmont 2022-07-27 03:30:00 +02:00
parent e7298e005b
commit f74657d221
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
7 changed files with 235 additions and 214 deletions

View file

@ -4,7 +4,15 @@
environment.pathsToLink = [ "/share/zsh" ];
home-manager.users.froidmpa = { pkgs, config, ... }: {
imports = [ ./froidmpa/alacritty.nix ];
imports = [
./froidmpa/alacritty.nix
./froidmpa/neovim.nix
./froidmpa/mpd.nix
./froidmpa/dunst.nix
./froidmpa/htop.nix
./froidmpa/zsh.nix
./froidmpa/vscode.nix
];
nixpkgs.config = {
allowUnfree = true;
@ -35,7 +43,6 @@
enableSshSupport = false;
pinentryFlavor = "gtk2";
};
mpd = import ./froidmpa/mpd.nix { inherit config; };
stalonetray = {
enable = true;
config = {
@ -50,7 +57,6 @@
};
unclutter.enable = true;
pasystray.enable = true;
dunst = import ./froidmpa/dunst.nix { };
screen-locker = {
enable = true;
inactiveInterval = 5;
@ -77,107 +83,22 @@
theme = "gruvbox-dark";
terminal = "alacritty";
};
neovim = import ./froidmpa/neovim.nix { inherit pkgs; };
bat.enable = true;
jq.enable = true;
fzf.enable = true;
lesspipe.enable = true;
zathura.enable = true;
pazi.enable = true;
htop = {
enable = true;
settings = {
hide_userland_threads = true;
highlight_base_name = true;
vim_mode = true;
fields = with config.lib.htop.fields;[
PID
USER
M_RESIDENT
M_SHARE
STATE
PERCENT_CPU
PERCENT_MEM
IO_RATE
TIME
COMM
];
} // (
with config.lib.htop; leftMeters [
(bar "LeftCPUs2")
(bar "CPU")
(bar "Memory")
(bar "Swap")
]
) // (
with config.lib.htop; rightMeters [
(bar "RightCPUs2")
(text "Tasks")
(text "LoadAverage")
(text "Uptime")
]
);
};
broot = {
enable = true;
enableZshIntegration = true;
};
command-not-found.enable = true;
zsh = import ./froidmpa/zsh.nix { inherit pkgs; };
direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
vscode = {
enable = true;
package = pkgs.vscodium;
extensions = (
with pkgs.vscode-extensions; [
pkief.material-icon-theme
jnoortheen.nix-ide
arrterian.nix-env-selector
scala-lang.scala
scalameta.metals
hashicorp.terraform
bradlc.vscode-tailwindcss
]
);
userSettings = {
"editor.formatOnSave" = true;
"editor.quickSuggestions" = {
"strings" = true;
};
"tailwindCSS.includeLanguages" = {
"scala" = "html";
};
"tailwindCSS.experimental.classRegex" = [
[ "cls\\(([^)]*)\\)" "\"([^']*)\"" ]
];
"files.autoSave" = "onFocusChange";
"files.watcherExclude" = {
"**/.bloop" = true;
"**/.metals" = true;
"**/.ammonite" = true;
};
"gruvboxMaterial.darkContrast" = "hard";
"metals.millScript" = "mill";
"nix.enableLanguageServer" = true;
"terminal.integrated.confirmOnExit" = "hasChildProcesses";
"terraform.languageServer" = {
"external" = true;
"pathToBinary" = "";
"args" = [
"serve"
];
"maxNumberOfProblems" = 100;
"trace.server" = "off";
};
"workbench.colorTheme" = "Gruvbox Material Dark";
"workbench.iconTheme" = "material-icon-theme";
};
};
};

View file

@ -1,44 +1,47 @@
{}:
{ config, lib, pkgs, ... }:
{
enable = true;
settings = {
global = {
monitor = 0;
geometry = "350x5-30+50";
transparency = 10;
font = "monospace 14";
idle_threshold = 120;
allow_markup = "yes";
format = "<b>%s</b>\n%b";
show_age_threshold = 300;
word_wrap = "yes";
sticky_history = "yes";
sort = "yes";
services.dunst =
{
enable = true;
settings = {
global = {
monitor = 0;
geometry = "350x5-30+50";
transparency = 10;
font = "monospace 14";
idle_threshold = 120;
allow_markup = "yes";
format = "<b>%s</b>\n%b";
show_age_threshold = 300;
word_wrap = "yes";
sticky_history = "yes";
sort = "yes";
};
frame = {
width = 3;
color = "#ebdbb2";
};
shortcuts = {
close = "ctrl+space";
close_all = "ctrl+shift+space";
history = "ctrl+grave";
context = "ctrl+shift+period";
};
urgency_low = {
foreground = "#ebdbb2";
background = "#32302f";
timeout = 10;
};
urgency_normal = {
foreground = "#ebdbb2";
background = "#32302f";
timeout = 10;
};
urgency_critical = {
foreground = "#ebdbb2";
background = "#32302f";
timeout = 10;
};
};
};
frame = {
width = 3;
color = "#ebdbb2";
};
shortcuts = {
close = "ctrl+space";
close_all = "ctrl+shift+space";
history = "ctrl+grave";
context = "ctrl+shift+period";
};
urgency_low = {
foreground = "#ebdbb2";
background = "#32302f";
timeout = 10;
};
urgency_normal = {
foreground = "#ebdbb2";
background = "#32302f";
timeout = 10;
};
urgency_critical = {
foreground = "#ebdbb2";
background = "#32302f";
timeout = 10;
};
};
}

37
users/froidmpa/htop.nix Normal file
View file

@ -0,0 +1,37 @@
{ config, lib, pkgs, ... }:
{
programs.htop = {
enable = true;
settings = {
hide_userland_threads = true;
highlight_base_name = true;
vim_mode = true;
fields = with config.lib.htop.fields;[
PID
USER
M_RESIDENT
M_SHARE
STATE
PERCENT_CPU
PERCENT_MEM
IO_RATE
TIME
COMM
];
} // (
with config.lib.htop; leftMeters [
(bar "LeftCPUs2")
(bar "CPU")
(bar "Memory")
(bar "Swap")
]
) // (
with config.lib.htop; rightMeters [
(bar "RightCPUs2")
(text "Tasks")
(text "LoadAverage")
(text "Uptime")
]
);
};
}

View file

@ -1,23 +1,26 @@
{ config, ... }:
{ config, lib, pkgs, ... }:
{
enable = true;
network.listenAddress = "any";
musicDirectory = "${config.home.homeDirectory}/Nextcloud/Media/Music";
playlistDirectory = "${config.home.homeDirectory}/Nextcloud/Playlists";
extraConfig = ''
max_output_buffer_size "16384"
auto_update "yes"
audio_output {
type "pulse"
name "pulse audio"
device "pulse"
mixer_type "hardware"
}
audio_output {
type "fifo"
name "toggle_visualizer"
path "/tmp/mpd.fifo"
format "44100:16:2"
}
'';
services.mpd =
{
enable = true;
network.listenAddress = "any";
musicDirectory = "${config.home.homeDirectory}/Nextcloud/Media/Music";
playlistDirectory = "${config.home.homeDirectory}/Nextcloud/Playlists";
extraConfig = ''
max_output_buffer_size "16384"
auto_update "yes"
audio_output {
type "pulse"
name "pulse audio"
device "pulse"
mixer_type "hardware"
}
audio_output {
type "fifo"
name "toggle_visualizer"
path "/tmp/mpd.fifo"
format "44100:16:2"
}
'';
};
}

View file

@ -1,33 +1,35 @@
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
{
enable = true;
vimAlias = true;
plugins = with pkgs; [
vimPlugins.gruvbox-community
vimPlugins.vim-airline
vimPlugins.vim-airline-themes
vimPlugins.vim-gitgutter
vimPlugins.nerdtree
vimPlugins.nerdtree-git-plugin
vimPlugins.ctrlp-vim
vimPlugins.tabular
];
extraConfig = ''
let g:gruvbox_italic=1
colorscheme gruvbox
set background=dark
let g:airline_powerline_fonts = 1
autocmd VimEnter * hi Normal ctermbg=NONE guibg=NONE
programs.neovim = {
enable = true;
vimAlias = true;
plugins = with pkgs; [
vimPlugins.gruvbox-community
vimPlugins.vim-airline
vimPlugins.vim-airline-themes
vimPlugins.vim-gitgutter
vimPlugins.nerdtree
vimPlugins.nerdtree-git-plugin
vimPlugins.ctrlp-vim
vimPlugins.tabular
];
extraConfig = ''
let g:gruvbox_italic=1
colorscheme gruvbox
set background=dark
let g:airline_powerline_fonts = 1
autocmd VimEnter * hi Normal ctermbg=NONE guibg=NONE
"Toggle NERDTree with Ctrl-N
map <C-n> :NERDTreeToggle<CR>
"Toggle NERDTree with Ctrl-N
map <C-n> :NERDTreeToggle<CR>
"Show hidden files in NERDTree
let NERDTreeShowHidden=1
"Show hidden files in NERDTree
let NERDTreeShowHidden=1
set number relativenumber
set number relativenumber
" Run xrdb whenever Xdefaults or Xresources are updated.
autocmd BufWritePost ~/.Xresources,~/.Xdefaults !xrdb %
'';
" Run xrdb whenever Xdefaults or Xresources are updated.
autocmd BufWritePost ~/.Xresources,~/.Xdefaults !xrdb %
'';
};
}

52
users/froidmpa/vscode.nix Normal file
View file

@ -0,0 +1,52 @@
{ config, lib, pkgs, ... }:
{
programs.vscode = {
enable = true;
package = pkgs.vscodium;
extensions = (
with pkgs.vscode-extensions; [
pkief.material-icon-theme
jnoortheen.nix-ide
arrterian.nix-env-selector
scala-lang.scala
scalameta.metals
hashicorp.terraform
bradlc.vscode-tailwindcss
]
);
userSettings = {
"editor.formatOnSave" = true;
"editor.quickSuggestions" = {
"strings" = true;
};
"tailwindCSS.includeLanguages" = {
"scala" = "html";
};
"tailwindCSS.experimental.classRegex" = [
[ "cls\\(([^)]*)\\)" "\"([^']*)\"" ]
];
"files.autoSave" = "onFocusChange";
"files.watcherExclude" = {
"**/.bloop" = true;
"**/.metals" = true;
"**/.ammonite" = true;
};
"gruvboxMaterial.darkContrast" = "hard";
"metals.millScript" = "mill";
"nix.enableLanguageServer" = true;
"terminal.integrated.confirmOnExit" = "hasChildProcesses";
"terraform.languageServer" = {
"external" = true;
"pathToBinary" = "";
"args" = [
"serve"
];
"maxNumberOfProblems" = 100;
"trace.server" = "off";
};
"workbench.colorTheme" = "Gruvbox Material Dark";
"workbench.iconTheme" = "material-icon-theme";
};
};
}

View file

@ -1,39 +1,42 @@
{ pkgs, ... }:
{ config, lib, pkgs, ... }:
{
enable = true;
history = {
save = 50000;
size = 50000;
};
enableCompletion = true;
enableAutosuggestions = true;
enableSyntaxHighlighting = true;
initExtra = ''
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
[[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
[[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
eval $(thefuck --alias)
'';
oh-my-zsh = {
enable = true;
plugins = [
"git"
"terraform"
];
theme = "robbyrussell";
};
plugins = [
programs.zsh =
{
name = "nix-zsh-completions";
src = pkgs.nix-zsh-completions;
}
{
name = "zsh-completions";
src = pkgs.zsh-completions;
}
];
enable = true;
history = {
save = 50000;
size = 50000;
};
enableCompletion = true;
enableAutosuggestions = true;
enableSyntaxHighlighting = true;
initExtra = ''
autoload -Uz up-line-or-beginning-search down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
[[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search
[[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search
eval $(thefuck --alias)
'';
oh-my-zsh = {
enable = true;
plugins = [
"git"
"terraform"
];
theme = "robbyrussell";
};
plugins = [
{
name = "nix-zsh-completions";
src = pkgs.nix-zsh-completions;
}
{
name = "zsh-completions";
src = pkgs.zsh-completions;
}
];
};
}