Better folder structure

This commit is contained in:
Filippo Berto 2022-08-12 09:09:29 +02:00
parent 8778fa8ccb
commit c4e5ccf6bf
75 changed files with 174 additions and 172 deletions

47
hm_modules/__basic.nix Normal file
View file

@ -0,0 +1,47 @@
{ pkgs, ... }:
{
home = {
language.base = "it_IT.UTF-8";
packages = with pkgs; [
fd
file
htop
mmv-go
neofetch
nixos-option
nix-tree
unrar
unzip
wget
xclip
yq
zip
];
};
imports = [
./configurations.nix
./bash.nix
./bat.nix
./bottom.nix
./broot.nix
./dircolors.nix
./direnv.nix
./fonts.nix
./fzf.nix
./git.nix
./gpg.nix
./info.nix
./jq.nix
./keychain.nix
./lf.nix
./man.nix
./shell_aliases.nix
./ssh.nix
./starship.nix
./tmux.nix
./zoxide.nix
./zsh.nix
];
}

54
hm_modules/alacritty.nix Normal file
View file

@ -0,0 +1,54 @@
{ pkgs, ... }:
let
strPalette = with pkgs.rice; pkgs.lib.rice.palette.toRgbHex rec {
inherit (colorPalette) normal bright;
dim = colorPalette.dark;
primary = {
background = normal.black;
foreground = normal.white;
dim_foreground = dim.white;
};
cursor = {
cursor = normal.white;
text = normal.black;
};
vi_mode_cursor = {
cursor = normal.white;
text = normal.black;
};
selection.background = dim.blue;
search = {
matches.background = dim.cyan;
bar = {
foreground = dim.cyan;
background = dim.yellow;
};
};
};
in
{
# Include fonts packages
home.packages = [ pkgs.rice.font.monospace.package ];
programs.alacritty = {
enable = true;
settings = {
# env.TERM = "xterm-256color";
env.TERM = "alacritty";
scrolling.history = 3000;
font = {
normal.family = pkgs.rice.font.monospace.name;
size = pkgs.rice.font.monospace.size;
};
window.opacity = pkgs.rice.opacity;
mouse = {
# hide_when_typing = true;
hints.modifiers = "Control";
};
colors = with pkgs.rice; strPalette // {
selection.text = "CellForeground";
search.matches.foreground = "CellForeground";
};
};
};
}

43
hm_modules/autorandr.nix Normal file
View file

@ -0,0 +1,43 @@
{
programs.autorandr = {
enable = true;
profiles = {
odin-intel = {
fingerprint = { "eDP1" = "00ffffffffffff0030e43f0500000000001a010495221378eaa1c59459578f27205054000000010101010101010101010101010101012e3680a070381f403020350058c21000001a5c2b80a070381f403020350058c21000001a000000fe0034584b3133803135365746360a000000000000413196001000000a010a202000c5"; };
config = {
"eDP1" = { primary = true; crtc = 0; mode = "1920x1080"; };
};
};
odin-intel-laboratorio-dock-dell = {
fingerprint = {
"DP1-3" = "00ffffffffffff0010ac10d04c36453221110103682b1b78ee8db0a2544a9c25115054a54b00714f818001010101010101010101010121399030621a274068b03600ae0e1100001c000000ff00434b3632373738413245364c0a000000fd00384b1e530f000a202020202020000000fc0044454c4c20453230375746500a0088";
"eDP1" = "00ffffffffffff0030e43f0500000000001a010495221378eaa1c59459578f27205054000000010101010101010101010101010101012e3680a070381f403020350058c21000001a5c2b80a070381f403020350058c21000001a000000fe0034584b3133803135365746360a000000000000413196001000000a010a202000c5";
};
config = {
"DP1-3" = { crtc = 1; mode = "1680x1050"; position = "120x0"; primary = true; };
"eDP1" = { crtc = 0; mode = "1920x1080"; position = "0x1080"; };
};
};
odin-intel-laboratorio = {
fingerprint = {
"DP1-3" = "00ffffffffffff0010ac71404c473344281601030e331d78eadd45a3554fa027125054a54b00714f8180d1c001010101010101010101023a801871382d40582c4500fe1f1100001e000000ff004b463837593241364433474c0a000000fc0044454c4c205532333132484d0a000000fd00384c1e5311000a2020202020200081";
"eDP1" = "00ffffffffffff0030e43f0500000000001a010495221378eaa1c59459578f27205054000000010101010101010101010101010101012e3680a070381f403020350058c21000001a5c2b80a070381f403020350058c21000001a000000fe0034584b3133803135365746360a000000000000413196001000000a010a202000c5";
};
config = {
"DP1-3" = { crtc = 1; mode = "1920x1080"; position = "0x0"; primary = true; };
"eDP1" = { crtc = 0; mode = "1920x1080"; position = "0x1080"; };
};
};
thor-two-screens = {
fingerprint = {
"DP-4" = "00ffffffffffff001e6d7f5ba1c60a00011f0104b53c22789f8cb5af4f43ab260e5054254b007140818081c0a9c0b300d1c08100d1cf09ec00a0a0a0675030203a0055502100001a000000fd0030901ee63c000a202020202020000000fc004c4720554c545241474541520a000000ff003130314e5454514c533230390a017102031a7123090607e305c000e606050160592846100403011f136fc200a0a0a0555030203a0055502100001a565e00a0a0a029503020350055502100001a5aa000a0a0a0465030203a005550210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000da";
"HDMI-0" = "00ffffffffffff004c2d2c0d443650302e19010380341d782a5295a556549d250e5054bb8c00b30081c0810081809500a9c001010101023a801871382d40582c450009252100001e000000fd0030481e5216000a202020202020000000fc00433234463339300a2020202020000000ff00485451483330353636370a20200163020324f14690041f131203230907078301000067030c001000802b681a00000101304800011d00bc52d01e20b828554009252100001e8c0ad090204031200c4055000925210000188c0ad08a20e02d10103e9600092521000018215280a07238304088c8350009252100001c00000000000000000000000000000000000000fa";
};
config = {
"DP-4" = { crtc = 0; mode = "2560x1440"; position = "1080x162"; primary = true; };
"HDMI-0" = { crtc = 1; mode = "1920x1080"; position = "0x0"; rotate = "right"; };
};
};
};
};
}

15
hm_modules/bash.nix Normal file
View file

@ -0,0 +1,15 @@
{
programs.bash = {
enable = true;
enableVteIntegration = true;
shellAliases = {
"ll" = "ls -l";
"la" = "ls -la";
".." = "cd ..";
};
bashrcExtra = ''
source $HOME/.profile
'';
};
}

9
hm_modules/bat.nix Normal file
View file

@ -0,0 +1,9 @@
{
programs.bat = {
enable = true;
config = {
theme = "Nord";
tabs = "2";
};
};
}

13
hm_modules/bottom.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs, ... }:
let
tomlGenerate = (pkgs.formats.toml { }).generate "bottom-toml";
in
{
home.packages = with pkgs; [ bottom ];
xdg.configFile."bottom/bottom.toml".source = tomlGenerate {
"flags" = {
"left_legend" = true;
"color" = "nord";
};
};
}

7
hm_modules/broot.nix Normal file
View file

@ -0,0 +1,7 @@
{
programs.broot = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
}

48
hm_modules/bspwm.nix Normal file
View file

@ -0,0 +1,48 @@
{ pkgs, lib, ... }:
let
monitorPages = [ "I" "II" "III" "IV" "V" "VI" "VII" "VIII" "IX" "X" ];
monitorPagesString = lib.strings.concatStringsSep " " monitorPages;
strPalette = pkgs.lib.rice.palette.toRGBHex pkgs.rice.colorPalette;
xrandr = "${pkgs.xorg.xrandr}/bin/xrandr";
xsetroot = "${pkgs.xorg.xsetroot}/bin/xsetroot";
in
{
xsession.windowManager.bspwm = {
enable = true;
settings = {
border_width = 2;
border_radius = 8;
window_gap = 4;
split_ratio = 0.5;
top_padding = 0;
borderless_monocle = true;
gapless_monocle = false;
normal_border_color = strPalette.normal.blue;
focused_border_color = strPalette.bright.red;
};
# monitors = builtins.foldl' (acc: monitor: acc // { ${monitor} = monitorPages; }) { } monitors;
rules = {
"*" = { follow = true; };
"Zathura" = { state = "tiled"; };
};
extraConfig = ''
for monitor in $(${xrandr} --listactivemonitors | cut -d " " -f 6); do
bspc monitor $monitor -d ${monitorPagesString}
done
autorandr -c
${xsetroot} -solid black -cursor_name left_ptr
systemctl --user restart \
polybar.service \
update-background.service
'';
startupPrograms = [ ];
};
services = {
network-manager-applet.enable = true;
blueman-applet.enable = true;
};
home.packages = with pkgs; [ blueman ];
}

