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" ]; environment.pathsToLink = [ "/share/zsh" ];
home-manager.users.froidmpa = { pkgs, config, ... }: { 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 = { nixpkgs.config = {
allowUnfree = true; allowUnfree = true;
@ -35,7 +43,6 @@
enableSshSupport = false; enableSshSupport = false;
pinentryFlavor = "gtk2"; pinentryFlavor = "gtk2";
}; };
mpd = import ./froidmpa/mpd.nix { inherit config; };
stalonetray = { stalonetray = {
enable = true; enable = true;
config = { config = {
@ -50,7 +57,6 @@
}; };
unclutter.enable = true; unclutter.enable = true;
pasystray.enable = true; pasystray.enable = true;
dunst = import ./froidmpa/dunst.nix { };
screen-locker = { screen-locker = {
enable = true; enable = true;
inactiveInterval = 5; inactiveInterval = 5;
@ -77,107 +83,22 @@
theme = "gruvbox-dark"; theme = "gruvbox-dark";
terminal = "alacritty"; terminal = "alacritty";
}; };
neovim = import ./froidmpa/neovim.nix { inherit pkgs; };
bat.enable = true; bat.enable = true;
jq.enable = true; jq.enable = true;
fzf.enable = true; fzf.enable = true;
lesspipe.enable = true; lesspipe.enable = true;
zathura.enable = true; zathura.enable = true;
pazi.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 = { broot = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
}; };
command-not-found.enable = true; command-not-found.enable = true;
zsh = import ./froidmpa/zsh.nix { inherit pkgs; };
direnv = { direnv = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
nix-direnv.enable = 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,4 +1,6 @@
{}: { config, lib, pkgs, ... }:
{
services.dunst =
{ {
enable = true; enable = true;
settings = { settings = {
@ -41,4 +43,5 @@
timeout = 10; 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,4 +1,6 @@
{ config, ... }: { config, lib, pkgs, ... }:
{
services.mpd =
{ {
enable = true; enable = true;
network.listenAddress = "any"; network.listenAddress = "any";
@ -20,4 +22,5 @@
format "44100:16:2" format "44100:16:2"
} }
''; '';
};
} }

View file

@ -1,5 +1,6 @@
{ pkgs, ... }: { config, lib, pkgs, ... }:
{ {
programs.neovim = {
enable = true; enable = true;
vimAlias = true; vimAlias = true;
plugins = with pkgs; [ plugins = with pkgs; [
@ -30,4 +31,5 @@
" Run xrdb whenever Xdefaults or Xresources are updated. " Run xrdb whenever Xdefaults or Xresources are updated.
autocmd BufWritePost ~/.Xresources,~/.Xdefaults !xrdb % 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,4 +1,6 @@
{ pkgs, ... }: { config, lib, pkgs, ... }:
{
programs.zsh =
{ {
enable = true; enable = true;
history = { history = {
@ -36,4 +38,5 @@
src = pkgs.zsh-completions; src = pkgs.zsh-completions;
} }
]; ];
};
} }