24
hm_modules/cava.nix Normal file
View file

@ -0,0 +1,24 @@
{ pkgs, lib, ... }:
let
strPalette = with pkgs.rice; pkgs.lib.rice.palette.toRgbHex colorPalette;
fmtString = str: "\'${str}\'";
in
{
xdg.configFile."cava/config".text = lib.generators.toINI { } {
general = { bar_width = 1; bar_spacing = 1; };
color = {
gradient = 1;
gradient_count = 5;
gradient_color_1 = fmtString strPalette.normal.red;
gradient_color_2 = fmtString strPalette.normal.yellow;
gradient_color_3 = fmtString strPalette.normal.white;
gradient_color_4 = fmtString strPalette.normal.cyan;
gradient_color_5 = fmtString strPalette.normal.blue;
};
smoothing = {
gravity = 40;
noise_reduction = 0.25;
monstercat = 1;
};
};
}

View file

@ -0,0 +1,19 @@
{
home.file.".editorconfig".text = ''
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
# max_line_length = 120
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
[*.py]
indent_size = 4
'';
}

6
hm_modules/cpp.nix Normal file
View file

@ -0,0 +1,6 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
clang-tools
];
}

7
hm_modules/dircolors.nix Normal file
View file

@ -0,0 +1,7 @@
{
programs.dircolors = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
}

8
hm_modules/direnv.nix Normal file
View file

@ -0,0 +1,8 @@
{
programs.direnv = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
}

84
hm_modules/dunst.nix Normal file
View file

@ -0,0 +1,84 @@
{ pkgs, ... }:
let
palette = pkgs.lib.rice.palette.toRGBHex pkgs.rice.colorPalette;
in
{
home.packages = with pkgs; [ dunst rice.font.normal.package ];
services.dunst = {
enable = true;
iconTheme = {
package = pkgs.qogir-icon-theme;
name = "Qogir-dark";
};
settings = {
global = {
monitor = 0;
follow = "mouse";
geometry = "300x6-20+50";
indicate_hidden = "yes";
shrink = "yes";
transparency = 10;
notification_height = 0;
separator_height = 2;
padding = 8;
horizontal_padding = 8;
frame_width = 2;
frame_color = palette.normal.black;
separator_color = palette.normal.blue;
sort = "yes";
idle_threshold = 120;
font = "${pkgs.rice.font.normal.name} 10";
line_height = 0;
markup = "full";
format = "<b>%s</b>\\n%b";
alignment = "left";
show_age_threshold = 60;
word_wrap = "yes";
ellipsize = "middle";
ignore_newline = "no";
stack_duplicates = "true";
hide_duplicate_count = "false";
show_indicators = "yes";
icon_position = "off";
max_icon_size = 32;
sticky_history = "yes";
history_length = 20;
dmenu = "dmenu -p dunst:";
browser = "google-chrome-stable";
always_run_script = "true";
title = "Dunst";
class = "Dunst";
startup_notification = "false";
verbosity = "mesg";
corner_radius = 0;
force_xinerama = "false";
mouse_left_click = "close_current";
mouse_middle_click = "do_action";
mouse_right_click = "close_all";
};
urgency_low = {
background = palette.normal.black;
foreground = palette.normal.white;
timeout = 10;
};
urgency_normal = {
background = palette.normal.black;
foreground = palette.normal.white;
timeout = 10;
};
urgency_critical = {
background = palette.normal.black;
foreground = palette.normal.white;
frame_color = palette.bright.red;
timeout = 0;
};
shortcuts = {
close = "ctrl+space";
close_all = "ctrl+shift+space";
history = "ctrl+backslash";
context = "ctrl+shift+period";
};
};
};
}

View file

@ -0,0 +1,3 @@
{
services.easyeffects.enable = true;
}

15
hm_modules/fonts.nix Normal file
View file

@ -0,0 +1,15 @@
{ pkgs, ... }:
{
fonts.fontconfig = {
enable = true;
};
home.packages = with pkgs; [
dejavu_fonts
noto-fonts
noto-fonts-extra
noto-fonts-cjk-sans
font-awesome
corefonts # Microsoft fonts
vistafonts
];
}

8
hm_modules/fzf.nix Normal file
View file

@ -0,0 +1,8 @@
{
programs.fzf = {
enable = true;
tmux.enableShellIntegration = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
}

126
hm_modules/git.nix Normal file
View file

@ -0,0 +1,126 @@
{ pkgs, ... }:
let
shellAliases = {
"g" = "git";
"ga" = "git add";
"gaa" = "git add --all";
"gau" = "git add --update";
"gav" = "git add --verbose";
"gb" = "git branch";
"gba" = "git branch -a";
"gbd" = "git branch -d";
"gbD" = "git branch -D";
"gbl" = "git blame -b -w";
"gbnm" = "git branch --no-merged";
"gbr" = "git branch --remote";
"gbs" = "git bisect";
"gbsb" = "git bisect bad";
"gbsg" = "git bisect good";
"gbsr" = "git bisect reset";
"gbss" = "git bisect start";
"gc" = "git commit -v";
"gc!" = "git commit -v --amend";
"gcn!" = "git commit -v --no-edit --amend";
"gca" = "git commit -v -a";
"gca!" = "git commit -v -a --amend";
"gcan!" = "git commit -v -a --no-edit --amend";
"gcans!" = "git commit -v -a -s --no-edit --amend";
"gcas" = "git commit -a -s";
"gcb" = "git checkout -b";
"gcl" = "git clone --recurse-submodules";
"gclean" = "git clean -id";
"gpristine" = "git reset --hard && git clean -dffx";
"gco" = "git checkout";
"gcount" = "git shortlog -sn";
"gcp" = "git cherry-pick";
"gcpa" = "git cherry-pick --abort";
"gcpc" = "git cherry-pick --continue";
"gd" = "git diff";
"gdca" = "git diff --cached";
"gdcw" = "git diff --cached --word-diff";
"gdct" = "git describe --tags $(git rev-list --tags --max-count=1)";
"gds" = "git diff --staged";
"gdt" = "git diff-tree --no-commit-id --name-only -r";
"gdw" = "git diff --word-diff";
"gf" = "git fetch";
"gfa" = "git fetch --all --prune";
"gfg" = "git ls-files \| grep";
"gignored" = ''git ls-files -v \| grep"^[[ :lower: ]]"'';
"glo" = "git log --oneline --decorate";
"glols" = "git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat";
"glola" = "git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all";
"glog" = "git log --oneline --decorate --graph";
"gloga" = "git log --oneline --decorate --graph --all";
"gm" = "git merge";
"gma" = "git merge --abort";
"gp" = "git push";
"gpa" = "git push --all";
"gpf!" = "git push --force";
"gpoat" = "git push origin --all && git push origin --tags";
"gpu" = "git push upstream";
"gpv" = "git push -v";
"gr" = "git remote";
"gra" = "git remote add";
"grb" = "git rebase";
"grba" = "git rebase --abort";
"grbc" = "git rebase --continue";
"grbi" = "git rebase -i";
"grev" = "git revert";
"grh" = "git reset";
"grhh" = "git reset --hard";
"grm" = "git rm";
"grmc" = "git rm --cached";
"grs" = "git restore";
"grv" = "git remote -v";
"gss" = "git status -s";
"gst" = "git status";
"gsta" = "git stash push";
"gstas" = "git stash save";
"gstaa" = "git stash apply";
"gstc" = "git stash clear";
"gstd" = "git stash drop";
"gstl" = "git stash list";
"gstp" = "git stash pop";
"gsts" = "git stash show --text";
"gup" = "git pull --rebase";
"gupv" = "git pull --rebase -v";
};
in
{
programs.git = {
enable = true;
userName = "Filippo Berto";
userEmail = "berto.f@protonmail.com";
# signing = {
# key = "berto.f@protonmail.com";
# signByDefault = true;
# };
extraConfig = {
"add.interactive".useBuiltin = false;
commit.gpgSign = true;
# core.editor = kak;
credential.helper = "cache --timeout=3600 ";
delta.navigate = true;
delta.side-by-side = true;
diff.colorMoved = "default";
diff.guitool = "meld";
init.defaultBranch = "main";
merge.conflictstyle = "diff3";
merge.guitool = "meld";
merge.tool = "meld";
pull.rebase = true;
rebase.autoStash = true;
user.signingKey = "berto.f@protonmail.com";
};
lfs.enable = true;
delta.enable = true;
};
programs.bash.shellAliases = shellAliases;
programs.zsh.shellAliases = shellAliases;
home.packages = with pkgs; [
gh
git-secret
glab
meld
];
}

10
hm_modules/go.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs, ... }: {
programs.go = {
enable = true;
goPath = ".go";
};
home.packages = with pkgs; [
gopls
];
}

12
hm_modules/gpg.nix Normal file
View file

@ -0,0 +1,12 @@
{
programs.gpg = {
enable = true;
settings = { };
};
services.gpg-agent = {
enable = true;
defaultCacheTtl = 600;
# extraConfig = "allow-loopback-pinentry";
};
}

23
hm_modules/grobi.nix Normal file
View file

@ -0,0 +1,23 @@
{
services.grobi = {
enable = true;
rules = [
{
name = "Nvidia2screens";
outputs_connected = [ "HDMI-0" "eDP-1-1" ];
configure_column = [ "HDMI-0" "eDP-1-1" ];
primary = "HDMI-0";
}
{
name = "FallbackIntel";
outputs_connected = [ "eDP1" ];
configure_single = "eDP1";
}
{
name = "FallbackNvidia";
outputs_connected = [ "eDP-1-1" ];
configure_single = "eDP-1-1";
}
];
};
}

30
hm_modules/gtk_theme.nix Normal file
View file

@ -0,0 +1,30 @@
{ pkgs, ... }:
{
gtk = with pkgs.rice; {
enable = true;
font = font.normal;
iconTheme = {
package = pkgs.qogir-icon-theme;
name = "Qogir-dark";
};
theme = {
package = pkgs.nordic;
name = "Nordic-bluish-accent";
};
};
qt = {
enable = true;
platformTheme = "gtk";
};
home = {
pointerCursor = {
package = pkgs.qogir-icon-theme;
name = "Qogir";
# size = 64;
# x11.enable = true;
gtk.enable = true;
};
};
}

107
hm_modules/helix.nix Normal file
View file

@ -0,0 +1,107 @@
{ pkgs, ... }:
{
programs.bash.shellAliases = { x = "hx"; };
programs.zsh.shellAliases = { x = "hx"; };
home.sessionVariables = { EDITOR = "hx"; VISUAL = "hx"; };
home.packages = [
(pkgs.makeDesktopItem
{
name = "helix";
exec = "hx %F";
icon = "helix";
desktopName = "Helix";
comment = "Helix text editor";
terminal = true;
categories = [ "Development" ];
mimeTypes = [
"text/english"
"text/plain"
"text/x-makefile"
"text/x-c++hdr"
"text/x-c++src"
"text/x-chdr"
"text/x-csrc"
"text/x-java"
"text/x-moc"
"text/x-pascal"
"text/x-tcl"
"text/x-tex"
"application/x-shellscript"
"text/x-c"
"text/x-c++"
];
})
];
programs.helix = {
enable = true;
package = pkgs.unstable.helix;
languages = [ ];
settings = {
theme = "monokai_pro_octagon";
editor.lsp.display-messages = true;
editor.scrolloff = 5;
editor.true-color = true;
keys.normal = {
"C-A-l" = ":format";
"C-A-r" = ":reload";
};
};
themes =
let
transparent = "none";
gray = "#665c54";
dark-gray = "#3c3836";
white = "#fbf1c7";
black = "#282828";
red = "#fb4934";
green = "#b8bb26";
yellow = "#fabd2f";
orange = "#fe8019";
blue = "#83a598";
magenta = "#d3869b";
cyan = "#8ec07c";
in
{
base16 = {
"ui.menu" = transparent;
"ui.menu.selected" = { modifiers = [ "reversed" ]; };
"ui.linenr" = { fg = gray; bg = dark-gray; };
"ui.popup" = { modifiers = [ "reversed" ]; };
"ui.linenr.selected" = { fg = white; bg = black; modifiers = [ "bold" ]; };
"ui.selection" = { fg = black; bg = blue; };
"ui.selection.primary" = { modifiers = [ "reversed" ]; };
"comment" = { fg = gray; };
"ui.statusline" = { fg = white; bg = dark-gray; };
"ui.statusline.inactive" = { fg = dark-gray; bg = white; };
"ui.help" = { fg = dark-gray; bg = white; };
"ui.cursor" = { modifiers = [ "reversed" ]; };
"variable" = red;
"variable.builtin" = orange;
"constant.numeric" = orange;
"constant" = orange;
"attributes" = yellow;
"type" = yellow;
"ui.cursor.match" = { fg = yellow; modifiers = [ "underlined" ]; };
"string" = green;
"variable.other.member" = red;
"constant.character.escape" = cyan;
"function" = blue;
"constructor" = blue;
"special" = blue;
"keyword" = magenta;
"label" = magenta;
"namespace" = blue;
"diff.plus" = green;
"diff.delta" = yellow;
"diff.minus" = red;
"diagnostic" = { modifiers = [ "underlined" ]; };
"ui.gutter" = { bg = black; };
"info" = blue;
"hint" = dark-gray;
"debug" = dark-gray;
"warning" = yellow;
"error" = red;
};
};
};
}

5
hm_modules/info.nix Normal file
View file

@ -0,0 +1,5 @@
{
programs.info = {
enable = true;
};
}

3
hm_modules/java.nix Normal file
View file

@ -0,0 +1,3 @@
{
programs.java.enable = true;
}

View file

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
flow
];
}

View file

@ -0,0 +1,21 @@
{ pkgs, ... }:
let
joystickwakeCmd = "${pkgs.joystickwake}/bin/joystickwake";
in
{
systemd.user.services."joystickwake" = {
Unit = {
Description = "Keep lockscreen from activating";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = joystickwakeCmd;
Environment = [ "DISPLAY=:0" ];
};
};
}

5
hm_modules/jq.nix Normal file
View file

@ -0,0 +1,5 @@
{
programs.jq = {
enable = true;
};
}

273
hm_modules/kakoune.nix Normal file
View file

@ -0,0 +1,273 @@
{ pkgs, ... }:
let
themeBuilder = palette: with palette; ''
set-face global value rgb:${normal.magenta},default
set-face global type rgb:${bright.white},default
set-face global identifier rgb:${normal.cyan},default
set-face global string rgb:${normal.green},default
set-face global error rgb:${normal.red},default
set-face global keyword rgb:${normal.blue},default
set-face global operator rgb:${normal.blue},default
set-face global attribute rgb:${bright.blue},default
set-face global comment rgb:${bright.blue},default
set-face global meta rgb:${normal.yellow},default
set-face global Default rgb:${normal.white},default
set-face global PrimarySelection rgb:${normal.black},rgb:${dark.yellow}
set-face global SecondarySelection rgb:${normal.black},rgb:${dark.white}
set-face global PrimaryCursor rgb:${normal.black},rgb:${normal.yellow}
set-face global SecondaryCursor rgb:${normal.black},rgb:${normal.white}
set-face global MenuForeground rgb:${normal.white},rgb:${bright.black}
set-face global MenuBackground default,rgb:${normal.black}
set-face global MenuInfo default,rgb:${normal.black}
set-face global Information rgb:${dark.black},rgb:${normal.cyan}
set-face global StatusLine rgb:${normal.white},rgb:${normal.black}
set-face global StatusLineMode rgb:${normal.blue},rgb:${normal.black}
set-face global StatusLineInfo rgb:${normal.blue},rgb:${normal.black}
set-face global StatusLineValue rgb:${normal.blue},rgb:${normal.black}
set-face global StatusCursor rgb:${dark.black},rgb:${normal.yellow}
set-face global Prompt rgb:${normal.cyan},rgb:${normal.black}
set-face global BufferPadding default,default
'';
packages = with pkgs; [
yaml-language-server
nodePackages.vscode-langservers-extracted
rnix-lsp
editorconfig-core-c
aspell
aspellDicts.en
aspellDicts.en-computers
aspellDicts.en-science
aspellDicts.it
(pkgs.makeDesktopItem
{
name = "kakoune";
exec = "kak %F";
icon = "kakoune";
desktopName = "Kakoune";
comment = "Kakoune text editor";
terminal = true;
categories = [ "Development" ];
mimeTypes = [
"text/english"
"text/plain"
"text/x-makefile"
"text/x-c++hdr"
"text/x-c++src"
"text/x-chdr"
"text/x-csrc"
"text/x-java"
"text/x-moc"
"text/x-pascal"
"text/x-tcl"
"text/x-tex"
"application/x-shellscript"
"text/x-c"
"text/x-c++"
];
})
];
in
{
programs.bash.shellAliases = { k = "kak"; };
programs.zsh.shellAliases = { k = "kak"; };
home.packages = packages;
programs.kakoune = {
enable = true;
config = {
colorScheme = "nord";
tabStop = 2;
indentWidth = 2;
alignWithTabs = true;
scrollOff = { lines = 5; columns = 3; };
ui = { setTitle = true; changeColors = true; enableMouse = true; };
wrapLines = { enable = true; word = true; };
numberLines = { enable = true; highlightCursor = true; };
keyMappings = [
{ mode = "normal"; docstring = "Edit file"; key = "<c-e>"; effect = ":edit<space>"; }
{ mode = "user"; docstring = "Code actions"; key = "a"; effect = ":lsp-code-actions<ret>"; }
{ mode = "user"; docstring = "Comment block"; key = "b"; effect = ":comment-block<ret>"; }
{ mode = "user"; docstring = "Comment line"; key = "l"; effect = ":comment-line<ret>"; }
{ mode = "user"; docstring = "Copy to clipboard"; key = "y"; effect = "<a-|>${pkgs.xclip}/bin/xclip -i -selection clipboard<ret>"; }
{ mode = "user"; docstring = "Format code with formatter"; key = "f"; effect = ":format<ret>"; }
{ mode = "user"; docstring = "Format code with LSP"; key = "F"; effect = ":lsp-formatting-sync<ret>"; }
{ mode = "user"; docstring = "Jump to definition"; key = "d"; effect = ":lsp-definition<ret>"; }
{ mode = "user"; docstring = "Rename object"; key = "r"; effect = ":lsp-rename-prompt<ret>"; }
{ mode = "user"; docstring = "Jump to type definition"; key = "t"; effect = ":lsp-type-definition<ret>"; }
{ mode = "user"; docstring = "List project diagnostics"; key = "i"; effect = ":lsp-diagnostics<ret>"; }
{ mode = "user"; docstring = "Paste from clipboard (after)"; key = "P"; effect = "<a-!>${pkgs.xclip}/bin/xclip -selection clipboard -o<ret>"; }
{ mode = "user"; docstring = "Paste from clipboard (before)"; key = "p"; effect = "!${pkgs.xclip}/bin/xclip -selection clipboard -o<ret>"; }
{ mode = "user"; docstring = "Show hover info"; key = "q"; effect = ":lsp-hover<ret>"; }
{ mode = "user"; docstring = "Spellcheck English"; key = "S"; effect = ":spell en<ret>"; }
{ mode = "user"; docstring = "Spellcheck"; key = "s"; effect = ":spell "; }
{ mode = "normal"; docstring = "Try next snippet placeholder"; key = "<c-n>"; effect = "<a-;>: insert-c-n<ret>"; }
# { mode = "normal"; docstring = "Search"; key = "/"; effect = "/(?i)"; }
# { mode = "normal"; docstring = "Reverse search"; key = "<a-/>"; effect = "<a-/>(?i)"; }
];
hooks = with pkgs; [
{ name = "BufCreate"; option = ".*"; commands = "editorconfig-load"; }
# { name = "ModuleLoaded"; option = "auto-pairs"; commands = "auto-pairs-enable"; }
{ name = "ModuleLoaded"; option = "powerline"; commands = "powerline-enable; powerline-start"; }
{ name = "BufSetOption"; option = "filetype=latex"; commands = "set-option buffer formatcmd latexindent"; }
{ name = "BufSetOption"; option = "filetype=python"; commands = "set-option buffer formatcmd 'black -'"; }
{ name = "BufSetOption"; option = "filetype=(markdown|html|json|yaml|css|scss|less)"; commands = "set-option buffer formatcmd prettier"; }
{ name = "BufSetOption"; option = "filetype=rust"; commands = "set-option buffer formatcmd 'rustfmt'"; }
{ name = "BufSetOption"; option = "filetype=sh"; commands = "set-option buffer formatcmd 'rustfmt'"; }
];
# TODO add more formatters from https://github.com/mawww/kakoune/wiki/Format
};
extraConfig = builtins.concatStringsSep "\n" [
"# Custom commands"
"add-highlighter global/ regex \\h+$ 0:Error # Highlight trailing spaces"
"eval %sh{kak-lsp --kakoune -s $kak_session}"
"lsp-enable"
''
def -hidden insert-c-n %{
try %{
lsp-snippets-select-next-placeholders
exec '<a-;>d'
} catch %{
exec -with-hooks '<c-n>'
}
}
''
"require-module powerline"
"require-module connect-broot"
"require-module connect-lf"
"require-module connect-rofi"
];
plugins = with pkgs.kakounePlugins; [
prelude-kak
kak-lsp
auto-pairs-kak
powerline-kak
connect-kak
];
};
# THEME FILE
xdg.configFile."kak/colors/nord.kak".text = themeBuilder (pkgs.lib.rice.palette.toRgbShortHex pkgs.rice.colorPalette);
xdg.configFile."kak-lsp/kak-lsp.toml".text = ''
snippet_support = false
verbosity = 2
[server]
timeout = 1800 # seconds = 30 minutes
[language.c_cpp]
filetypes = ["c", "cpp"]
roots = ["compile_commands.json", ".clangd"]
command = "clangd"
offset_encoding = "utf-8"
[language.json]
filetypes = ["json"]
roots = ["package.json"]
command = "vscode-json-language-server"
args = ["--stdio"]
[language.yaml]
filetypes = ["yaml"]
roots = [".git"]
command = "yaml-language-server"
args = ["--stdio"]
[language.yaml.settings]
# See https://github.com/redhat-developer/yaml-language-server#language-server-settings
# Defaults are at https://github.com/redhat-developer/yaml-language-server/blob/master/src/yamlSettings.ts
yaml.format.enable = true
[language.go]
filetypes = ["go"]
roots = ["Gopkg.toml", "go.mod", ".git", ".hg"]
command = "gopls"
offset_encoding = "utf-8"
settings_section = "gopls"
[language.go.settings.gopls]
# See https://github.com/golang/tools/blob/master/gopls/doc/settings.md
# "build.buildFlags" = []
[language.html]
filetypes = ["html"]
roots = ["package.json"]
command = "vscode-html-language-server"
args = ["--stdio"]
[language.css]
filetypes = ["css"]
roots = ["package.json", ".git"]
command = "vscode-css-language-server"
args = ["--stdio"]
[language.less]
filetypes = ["less"]
roots = ["package.json", ".git"]
command = "vscode-css-language-server"
args = ["--stdio"]
[language.scss]
filetypes = ["scss"]
roots = ["package.json", ".git"]
command = "vscode-css-language-server"
args = ["--stdio"]
[language.javascript]
filetypes = ["javascript"]
roots = [".flowconfig"]
command = "flow"
args = ["lsp"]
[language.latex]
filetypes = ["latex"]
roots = [".git"]
command = "texlab"
settings_section = "texlab"
[language.latex.settings.texlab]
# See https://github.com/latex-lsp/texlab/blob/master/src/options.rs
# bibtexFormatter = "texlab"
[language.nix]
filetypes = ["nix"]
roots = ["flake.nix", "shell.nix", ".git"]
command = "rnix-lsp"
[language.python]
filetypes = ["python"]
roots = ["requirements.txt", "setup.py", ".git", ".hg"]
command = "pylsp"
offset_encoding = "utf-8"
[language.python.settings]
# See https://github.com/palantir/python-language-server#configuration
# and https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json
# "pyls.configurationSources" = ["flake8"]
[language.rust]
filetypes = ["rust"]
roots = ["Cargo.toml"]
command = "rust-analyzer"
settings_section = "rust-analyzer"
[language.rust.settings.rust-analyzer]
hoverActions.enable = false # kak-lsp doesn't support this at the moment
# cargo.features = []
# See https://rust-analyzer.github.io/manual.html#configuration
# If you get 'unresolved proc macro' warnings, you have two options
# 1. The safe choice is two disable the warning:
diagnostics.disabled = ["unresolved-proc-macro"]
# 2. Or you can opt-in for proc macro support
procMacro.enable = true
cargo.loadOutDirsFromCheck = true
# See https://github.com/rust-analyzer/rust-analyzer/issues/6448
[language.bash]
filetypes = ["sh"]
roots = [".git", ".hg"]
command = "bash-language-server"
args = ["start"]
'';
}

14
hm_modules/keepassxc.nix Normal file
View file

@ -0,0 +1,14 @@
{ pkgs, ... }:
{
config.systemd.user.services.keepassxc = {
Unit = {
Description = "KeePassXC password manager";
After = [ "graphical-session-pre.target" ];
Partof = [ "graphical-session.target" ];
};
Install = { WantedBy = [ "graphical-session.target" ]; };
Service = { ExecStart = "${pkgs.keepassxc}/bin/keepassxc"; };
};
}

10
hm_modules/keychain.nix Normal file
View file

@ -0,0 +1,10 @@
{
programs.keychain = {
enable = true;
keys = [ "id_ed25519" ];
agents = [ "gpg" "ssh" ];
enableBashIntegration = true;
enableZshIntegration = true;
enableXsessionIntegration = true;
};
}

48
hm_modules/kitty.nix Normal file
View file

@ -0,0 +1,48 @@
{ pkgs, ... }:
let
strPalette = with pkgs.rice; pkgs.lib.rice.palette.toRgbHex rec {
foreground = colorPalette.normal.white;
background = colorPalette.normal.black;
color0 = colorPalette.normal.black;
color1 = colorPalette.normal.red;
color2 = colorPalette.normal.green;
color3 = colorPalette.normal.yellow;
color4 = colorPalette.normal.blue;
color5 = colorPalette.normal.magenta;
color6 = colorPalette.normal.cyan;
color7 = colorPalette.normal.white;
color8 = colorPalette.bright.black;
color9 = colorPalette.bright.red;
color10 = colorPalette.bright.green;
color11 = colorPalette.bright.yellow;
color12 = colorPalette.bright.blue;
color13 = colorPalette.bright.magenta;
color14 = colorPalette.bright.cyan;
color15 = colorPalette.bright.white;
};
in
{
programs.kitty = {
enable = true;
package = pkgs.unstable.kitty;
settings = {
scrollback_lines = 10000;
enable_audio_bell = false;
visual_bell_duration = toString 0.1;
update_check_interval = 0;
background_opacity = toString pkgs.rice.opacity;
close_on_child_death = "yes";
clipboard_control = "write-clipboard write-primary read-clipboard read-primary";
disable_ligatures = "never";
editor = "kak";
} // strPalette;
keybindings = {
"ctrl+shift+t" = "new_tab_with_cwd";
"ctrl+shift+enter" = "new_window_with_cwd";
"ctrl+shift+n" = "new_os_window_with_cwd";
"ctrl+shift+up" = "previous_window";
"ctrl+shift+down" = "next_window";
};
font = pkgs.rice.font.monospace;
};
}

9
hm_modules/latex.nix Normal file
View file

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
bibtool
tex2nix
texlab
texlive.combined.scheme-medium
];
}

41
hm_modules/lf.nix Normal file
View file

@ -0,0 +1,41 @@
{ pkgs, ... }:
let
lf_kitty_cleaner = pkgs.writeShellScript "lf_kitty_cleaner" ''
kitty +icat --clear --silent --transfer-mode file
'';
lf_kitty_preview = pkgs.writeShellScript "lf_kitty_preview" ''
file=$1
w=$2
h=$3
x=$4
y=$5
if [[ "$( file -Lb --mime-type "$file")" =~ ^image ]]; then
kitty +icat --silent --transfer-mode file --place "''${w}x''${h}@''${x}x''${y}" "$file"
exit 1
fi
${pkgs.pistol}/bin/pistol "$file"
'';
in
{
programs.lf = {
enable = true;
settings = {
dircounts = true;
icons = true;
# mouse = true;
number = true;
# scrollof = 3;
hidden = true;
tabstop = 2;
};
previewer = {
source = lf_kitty_preview;
# keybinding = "i";
};
extraConfig = ''
set cleaner ${lf_kitty_cleaner}
'';
};
}

View file

@ -0,0 +1,26 @@
{ pkgs, ... }:
let
libinputGesturesCmd = "${pkgs.libinput-gestures}/bin/libinput-gestures";
xdotool = "${pkgs.xdotool}/bin/xdotool";
in
{
systemd.user.services."libinput-gestures" = {
Unit = {
Description = "Touchpad gestures";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = libinputGesturesCmd;
};
};
xdg.configFile."libinput-gestures.conf".text = ''
gesture swipe left ${xdotool} key alt+Right
gesture swipe right ${xdotool} key alt+Left
'';
}

3
hm_modules/lorri.nix Normal file
View file

@ -0,0 +1,3 @@
{
services.lorri.enable = true;
}

6
hm_modules/man.nix Normal file
View file

@ -0,0 +1,6 @@
{
programs.man = {
enable = true;
# generateCaches = true;
};
}

9
hm_modules/mangohud.nix Normal file
View file

@ -0,0 +1,9 @@
{
programs.mangohud = {
enable = true;
enableSessionWide = true;
settings = {
toggle_hud = "Ctrl_L+F12";
};
};
}

24
hm_modules/megasync.nix Normal file
View file

@ -0,0 +1,24 @@
{ pkgs, ... }:
let
megasyncCmd = "${pkgs.megacmd}/bin/mega-cmd-server";
in
{
home.packages = [
pkgs.megacmd
];
systemd.user.services."mega-cmd-server" = {
Unit = {
Description = "Mega command server";
After = [ "default.target" ];
PartOf = [ "default.target" ];
};
Install = {
WantedBy = [ "default.target" ];
};
Service = {
Type = "simple";
ExecStart = megasyncCmd;
};
};
}

4
hm_modules/nautilus.nix Normal file
View file

@ -0,0 +1,4 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [ gnome.nautilus ];
}

27
hm_modules/nix-index.nix Normal file
View file

@ -0,0 +1,27 @@
{ pkgs, ... }:
{
programs.nix-index = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
systemd.user = {
services."nix-index" = {
Unit = {
Description = "Update the nix-locate database";
After = [ "network.target" ];
};
Service = {
Type = "oneshot";
ExecStart = "${pkgs.nix-index}/bin/nix-index";
};
};
timers."nix-index" = {
Unit.Description = "Daily update the nix-locate database";
Timer = { OnCalendar = "daily"; Persistent = true; Unit = "nix-index.service"; };
Install.WantedBy = [ "timers.target" ];
};
};
}

5
hm_modules/noti.nix Normal file
View file

@ -0,0 +1,5 @@
{
programs.noti = {
enable = true;
};
}

12
hm_modules/obs-studio.nix Normal file
View file

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
programs.obs-studio = {
enable = true;
plugins = with pkgs.obs-studio-plugins; [
# obs-linuxbrowser
# obs-gstreamer
# obs-move-transition
# obs-multi-rtmp
];
};
}

11
hm_modules/office.nix Normal file
View file

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
# libreoffice-fresh
onlyoffice-bin
hunspellDicts.en_GB-large
hunspellDicts.en_US-large
hunspellDicts.it_IT
hunspell.bin
];
}

21
hm_modules/onedrive.nix Normal file
View file

@ -0,0 +1,21 @@
{ pkgs, ... }:
let
onedriveCmd = "${pkgs.unstable.onedrive}/bin/onedrive --monitor";
in
{
systemd.user.services."onedrive" = {
Unit = {
Description = "OneDrive synchronization service";
After = [ "network.target" ];
PartOf = [ "default.target" ];
};
Install = {
WantedBy = [ "default.target" ];
};
Service = {
ExecStart = onedriveCmd;
Restart = "always";
RestartSec = "30s";
};
};
}

5
hm_modules/pass.nix Normal file
View file

@ -0,0 +1,5 @@
{
programs.password-store = {
enable = true;
};
}

19
hm_modules/picom.nix Normal file
View file

@ -0,0 +1,19 @@
{
services.picom = {
enable = true;
blur = true;
experimentalBackends = true;
fade = false;
shadow = true;
vSync = true;
extraOptions = ''
blur:
{
method = "gaussian";
size = 10;
deviation = 7.0;
}
'';
};
}

311
hm_modules/polybar.nix Normal file
View file

@ -0,0 +1,311 @@
{ config, pkgs, lib, ... }:
with lib;
let
inherit (pkgs.rice) colorPalette opacity;
grep = "${pkgs.gnugrep}/bin/grep";
cut = "${pkgs.coreutils}/bin/cut";
head = "${pkgs.coreutils}/bin/head";
pavucontrol = "${pkgs.pavucontrol}/bin/pavucontrol";
pgrep = "${pkgs.procps}/bin/pgrep";
pkill = "${pkgs.procps}/bin/pkill";
playerCtl = "${pkgs.playerctl}/bin/playerctl";
playerStatus = "${playerCtl} -f '{{emoji(status)}} {{title}} - {{artist}}' metadata | ${head} -c 60";
systemctl = "${pkgs.systemd}/bin/systemctl";
loginctl = "${pkgs.systemd}/bin/loginctl";
shutdown = "${pkgs.systemd}/bin/shutdown";
logout = pkgs.writeShellScript "logout" ''
session=`${loginctl} session-status | ${pkgs.coreutils}/bin/head -n 1 | ${pkgs.gawk}/bin/awk '{print $1}'`
${loginctl} terminate-session $session
'';
colors = with pkgs.lib.rice; let
alpha = 255 * opacity;
in
palette.toARGBHex rec {
normal = {
foreground = colorPalette.normal.white;
background = color.setAlphaRgba alpha (colorPalette.normal.black);
underline = colorPalette.dark.blue;
};
active = {
foreground = colorPalette.bright.white;
background = color.setAlphaRgba alpha (colorPalette.normal.black);
underline = colorPalette.bright.blue;
};
selected = {
foreground = colorPalette.bright.white;
background = color.setAlphaRgba alpha (color.brighten 10 colorPalette.bright.black);
underline = colorPalette.bright.red;
};
alert = colorPalette.bright.red;
green = colorPalette.normal.green;
yellow = colorPalette.normal.yellow;
orange = colorPalette.bright.red;
red = colorPalette.normal.red;
transparent = color.transparent;
};
commonBar = {
locale = config.home.language.base;
monitor = "\${env:MONITOR}";
width = "100%";
height = 20;
radius = 6.0;
fixed-center = false;
background = colors.normal.background;
foreground = colors.normal.foreground;
line-size = 2;
line-color = colors.normal.underline;
padding = { left = 0; right = 0; };
module.margin = { left = 0; right = 0; };
separator = " ";
border = {
color = colors.transparent;
left.size = 2;
righ.sizet = 2;
top.size = 2;
bottom.size = 0;
};
font = [
"${pkgs.rice.font.monospace.name}:size=${toString pkgs.rice.font.monospace.size};2"
# "Font Awesome 6 Free:size=14;0"
# "Noto Color Emoji:size=2;2"
"Noto Sans Symbols2:size=${toString pkgs.rice.font.monospace.size};2"
# "Material Design Icons:size=${toString pkgs.rice.font.monospace.size};2"
# "EmojiOne Color:size=${toString pkgs.rice.font.monospace.size};0"
];
wm-restack = "bspwm";
};
ramp = [ "" "" "" "" "" "" ];
in
{
home.packages = with pkgs; [
pkgs.rice.font.monospace.package
# emojione
# noto-fonts-emoji
noto-fonts
# material-design-icons
# font-awesome
];
services.polybar = {
enable = true;
package = pkgs.polybarFull;
script =
''
monitor=`polybar -m | ${grep} primary | ${cut} -d":" -f1`
MONITOR=$monitor polybar primary &
monitors=(`polybar -m | ${grep} -v primary | ${cut} -d":" -f1`)
for monitor in "''${monitors[@]}"; do
MONITOR=$monitor polybar secondary &
done
'';
settings = {
"settings" = {
screenchange-reload = false;
};
"bar/primary" = recursiveUpdate commonBar {
modules-left = "bspwm";
# modules-center =
modules-right = "player pulseaudio temperature cpu memory battery date powermenu";
enable-ipc = true;
tray = {
position = "right";
padding = 0;
};
};
"bar/secondary" = recursiveUpdate commonBar {
modules-left = "bspwm";
# modules-center =
modules-right = "player pulseaudio temperature cpu memory battery date powermenu";
enable-ipc = true;
};
"module/battery" = {
type = "internal/battery";
adapter = "AC";
battery = "BAT0";
full.at = 98;
animation = {
charging = {
text = [ "" "" "" "" "" "" "" "" "" "" ];
framerate = "750";
};
discharging = {
text = [ "" "" "" "" "" "" "" "" "" "" ];
framerate = "750";
};
};
format = {
charging = recursiveUpdate colors.selected { text = "<animation-charging> <label-charging>"; };
discharging = recursiveUpdate colors.active { text = "<animation-discharging> <label-discharging>"; };
full = recursiveUpdate colors.normal { text = " <label-full>"; };
};
label.text = "%percentage%%";
# = {
# chargin = "%percentage%%";
# dischargin = "%percentage%%";
# full = "%percentage%%";
# };
};
"module/bspwm" = {
type = "internal/bspwm";
format = "<label-state>";
label =
let
common = {
padding = 1;
separator = " ";
text = "%name%";
};
in
{
focused = recursiveUpdate colors.selected common;
occupied = recursiveUpdate colors.active common;
urgent = recursiveUpdate (recursiveUpdate colors.active common) { background = colors.alert; };
empty = recursiveUpdate (recursiveUpdate colors.normal common) { text = "󰧟"; padding = 0; };
};
};
"module/cpu" = {
type = "internal/cpu";
format = recursiveUpdate colors.normal { text = " <label>"; };
interval = 2;
label = "%percentage-sum%%";
ramp-load = ramp;
};
"module/date" = {
type = "internal/date";
date = {
alt = "%Y-%m-%d";
text = "%a %d/%m/%y";
};
interval = "1";
label = "%date% %time%";
time = {
alt = "%H:%M:%S";
text = "%H:%M";
};
format = colors.normal;
};
"module/memory" = {
type = "internal/memory";
format = recursiveUpdate colors.normal { text = " <label>"; };
interval = 2;
label = "%percentage_used%%";
ramp-used = ramp;
};
"module/pulseaudio" = {
interval = 2;
bar.volume = {
empty = { text = ""; };
fill = { text = ""; };
indicator = { text = "|"; };
width = "10";
foreground = [
colors.green
colors.green
colors.green
colors.green
colors.green
colors.yellow
colors.orange
colors.red
];
};
click.right = "${pgrep} pavucontrol && ${pkill} pavucontrol || ${pavucontrol}";
format = {
padding = 1;
muted = colors.active;
volume = recursiveUpdate colors.normal { text = "<ramp-volume> <label-volume>"; };
};
label.muted.text = " muted";
label.volume.text = "%percentage%%";
ramp.volume = [ "" "奔" "" ];
type = "internal/pulseaudio";
};
"module/temperature" = {
format = recursiveUpdate colors.normal {
text = "<ramp> <label>";
warn = {
text = "<ramp> <label-warn>";
underline = colors.alert;
};
};
hwmon.path = "/sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input";
label = {
text = "%temperature-c%";
warn = "%temperature-c%";
};
ramp.text = [ "" "" "" "" "" ];
thermal.zone = "0";
type = "internal/temperature";
warn.temperature = "90";
};
"module/powermenu" = {
type = "custom/menu";
expand.right = true;
format = {
spacing = 1;
suffix = " ";
};
label = {
open = recursiveUpdate colors.normal { text = " "; };
close = recursiveUpdate colors.normal { text = "Cancel"; };
separator = { text = "|"; };
};
menu = [
[
({ text = "Logout"; exec = "#powermenu.open.1"; })
({ text = "Reboot"; exec = "#powermenu.open.2"; })
({ text = "Hibernate"; exec = "#powermenu.open.3"; })
({ text = "Power off"; exec = "#powermenu.open.4"; })
]
[
({ text = "Logout"; exec = logout; })
]
[
({ text = "Reboot"; exec = "${systemctl} reboot"; })
]
[
({ text = "Hibernate"; exec = "${systemctl} hibernate"; })
]
[
({ text = "Power off"; exec = "${shutdown} now"; })
]
];
};
"module/player" = {
type = "custom/script";
format = recursiveUpdate colors.normal { padding = 0; };
exec = playerStatus;
click.left = "${playerCtl} play-pause";
scroll = {
up = "${playerCtl} previous";
down = "${playerCtl} next";
};
interval = 1;
};
};
};
}

47
hm_modules/pro_audio.nix Normal file
View file

@ -0,0 +1,47 @@
{ pkgs, ... }:
let
variables = {
DSSI_PATH = "$HOME/.dssi:$NIX_USER_PROFILE_DIR/home-manager/home-path/lib/dssi:/run/current-system/sw/lib/dssi";
LADSPA_PATH = "$HOME/.ladspa:$NIX_USER_PROFILE_DIR/home-manager/home-path/lib/ladspa:/run/current-system/sw/lib/ladspa";
LV2_PATH = "$HOME/.lv2:$NIX_USER_PROFILE_DIR/home-manager/home-path/lib/lv2:/run/current-system/sw/lib/lv2";
LXVST_PATH = "$HOME/.lxvst:$NIX_USER_PROFILE_DIR/home-manager/home-path/lib/lxvst:/run/current-system/sw/lib/lxvst";
VST_PATH = "$HOME/.vst:$NIX_USER_PROFILE_DIR/home-manager/home-path/lib/vst:/run/current-system/sw/lib/vst";
VST3_PATH = "$HOME/.vst3:$NIX_USER_PROFILE_DIR/home-manager/home-path/lib/vst3:/run/current-system/sw/lib/vst3";
};
in
{
home.packages = with pkgs; [
carla
rnnoise
ardour
unstable.zrythm
unstable.breeze-icons
mixxx
# Plugins
# artyFX
autotalent
boops
unstable.cardinal
geonkick
helm
lsp-plugins
# noise-repellent
samplv1
# speech-denoiser
# stochas
# sunvox
# surge
unstable.giada
unstable.surge-XT
talentedhack
tunefish
vocproc
x42-plugins
zita-at1
zynaddsubfx
zyn-fusion
];
home.sessionVariables = variables;
}

8
hm_modules/pycharm.nix Normal file
View file

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
jetbrains.pycharm-professional
python3
# pypy3
];
}

10
hm_modules/python.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs, ... }: {
home.packages = with pkgs; [
black
] ++ (with pkgs.python3Packages; [
python-lsp-server
# pyls-black # not updated to the new pylsp
pyls-flake8
pyls-isort
]);
}

15
hm_modules/rofi.nix Normal file
View file

@ -0,0 +1,15 @@
{ pkgs, ... }: {
programs.rofi = {
enable = true;
location = "center";
font = "${pkgs.rice.font.monospace.name} ${toString pkgs.rice.font.monospace.size}";
extraConfig = {
modi = "drun,run,ssh,window";
};
terminal = "kitty";
theme = "onedark";
};
xdg.configFile."rofi/nord.rasi".source = ../configs/rofi/nord.rasi;
xdg.configFile."rofi/onedark.rasi".source = ../configs/rofi/onedark.rasi;
}

11
hm_modules/rofimoji.nix Normal file
View file

@ -0,0 +1,11 @@
{ pkgs, ... }:
{
home.packages = [
pkgs.rofimoji
];
xdg.configFile."rofimoji.rc".text = ''
action=copy
skin-tone=light
'';
}

10
hm_modules/rust.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
bacon
cargo
clippy
rust-analyzer
rustfmt
];
}

View file

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
services.screen-locker = {
enable = false;
lockCmd = "${pkgs.lockscreen}";
inactiveInterval = 10; # miutes
};
}

21
hm_modules/security.nix Normal file
View file

@ -0,0 +1,21 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
# RECOGNITION
nmap
# WEB
# altair
# burpsuite
httpie
# REVERSING
bintools
ghidra-bin
radare2
# cutter
# INFRASTRUCTURE
cocktail-bar-cli
];
}

View file

@ -0,0 +1,18 @@
{
home.shellAliases = {
"dkc" = "docker-compose";
"dk" = "docker";
"hm" = "home-manager";
"jc" = "sudo journalctl";
"jcu" = "journalctl --user";
"nf" = "find /nix/store/ -maxdepth 1 | grep";
"nr" = "nix run";
"nR" = "nix repl";
"ns" = "nix search nixpkgs";
"nS" = "nix shell";
"sc" = "sudo systemctl";
"scu" = "systemctl --user";
};
# programs.bash = { inherit shellAliases; };
# programs.zsh = { inherit shellAliases; };
}

9
hm_modules/ssh.nix Normal file
View file

@ -0,0 +1,9 @@
{
programs.ssh = {
enable = true;
compression = true;
matchBlocks = {
"*" = { identityFile = "~/.ssh/id_ed25519"; };
};
};
}

19
hm_modules/starship.nix Normal file
View file

@ -0,0 +1,19 @@
{
programs.starship = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
settings = {
directory.truncation_symbol = "/";
hostname.format = "[$hostname]($style) ";
line_break.disabled = true;
nix_shell.symbol = " ";
python.python_binary = "python3";
status = {
disabled = false;
format = "[$symbol $status]($style) ";
};
username.format = "[$user]($style)@";
};
};
}

62
hm_modules/sxhkd.nix Normal file
View file

@ -0,0 +1,62 @@
{ pkgs, ... }:
{
imports = [ ./nautilus.nix ];
home.packages = with pkgs; [
unstable.kitty
lockscreen
pamixer
playerctl
terminator
update-background
xorg.xbacklight
gnome.gnome-screenshot
];
services.sxhkd =
let
primaryTerminal = "kitty";
secondaryTerminal = "terminator";
fileManager = "nautilus";
emojiChooser = "rofimoji --skin-tone light -a copy";
in
{
enable = true;
keybindings = {
"super + b" = "update-background";
"super + alt + {h,j,k,l}" = "bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}";
"super + alt + p" = "autorandr -c";
"super + alt + {q,r}" = "bspc {quit,wm -r}";
"super + alt + shift + {h,j,k,l}" = "bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}";
"super + alt + m" = "lockscreen";
"super + bracket{left,right}" = "bspc desktop -f {prev,next}.local";
"super + ctrl + {1-9}" = "bspc node -o 0.{1-9}";
"super + ctrl + {h,j,k,l}" = "bspc node -p {west,south,north,east}";
"super + ctrl + {m,x,y,z}" = "bspc node -g {marked,locked,sticky,private}";
"super + ctrl + shift + space" = "bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel";
"super + ctrl + space" = "bspc node -p cancel";
"super + e" = fileManager;
"super + shift + e" = emojiChooser;
"super + Escape" = "pkill -USR1 -x sxhkd";
"super + g" = "bspc node -s biggest";
"super + {grave,Tab}" = "bspc {node,desktop} -f last";
"super + {Left,Down,Up,Right}" = "bspc node -v {-20 0,0 20,0 -20,20 0}";
"super + m" = "bspc desktop -l next";
"super + {o,i}" = "bspc wm -h off;bspc node {older,newer} -f;bspc wm -h on";
"super + {p,b,comma,period}" = "bspc node -f @{parent,brother,first,second}";
"super + {_,shift + } Return" = "{${primaryTerminal} , ${secondaryTerminal}}";
"super + {_,shift + }{1-9,0}" = "bspc {desktop -f,node -d} 'focused:^{1-9,10}'";
"super + {_,shift + }c" = "bspc node -f {next,prev}.local";
"super + {h,j,k,l}" = "dir={west,south,north,east}; bspc node -f $dir || bspc monitor -f $dir";
"super + shift + {h,j,k,l}" = ''dir={west,south,north,east}; bspc node -s "$dir.local" --follow || bspc node -m "$dir" --follow'';
"super + {_,shift + }w" = "bspc node -{c,k}";
"super + {_,shift + }@space " = "rofi -show {drun,run}";
"alt + Tab" = "rofi -show window";
"super + {t,shift + t,s,f}" = "bspc node -t {tiled,pseudo_tiled,floating,fullscreen}";
"super + y" = "bspc node newest.marked.local -n newest.!automatic.local";
"{XF86AudioLowerVolume,XF86AudioMute,XF86AudioRaiseVolume}" = "pamixer {-d 2 -u,-t,-i 2 -u} && dunstify -r 1 Volume `pamixer --get-volume-human`";
"XF86Audio{Next,Play,Prev}" = "playerctl {next,play-pause,previous}";
"super + alt + {Right,Down,Left}" = "playerctl {next,play-pause,previous}";
"XF86MonBrightness{Up,Down}" = "xbacklight {+,-}10%";
"Print" = "gnome-screenshot -i";
};
};
}

5
hm_modules/syncthing.nix Normal file
View file

@ -0,0 +1,5 @@
{
services.syncthing = {
enable = true;
};
}

59
hm_modules/terminator.nix Normal file
View file

@ -0,0 +1,59 @@
{ pkgs, ... }:
let
strPalette = pkgs.lib.rice.palette.toRgbHex rec {
inherit (pkgs.rice.colorPalette) normal bright dark;
background = normal.black;
foreground = normal.white;
};
opacity = toString pkgs.rice.opacity;
font = pkgs.rice.font.monospace;
colorString = with strPalette; normal: bright: builtins.concatStringsSep ":" [ normal.black normal.red normal.green normal.yellow normal.blue normal.magenta normal.cyan normal.white bright.black bright.red bright.green bright.yellow bright.blue bright.magenta bright.cyan bright.white ];
in
{
home.packages = with pkgs; [
terminator
];
xdg.configFile."terminator/config".text = with strPalette; ''
[global_config]
scroll_tabbar = True
enabled_plugins = ActivityWatch, LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
suppress_multiple_term_dialog = True
always_split_with_profile = True
[keybindings]
help = None
[profiles]
[[default]]
visible_bell = True
background_color = "${background}"
background_darkness = ${opacity}
background_type = transparent
cursor_color = "${foreground}"
font = ${font.name} weight=450 ${toString font.size}
foreground_color = "${foreground}"
show_titlebar = False
scrollbar_position = hidden
scrollback_lines = 10000
palette = "${colorString normal bright}"
use_system_font = False
[[presentation]]
visible_bell = True
background_color = "${background}"
cursor_color = "${foreground}"
font = ${font.name} weight=450 20
foreground_color = "${foreground}"
show_titlebar = False
palette = "${colorString normal bright}"
use_system_font = False
[layouts]
[[default]]
[[[child1]]]
parent = window0
type = Terminal
profile = default
[[[window0]]]
parent = ""
type = Window
[plugins]
'';
}

8
hm_modules/thunar.nix Normal file
View file

@ -0,0 +1,8 @@
{ pkgs, ... }:
{
home.packages = with pkgs.xfce; [
thunar
tumbler
xfconf
];
}

16
hm_modules/tmux.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs, ... }:
{
programs.tmux = {
enable = true;
clock24 = true;
escapeTime = 25;
terminal = "screen-256color";
plugins = with pkgs.tmuxPlugins; [
nord
prefix-highlight
];
extraConfig = ''
set -g mouse on
'';
};
}

View file

@ -0,0 +1,30 @@
{ pkgs, ... }:
let
update_time = "10m";
in
{
home.packages = [ pkgs.update-background ];
systemd.user.services."update-background" = {
Unit = {
Description = "Set random desktop background using feh";
After = [ "graphical-session.pre.target" ];
PartOf = [ "graphical-session.target" ];
RequiresMountsFor = [ "/home/bertof/Immagini" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
Type = "oneshot";
IOSchedulingClass = "idle";
ExecStart = "${pkgs.update-background}/bin/update-background";
};
};
systemd.user.timers."update-background" = {
Unit = { Description = "Set random desktop background using feh"; };
Timer = { OnUnitActiveSec = update_time; };
Install = { WantedBy = [ "timers.target" ]; };
};
}

32
hm_modules/webapp.nix Normal file
View file

@ -0,0 +1,32 @@
{ pkgs, lib, ... }:
# Categories: https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry
let
cmd = link: "google-chrome-stable --app=${link}";
links = [
{ desktopName = "Google Calendar"; link = "https://google.com/calendar"; categories = [ "Office" ]; }
{ desktopName = "Google Keep"; link = "https://keep.google.com"; categories = [ "Office" ]; }
{ desktopName = "Monkeytype"; link = "https://monkeytype.com/"; }
{ desktopName = "Netflix"; link = "https://www.netflix.com"; categories = [ "AudioVideo" ]; }
{ desktopName = "Notion"; link = "https://notion.so"; categories = [ "Office" ]; }
{ desktopName = "Prime Video"; link = "https://primevideo.com"; categories = [ "AudioVideo" ]; }
{ desktopName = "Protonmail"; link = "https://mail.protonmail.com"; categories = [ "Office" ]; }
{ desktopName = "Twitch"; link = "https://www.twitch.tv"; categories = [ "AudioVideo" ]; }
{ desktopName = "WhatsApp"; link = "https://web.whatsapp.com/"; }
{ desktopName = "YouTube"; link = "https://www.youtube.com"; categories = [ "AudioVideo" ]; }
{ desktopName = "Plex"; link = "https://app.plex.tv"; categories = [ "AudioVideo" ]; }
];
webAppBuilder =
{ desktopName
, name ? builtins.replaceStrings [ " " ] [ "_" ] desktopName
, link
, icon ? lib.toLower name
, comment ? null
, categories ? [ "Network" ]
}: pkgs.makeDesktopItem {
inherit name icon desktopName comment categories;
exec = cmd link;
};
in
{
home.packages = map webAppBuilder links;
}

33
hm_modules/xidlehook.nix Normal file
View file

@ -0,0 +1,33 @@
{ pkgs, lib, ... }:
with lib;
let
xscreensaverCmd = "${pkgs.xscreensaver}/bin/xscreensaver-command -activate";
lockCmd = "${pkgs.lockscreen}/bin/lockscreen";
in
{
services.xidlehook = {
enable = true;
# not-when-audio = false;
not-when-fullscreen = true;
timers = [
{
command = lockCmd;
delay = 300;
}
{
command = xscreensaverCmd;
delay = 120;
}
];
};
services.xscreensaver = {
enable = true;
settings = {
mode = "blank";
fadeTicks = 20;
lock = false;
};
};
}

20
hm_modules/zathura.nix Normal file
View file

@ -0,0 +1,20 @@
{ pkgs, ... }:
let
strPalette = pkgs.lib.rice.palette.toRgbHex pkgs.rice.colorPalette;
in
{
programs.zathura = {
enable = true;
options = {
completion-bg = strPalette.bright.black;
default-bg = strPalette.normal.black;
font = "${pkgs.rice.font.normal.name} 10";
inputbar-bg = strPalette.bright.black;
inputbar-fg = strPalette.normal.cyan;
page-padding = 10;
recolor-lightcolor = strPalette.dark.cyan;
statusbar-bg = strPalette.bright.black;
selection-clipboard = "clipboard";
};
};
}

7
hm_modules/zoxide.nix Normal file
View file

@ -0,0 +1,7 @@
{
programs.zoxide = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
}

38
hm_modules/zsh.nix Normal file
View file

@ -0,0 +1,38 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
nix-zsh-completions
zsh-completions
];
programs.zsh = {
enable = true;
autocd = true;
plugins = [ ];
initExtraBeforeCompInit = ''
zstyle ':completion:*' menu select
setopt CORRECT
setopt AUTO_CD
setopt CHASE_LINKS
setopt PUSHD_TO_HOME
'';
oh-my-zsh = {
enable = true;
plugins = [
"common-aliases"
"cp"
"dirhistory"
"git-auto-fetch"
"git"
"sudo"
];
extraConfig = "";
};
# prezto = {
# enable = true;
# };
};
}