--wip-- [skip ci]

This commit is contained in:
Filippo Berto 2025-09-08 11:36:45 +02:00
parent eea02abfcb
commit 762085707c
136 changed files with 261 additions and 261 deletions

60
hm/modules/alacritty.nix Normal file
View file

@ -0,0 +1,60 @@
{ nixosConfig, ... }:
with nixosConfig.nix-rice.lib;
let
inherit (nixosConfig.nix-rice) rice;
strPalette = palette.toRgbHex rec {
inherit (rice.colorPalette) normal bright primary;
dim = rice.colorPalette.dark;
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 = [ rice.font.monospace.package ];
programs.alacritty = {
enable = true;
settings = {
key_bindings = [
{
key = "Return";
mods = "Control|Shift";
action = "SpawnNewInstance";
}
];
# env.TERM = "xterm-256color";
env = {
TERM = "alacritty";
WINIT_X11_SCALE_FACTOR = "1";
};
scrolling.history = 3000;
font = {
normal.family = rice.font.monospace.name;
inherit (rice.font.monospace) size;
};
window.opacity = rice.opacity;
mouse = {
# hide_when_typing = true;
hints.modifiers = "Control";
};
colors = strPalette // {
selection.text = "CellForeground";
search.matches.foreground = "CellForeground";
};
};
};
}

137
hm/modules/autorandr.nix Normal file
View file

@ -0,0 +1,137 @@
{
programs.autorandr = {
enable = true;
profiles =
let
dell-laptop = {
dpi = 96;
fingerprint = "00ffffffffffff0030e43f0500000000001a010495221378eaa1c59459578f27205054000000010101010101010101010101010101012e3680a070381f403020350058c21000001a5c2b80a070381f403020350058c21000001a000000fe0034584b3133803135365746360a000000000000413196001000000a010a202000c5";
mode = "1920x1080";
};
schermo_lab_dp = {
dpi = 96;
fingerprint = "00ffffffffffff0010ac73404c47334428160104a5331d783bdd45a3554fa027125054a54b00714f8180d1c001010101010101010101023a801871382d40582c4500fe1f1100001e000000ff004b463837593241364433474c0a000000fc0044454c4c205532333132484d0a000000fd00384c1e5311000a2020202020200096";
mode = "1920x1080";
};
lab_screen = {
dpi = 96;
fingerprint = "00ffffffffffff0010acd3a14246313216200104a53b21783be755a9544aa1260d5054a54b00714f8180a9c0d1c00101010101010101565e00a0a0a029503020350055502100001a000000ff00435958564744330a2020202020000000fc0044454c4c20533237323244430a000000fd00304b72723c010a20202020202001d9020325f14f101f051404131211030216150706012309070783010000681a00000101304b007e3900a080381f4030203a0055502100001a023a801871382d40582c450055502100001ed97600a0a0a034503020350055502100001a00000000000000000000000000000000000000000000000000000000000000000000000092";
mode = "2560x1440";
};
in
{
odin-nvidia = {
fingerprint = {
"eDP-1-1" = dell-laptop.fingerprint;
};
config = {
"eDP-1-1" = {
inherit (dell-laptop) mode dpi;
primary = true;
};
};
};
odin-intel = {
fingerprint = {
"eDP1" = dell-laptop.fingerprint;
};
config = {
"eDP1" = {
inherit (dell-laptop) mode dpi;
primary = true;
};
};
};
odin-intel-lab-dock = {
fingerprint = {
"DP1-2" = schermo_lab_dp.fingerprint;
"eDP1" = dell-laptop.fingerprint;
};
config = {
"DP1-2" = {
inherit (schermo_lab_dp) mode dpi;
primary = true;
};
"eDP1" = {
inherit (dell-laptop) mode dpi;
position = "0x1080";
};
};
};
odin-nvidia-lab-dock = {
fingerprint = {
"DP-1-1-2" = schermo_lab_dp.fingerprint;
"eDP-1-1" = dell-laptop.fingerprint;
};
config = {
"DP-1-1-2" = {
inherit (schermo_lab_dp) mode dpi;
primary = true;
};
"eDP-1-1" = {
inherit (dell-laptop) mode dpi;
position = "0x1080";
};
};
};
odin-intel-lab-screen = {
fingerprint = {
"DP1" = lab_screen.fingerprint;
"eDP1" = dell-laptop.fingerprint;
};
config = {
"DP1" = {
inherit (lab_screen) mode dpi;
primary = true;
};
"eDP1" = {
inherit (dell-laptop) mode dpi;
position = "320x1440";
};
};
};
odin-nvidia-lab-screen = {
fingerprint = {
"DP-1-1" = lab_screen.fingerprint;
"eDP-1-1" = dell-laptop.fingerprint;
};
config = {
"DP-1-1" = {
inherit (lab_screen) mode dpi;
primary = true;
};
"eDP-1-1" = {
inherit (dell-laptop) mode dpi;
position = "320x1440";
};
};
};
thor-default = {
fingerprint = {
"DP-3" = "00ffffffffffff001e6d7f5ba1c60a00011f0104b53c22789f8cb5af4f43ab260e5054254b007140818081c0a9c0b300d1c08100d1cf09ec00a0a0a0675030203a0055502100001a000000fd0030901ee63c000a202020202020000000fc004c4720554c545241474541520a000000ff003130314e5454514c533230390a017102031a7123090607e305c000e606050160592846100403011f136fc200a0a0a0555030203a0055502100001a565e00a0a0a029503020350055502100001a5aa000a0a0a0465030203a005550210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000da";
"HDMI-0" = "00ffffffffffff004c2d2c0d443650302e19010380341d782a5295a556549d250e5054bb8c00b30081c0810081809500a9c001010101023a801871382d40582c450009252100001e000000fd0030481e5216000a202020202020000000fc00433234463339300a2020202020000000ff00485451483330353636370a20200163020324f14690041f131203230907078301000067030c001000802b681a00000101304800011d00bc52d01e20b828554009252100001e8c0ad090204031200c4055000925210000188c0ad08a20e02d10103e9600092521000018215280a07238304088c8350009252100001c00000000000000000000000000000000000000fa";
};
config = {
"DP-3" = {
mode = "2560x1440";
position = "1080x346";
primary = true;
dpi = 96;
};
"HDMI-0" = {
mode = "1920x1080";
position = "0x0";
rotate = "right";
dpi = 96;
};
};
};
};
};
}

13
hm/modules/bash.nix Normal file
View file

@ -0,0 +1,13 @@
{
programs.bash = {
enable = true;
enableVteIntegration = true;
shellAliases = {
".." = "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";
};
};
}

7
hm/modules/biblio.nix Normal file
View file

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
home.packages = builtins.attrValues {
# inherit (pkgs) calibre;
inherit (pkgs) mangal;
};
}

14
hm/modules/bitwarden.nix Normal file
View file

@ -0,0 +1,14 @@
{ pkgs
, config
, lib
, ...
}:
{
home.packages =
[ pkgs.bitwarden ]
++ lib.optionals config.programs.rofi.enable (
builtins.attrValues {
# inherit (pkgs.unstable_pkgs) rbw rofi-rbw pinentry-gtk2;
}
);
}

4
hm/modules/blender.nix Normal file
View file

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

View file

@ -0,0 +1,4 @@
{ pkgs, ... }:
{
home.packages = [ (pkgs.blender.override { cudaSupport = true; }) ];
}

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 = [ 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;
};
}

8
hm/modules/carapace.nix Normal file
View file

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

30
hm/modules/cava.nix Normal file
View file

@ -0,0 +1,30 @@
{ pkgs, lib, nixosConfig, ... }:
with nixosConfig.nix-rice.lib;
let
strPalette = palette.toRgbHex nixosConfig.nix-rice.rice.colorPalette;
fmtString = str: "'${str}'";
in
{
home.packages = [ pkgs.cava ];
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,25 @@
{ pkgs, ... }: {
imports = [
./minimal.nix
../direnv.nix
../fzf.nix
../info.nix
../man.nix
../starship.nix
../tmux.nix
../yazi.nix
];
home = {
language.base = "it_IT.UTF-8";
packages = builtins.attrValues {
inherit (pkgs)
fastfetch
pv
;
};
};
}

View file

@ -0,0 +1,43 @@
{ pkgs, ... }: {
imports = [
../configurations.nix
../bash.nix
../bottom.nix
../git.nix
../gpg.nix
../keychain.nix
../lsd.nix
../shell_aliases.nix
../ssh.nix
../zellij.nix
../zoxide.nix
../zsh.nix
];
home = {
language.base = "it_IT.UTF-8";
packages = builtins.attrValues {
inherit (pkgs)
fastfetch
file
unrar
unzip
wget
zip
;
};
};
programs = {
ripgrep.enable = true;
fd = { enable = true; hidden = true; };
};
services.home-manager.autoExpire = {
enable = true;
frequency = "daily";
timestamp = "-7 days";
};
}

View file

@ -0,0 +1,19 @@
{
editorconfig = {
enable = true;
settings = {
"*" = {
charset = "utf-8";
end_of_line = "lf";
indent_size = "2";
# max_line_width = "120";
indent_style = "space";
trim_trailing_whitespace = "true";
insert_final_newline = "true";
};
"*.py" = {
indent_size = 4;
};
};
};
}

View file

@ -0,0 +1,15 @@
{ pkgs
, config
, lib
, ...
}:
{
home.packages =
lib.optionals config.programs.helix.enable
(
builtins.attrValues { inherit (pkgs) clang-tools cmake-language-server; }
)
++ lib.optionals config.programs.kakoune.enable (
builtins.attrValues { inherit (pkgs) clang-tools cmake-language-server; }
);
}

View file

@ -0,0 +1,21 @@
{ config
, pkgs
, lib
, ...
}:
{
home.packages =
lib.optionals config.programs.helix.enable
(
builtins.attrValues {
inherit (pkgs) yaml-language-server taplo-cli;
inherit (pkgs.nodePackages) vscode-langservers-extracted;
}
)
++ lib.optionals config.programs.kakoune.enable (
builtins.attrValues {
inherit (pkgs) yaml-language-server;
inherit (pkgs.nodePackages) vscode-langservers-extracted;
}
);
}

View file

@ -0,0 +1,4 @@
{ pkgs, ... }:
{
home.packages = builtins.attrValues { inherit (pkgs.jetbrains) datagrip jdk; };
}

View file

@ -0,0 +1,22 @@
{ pkgs
, config
, lib
, ...
}:
{
home.packages =
# (builtins.attrValues { inherit (pkgs) docker-compose; })
# ++
lib.optionals config.programs.helix.enable (
builtins.attrValues {
inherit (pkgs.nodePackages) dockerfile-language-server-nodejs;
inherit (pkgs) docker-compose-language-service;
}
);
# home.shellAliases = {
# "dkcd" = "docker-compose down";
# "dkc" = "docker-compose";
# "dkcu" = "docker-compose up";
# "dk" = "docker";
# };
}

View file

@ -0,0 +1,16 @@
{ pkgs
, lib
, config
, ...
}:
{
programs.go = {
enable = true;
goPath = ".go";
};
home.packages =
(lib.optionals config.programs.helix.enable [ pkgs.gopls ])
++ (lib.optionals config.programs.neovim.enable [ pkgs.gopls ])
++ (lib.optionals config.programs.kakoune.enable [ pkgs.gopls ]);
}

View file

@ -0,0 +1,16 @@
{ pkgs
, lib
, config
, ...
}:
{
home.packages =
lib.optionals config.programs.helix.enable
(
builtins.attrValues { inherit (pkgs.nodePackages) typescript-language-server; }
)
++ lib.optionals config.programs.kakoune.enable (
builtins.attrValues { inherit (pkgs.nodePackages) typescript-language-server; }
);
programs.neovim.withNodeJs = true;
}

View file

@ -0,0 +1,28 @@
{ pkgs, ... }:
let
helm = pkgs.wrapHelm pkgs.kubernetes-helm {
plugins = builtins.attrValues {
inherit (pkgs.kubernetes-helmPlugins)
helm-diff
# helm-secrets
;
};
};
in
{
home = {
shellAliases = {
"k" = "kubectl";
};
packages = [
# pkgs.kustomize
# pkgs.lens
helm
pkgs.awscli2
pkgs.k9s
pkgs.kubectl
pkgs.kubelogin-oidc
pkgs.kubevirt
];
};
}

View file

@ -0,0 +1,27 @@
{ pkgs
, config
, lib
, ...
}:
{
home.packages = [
# pkgs.bibtool
# pkgs.texlive.combined.scheme-full
pkgs.zathura
]
++ lib.optionals config.programs.helix.enable [
# pkgs.texlab
]
++ lib.optionals config.programs.kakoune.enable [
# pkgs.texlab
# pkgs.aspellDicts.en
# pkgs.aspellDicts.en-computers
# pkgs.aspellDicts.en-science
# pkgs.aspellDicts.it
];
home.file.".latexmkrc".text = ''
$pdf_previewer = 'zathura %O %S';
$pdf_update_method = 2
'';
}

View file

@ -0,0 +1,16 @@
{ pkgs
, lib
, config
, ...
}:
let tomlGenerate = (pkgs.formats.toml { }).generate "bottom-toml"; in {
home.packages = lib.optionals config.programs.helix.enable [
# pkgs.marksman
pkgs.markdown-oxide
];
xdg.configFile."moxide/settings.toml".source = tomlGenerate {
dailynote = "%Y-%m-%d";
new_file_folder_path = "pages/";
daily_notes_folder = "journals/";
};
}

View file

@ -0,0 +1,20 @@
{ pkgs
, config
, lib
, ...
}:
{
home.packages =
(builtins.attrValues {
inherit (pkgs)
# nixpkgs-review
nix-prefetch-scripts
nix-tree
nixfmt-classic
nixpkgs-fmt
;
})
++ lib.optionals config.programs.helix.enable [ pkgs.nil ]
++ lib.optionals config.programs.kakoune.enable [ pkgs.rnix-lsp ];
programs.neovim.plugins = [ pkgs.vimPlugins.vim-nix ];
}

View file

@ -0,0 +1,26 @@
{ pkgs
, lib
, config
, ...
}:
let
py = pkgs.python3;
pyPkgs = py.pkgs;
in
{
home.packages =
[
py
# pyPkgs.black
pkgs.ruff
]
++ lib.optionals config.programs.helix.enable (
(builtins.attrValues { inherit (pyPkgs) python-lsp-server pyls-flake8 pyls-isort; })
++ pyPkgs.python-lsp-server.optional-dependencies.all
)
++ lib.optionals config.programs.kakoune.enable (
(builtins.attrValues { inherit (pyPkgs) python-lsp-server pyls-flake8 pyls-isort; })
++ pyPkgs.python-lsp-server.optional-dependencies.all
);
}

View file

@ -0,0 +1,64 @@
{ pkgs
, lib
, config
, ...
}:
let
tomlGenerate = (pkgs.formats.toml { }).generate;
in
{
home.packages =
(builtins.attrValues {
inherit (pkgs)
bacon
cargo
cargo-audit
cargo-criterion
cargo-deadlinks
cargo-expand
cargo-flamegraph
cargo-fuzz
cargo-hack
cargo-hakari
cargo-modules
cargo-outdated
cargo-profiler
cargo-release
cargo-show-asm
cargo-spellcheck
cargo-tarpaulin
cargo-udeps
cargo-watch
cargo-workspaces
clippy
critcmp
rustc
rustfmt
;
# cargo-about
# cargo-auditable
# cargo-deny
# cargo-deps
# cargo-feature
})
++ lib.optionals config.programs.helix.enable (
builtins.attrValues {
inherit (pkgs)
# lldb
rust-analyzer;
}
)
++ lib.optionals config.programs.kakoune.enable (
builtins.attrValues { inherit (pkgs) rust-analyzer; }
);
home.file.".cargo/config.toml".source = tomlGenerate "cargo-config" {
build.rustc-wrapper = "${pkgs.sccache}/bin/sccache";
};
xdg.configFile."cargo-release/release.toml".source = tomlGenerate "release.toml" {
sign-commit = true;
sign-tag = true;
publish = false;
};
}

View file

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

7
hm/modules/dircolors.nix Normal file
View file

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

9
hm/modules/direnv.nix Normal file
View file

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

53
hm/modules/dunst.nix Normal file
View file

@ -0,0 +1,53 @@
{ pkgs, nixosConfig, ... }:
with nixosConfig.nix-rice.lib;
let
inherit (nixosConfig.nix-rice) rice;
strPalette = palette.toRGBHex rice.colorPalette;
in
{
home.packages = builtins.attrValues {
inherit (pkgs) dunst;
inherit (rice.font.normal) package;
};
services.dunst = {
enable = true;
iconTheme = { package = pkgs.qogir-icon-theme; name = "Qogir"; };
settings = {
global = {
browser = "${pkgs.xdg-utils}/bin/xdg-open";
corner_radius = 10;
dmenu = "${pkgs.rofi}/bin/rofi -dmenu -p dunst:";
follow = "keyboard";
font = "${rice.font.normal.name} 10";
frame_color = strPalette.normal.blue;
frame_width = 1;
height = 320;
mouse_middle_click = "context";
notification_limit = 10;
offset = "7x7";
separator_color = strPalette.normal.blue;
transparency = 100 - nix-rice.float.round (rice.opacity * 100);
width = "(0, 320)";
};
urgency_low = {
inherit (strPalette) background foreground;
timeout = 10;
};
urgency_normal = {
inherit (strPalette) background foreground;
timeout = 10;
};
urgency_critical = {
inherit (strPalette) background foreground;
frame_color = strPalette.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,13 @@
{ pkgs, ... }:
let
dfp = pkgs.dwarf-fortress-packages;
package = dfp.dwarf-fortress-full.override {
# theme = dfp.themes.ironhand;
# theme = dfp.themes.vettlingr;
enableIntro = false;
enableFPS = true;
};
in
{
home.packages = [ package ];
}

View file

@ -0,0 +1,5 @@
{ pkgs, ... }:
{
home.packages = [ pkgs.easyeffects ];
services.easyeffects.enable = true;
}

7
hm/modules/eza.nix Normal file
View file

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

11
hm/modules/firefox.nix Normal file
View file

@ -0,0 +1,11 @@
{
programs.firefox = {
enable = true;
# profiles.default = {
# settings = {
# # "gfx.webrender.all" = true;
# "browser.altClickSave" = true;
# };
# };
};
}

15
hm/modules/fonts.nix Normal file
View file

@ -0,0 +1,15 @@
{ pkgs, ... }:
{
fonts.fontconfig.enable = true;
home.packages = builtins.attrValues {
inherit (pkgs)
dejavu_fonts
noto-fonts
noto-fonts-extra
noto-fonts-cjk-sans
font-awesome
corefonts# Microsoft fonts
vistafonts
;
};
}

68
hm/modules/foot.nix Normal file
View file

@ -0,0 +1,68 @@
{ nixosConfig, ... }:
with nixosConfig.nix-rice.lib;
let
inherit (nixosConfig.nix-rice) rice;
strPalette = palette.toRGBShortHex {
inherit (rice.colorPalette)
background
foreground
color0
color1
color2
color3
color4
color5
color6
color7
color8
color9
color10
color11
color12
color13
color14
color15
;
};
in
{
programs.foot = {
enable = true;
# server.enable = true;
settings = {
main = {
term = "xterm-256color";
font = "${rice.font.monospace.fc}:size=${toString rice.font.monospace.size}";
dpi-aware = "yes";
};
mouse = {
hide-when-typing = "yes";
};
colors = {
alpha = rice.opacity;
inherit (strPalette) background foreground;
# Normal/regular colors (color palette 0-7)
regular0 = strPalette.color0; # black
regular1 = strPalette.color1; # red
regular2 = strPalette.color2; # green
regular3 = strPalette.color3; # yellow
regular4 = strPalette.color4; # blue
regular5 = strPalette.color5; # magenta
regular6 = strPalette.color6; # cyan
regular7 = strPalette.color7; # white
## Bright colors (color palette 8-15)
bright0 = strPalette.color8; # bright black
bright1 = strPalette.color9; # bright red
bright2 = strPalette.color10; # bright green
bright3 = strPalette.color11; # bright yellow
bright4 = strPalette.color12; # bright blue
bright5 = strPalette.color13; # bright magenta
bright6 = strPalette.color14; # bright cyan
bright7 = strPalette.color15; # bright white
};
};
};
}

8
hm/modules/fzf.nix Normal file
View file

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

155
hm/modules/git.nix Normal file
View file

@ -0,0 +1,155 @@
{ 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";
"gdtd" = "git difftool -g --dir-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-with-lease";
"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;
package = pkgs.gitFull;
userName = "Filippo Berto";
userEmail = "berto.f@protonmail.com";
# signing = {
# key = "berto.f@protonmail.com";
# signByDefault = true;
# };
extraConfig = {
"add.interactive".useBuiltin = false;
branch.sort = "-committerdate";
column.ui = "auto";
commit.gpgSign = true;
core = {
editor = "hx";
fsmonitor = true;
};
credential.helper = "libsecret";
delta = {
line-numbers = true;
navigate = true;
side-by-side = true;
wrap-max-lines = "unlimited";
};
diff = {
algorithm = "histogram";
colorMoved = "default";
guitool = "meld";
tool = "vimdiff";
};
init.defaultBranch = "main";
merge = {
conflictstyle = "diff3";
guitool = "meld";
tool = "vimdiff";
};
pull.rebase = true;
rebase = {
autoStash = true;
autoSquash = true;
};
rerere = {
enabled = true;
autoUpdate = true;
};
tag.sort = "version:refname";
user.signingKey = "berto.f@protonmail.com";
};
lfs.enable = true;
delta.enable = true;
};
bash.shellAliases = shellAliases;
zsh.shellAliases = shellAliases;
};
home.packages = builtins.attrValues {
inherit (pkgs)
gh
git-secret
glab
meld
;
};
}

View file

@ -0,0 +1,36 @@
{ pkgs, ... }:
let
gnomeExtensions = builtins.attrValues {
inherit (pkgs.gnomeExtensions)
appindicator
aylurs-widgets
babar
caffeine
dash-to-dock
dash-to-panel
# dash-to-plank
# devbar
dock-from-dash
# espresso
# focus
freon
gamemode
# git
gtile
# jiggle
just-perfection
# keyman
spotify-tray
topiconsfix
# tray-icons
tray-icons-reloaded
unite
user-themes
# vitals
;
};
in
{
home.packages = [ pkgs.gnome.gnome-tweaks ] ++ gnomeExtensions;
}

16
hm/modules/gpg.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs, ... }: {
programs.gpg = {
enable = true;
settings = { };
};
services.gpg-agent = {
enable = true;
defaultCacheTtl = 600;
enableBashIntegration = true;
enableZshIntegration = true;
enableNushellIntegration = true;
pinentry.package = pkgs.pinentry-gnome3;
# extraConfig = "allow-loopback-pinentry";
};
}

29
hm/modules/grobi.nix Normal file
View file

@ -0,0 +1,29 @@
{
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, nixosConfig, ... }:
{
gtk = {
enable = true;
font = { inherit (nixosConfig.nix-rice.rice.font.normal) name package size; };
iconTheme = {
package = pkgs.qogir-icon-theme;
name = "Qogir-dark";
};
theme = {
package = pkgs.arc-theme;
name = "Arc-Dark";
};
};
qt = {
enable = true;
platformTheme.name = "gtk";
};
home = {
pointerCursor = {
package = pkgs.qogir-icon-theme;
name = "Qogir";
# size = 64;
# x11.enable = true;
gtk.enable = true;
};
};
}

17
hm/modules/heif.nix Normal file
View file

@ -0,0 +1,17 @@
{ pkgs, ... }:
let
thumbnailer = "${pkgs.libheif.bin}/bin/heif-thumbnailer";
in
{
# home.packages = [
# pkgs.libheif.bin
# ];
xdg.dataFile."thumbnailers/heic.thumbnailer".text = ''
[Thumbnailer Entry]
TryExec=${thumbnailer}
Exec=${thumbnailer} -s %s %i %o
MimeType=image/heif;image/heic
'';
}

180
hm/modules/helix.nix Normal file
View file

@ -0,0 +1,180 @@
{ pkgs, ... }:
{
home = {
sessionVariables = {
EDITOR = "hx";
VISUAL = "hx";
};
shellAliases = {
x = "hx";
};
packages = builtins.attrValues {
inherit (pkgs) nil; # Nix language server
# inherit desktopItem;
};
};
programs.helix = {
enable = true;
languages.language = [
{
name = "nix";
auto-format = true;
}
{
name = "typst";
formatter.command = "typstyle";
auto-format = true;
}
{
name = "sql";
formatter.command = "sql-formatter";
auto-format = true;
}
];
languages.language-server = {
nil.config.nil = {
formatting.command = [ "nixpkgs-fmt" ];
autoEvalInputs = true;
};
texlab.config.texlab = {
formatterLineLength = 0;
bibtexFormatter = "latexindent";
latexindent.modifyLineBreaks = false;
# chktex.onOpenAndSave = true;
chktex.onEdit = true;
};
yaml-language-server.config.yaml = {
format.enable = true;
validation = true;
keyOrdering = false;
schemaStore.enable = true;
schemas = {
"https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json" = "*gitlab-ci*.{yml,yaml}";
"https://json.schemastore.org/ansible-playbook" = "*play*.{yml,yaml}";
"https://json.schemastore.org/ansible-stable-2.9" = "roles/tasks/*.{yml,yaml}";
"https://json.schemastore.org/chart" = "Chart.{yml,yaml}";
"https://json.schemastore.org/dependabot-v2" = ".github/dependabot.{yml,yaml}";
"https://json.schemastore.org/github-action" = ".github/action.{yml,yaml}";
"https://json.schemastore.org/github-workflow" = ".github/workflows/*";
"https://json.schemastore.org/hugo" = "hugo.yaml";
"https://json.schemastore.org/kustomization" = "kustomization.{yml,yaml}";
"https://json.schemastore.org/prettierrc" = ".prettierrc.{yml,yaml}";
"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json" = "*api*.{yml,yaml}";
"https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/jsonschema/schema.json" = "*flow*.{yml,yaml}";
"https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json" = "*docker-compose*.{yml,yaml}";
kubernetes = "*.y{a,}ml";
};
};
};
settings = {
theme = "carbonfox";
editor = {
lsp.display-messages = true;
lsp.display-inlay-hints = true;
scrolloff = 5;
soft-wrap.enable = true;
true-color = true;
indent-guides = {
render = true;
character = "";
};
};
keys =
let
macro = pkgs.writeShellScript "macro" ''
mode="$1"
shift
case "$mode" in
t)
# Block tag with newlines
echo "<xxx>"
cat
echo "</xxx>"
;;
i)
# Inline tag (no newlines)
echo -n "<xxx>"
cat
echo -n "</xxx>"
;;
*)
echo "Unknown macro mode: $mode" >&2
exit 1
;;
esac
'';
in
{
normal = {
"C-A-l" = ":format";
"A-r" = ":reload";
"C-A-r" = ":reload-all";
"L" = { "i" = "@|${macro} i<ret>sxxx<ret>c"; "t" = "@|${macro} t<ret>sxxx<ret>c"; };
"space"."l" = ":lsp-workspace-command";
};
select = {
"L" = { "i" = "@|${macro} i<ret>sxxx<ret>c"; "t" = "@|${macro} t<ret>sxxx<ret>c"; };
"space"."l" = ":lsp-workspace-command";
};
};
};
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;
};
};
};
}

View file

@ -0,0 +1,63 @@
{ pkgs
, lib
, nixosConfig
, ...
}:
{
systemd.user.services."bluetooth-keyboard" = {
Unit = {
Description = "Disable the laptop keyboard when the bluetooth keyboard is connected";
After = [ "graphical-session.target" ];
PartOf = [ "graphical-session.target" ];
};
Install.WantedBy = [ "graphical-session.target" ];
Service = {
Type = "simple";
ExecStart = pkgs.writeShellScript "bluetooth-keyboard.sh" ''
PATH=$PATH:${
lib.makeBinPath [
pkgs.coreutils
pkgs.gnugrep
pkgs.libnotify
nixosConfig.programs.hyprland.package
]
}
BLUETOOTH_DEVICE="keychron-k1-max-keyboard"
LAPTOP_DEVICE="at-translated-set-2-keyboard"
STATUS_FILE="$XDG_RUNTIME_DIR/bluetooth_keyboard.status"
enable_laptop_keyboard() {
if [[ `cat $STATUS_FILE` == "false" ]]; then
printf "true" > "$STATUS_FILE"
echo "Enabling laptop keyboard"
notify-send -u normal "Enabling laptop keyboard"
hyprctl keyword '$LAPTOP_KEYBOARD_ENABLED' true
hyprctl keyword device:a ""
fi
}
disable_laptop_keyboard() {
if [[ `cat $STATUS_FILE` == "true" ]]; then
printf "false" > "$STATUS_FILE"
echo "Disabling laptop keyboard"
notify-send -u normal "Disabling laptop keyboard"
hyprctl keyword '$LAPTOP_KEYBOARD_ENABLED' false
hyprctl keyword device:a ""
fi
}
printf "true" > "$STATUS_FILE"
while true; do
if hyprctl devices | grep --quiet $BLUETOOTH_DEVICE ; then
disable_laptop_keyboard
else
enable_laptop_keyboard
fi
sleep 5;
done
'';
};
};
}

340
hm/modules/hyprland.nix Normal file
View file

@ -0,0 +1,340 @@
{ nixosConfig, config, lib, pkgs, ... }:
with nixosConfig.nix-rice.lib;
let
strPalette = palette.toRgbaShortHex nixosConfig.nix-rice.rice.colorPalette;
inherit (nixosConfig.networking) hostName;
in
{
imports = [
# ./kitty.nix
./foot.nix
# ./nautilus.nix
./nemo.nix
./waybar.nix
# ./dunst.nix
# ./wlsunset.nix
./hyprlock.nix
# ./swayidle.nix
./swaynotificationcenter.nix
./wl_update_background.nix
./hyprland-bluetooth-keyboard.nix
];
home.packages = builtins.attrValues {
inherit (pkgs)
blueman
brightnessctl
gamescope
grimblast
hyprpaper
networkmanagerapplet
wireplumber
playerctl
sirula
# swaylock
swww
# walker
# wl-lockscreen
waybar
wl-clipboard
wl-clipedit
wlogout
wofi
wofi-emoji
wtype
;
};
services = {
network-manager-applet.enable = true;
blueman-applet.enable = true;
hypridle = {
enable = true;
settings = {
general = {
ignore_dbus_inhibit = false;
lock_cmd = "pidof hyprlock || hyprlock"; # avoid starting multiple hyprlock instances.
before_sleep_cmd = "loginctl lock-session"; # lock before suspend.
after_sleep_cmd = "hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display
};
listener = [
{
timeout = 30;
on-timeout = "brightnessctl -s -d intel_backlight s 10; brightnessctl -s -d tpacpi::kbd_backlight s 0"; # lower screen backlight
on-resume = "brightnessctl -r -d intel_backlight; brightnessctl -r -d tpacpi::kbd_backlight"; # restore screen backlight
}
{
timeout = 120;
on-timeout = "loginctl lock-session"; # lock screen
}
{
timeout = 300;
on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed
on-resume = "hyprctl dispatch dpms on;" + (lib.optionalString (hostName == "thor") "xrandr --output DP-1 --primary"); # screen on when activity is detected after timeout has fired.
}
];
};
};
hyprpaper = {
enable = true;
settings = {
preload = "${../../wallpapers/n8ca4obsys991.png}";
wallpaper = [ ",${../../wallpapers/n8ca4obsys991.png}" ];
};
};
};
systemd.user.services = {
blueman-applet.Service = { Restart = "on-failure"; RestartSec = "3s"; };
network-manager-applet.Service = { Restart = "on-failure"; RestartSec = "3s"; };
};
wayland.windowManager.hyprland = {
enable = true;
settings = {
input = {
kb_layout = if ((hostName == "thor") || (hostName == "sif")) then "us,it,us" else "it,us,us";
kb_options = "grp:menu_toggle,compose:rctrl";
kb_variant = ",,colemak";
kb_model = "";
kb_rules = "";
numlock_by_default = true;
follow_mouse = 2;
touchpad.natural_scroll = true;
};
exec = lib.lists.optionals (hostName == "thor") [
"xrandr --output DP-1 --primary"
];
exec-once = [
# "hyprpaper"
# "swww init"
];
# exec-shutdown = [ ];
env = [
"XCURSOR_SIZE,24"
];
"$LAPTOP_KEYBOARD_ENABLED" = true;
device = [
{ name = "at-translated-set-2-keyboard"; enabled = "$LAPTOP_KEYBOARD_ENABLED"; }
{ name = "keychron-k1-max-keyboard"; kb_layout = "us"; }
{ name = "keychron-k1-max-keyboard-2"; kb_layout = "us"; }
{ name = "tpps/2-synaptics-trackpoint"; sensitivity = -.3; }
];
general = {
gaps_in = 1;
gaps_out = 2;
border_size = 2;
"col.active_border" = "rgba(${strPalette.normal.yellow}) rgba(${strPalette.normal.red}) 45deg";
"col.inactive_border" = "rgba(${strPalette.bright.black})";
layout = "dwindle";
};
monitor = lib.lists.optionals (hostName == "thor") [
"DP-1,preferred,1080x200,auto"
"DP-3,preferred,1080x200,auto"
"HDMI-A-1,preferred,0x0,auto,transform,3"
] ++ lib.lists.optionals (hostName == "odin") [
"eDP-1,preferred,auto,1"
"DP-1,preferred,auto-up,1"
] ++ lib.lists.optionals (hostName == "sif") [
"DP-1,preferred,0x0,1"
"DP-3,preferred,2560x0,1"
"eDP-1,preferred,1791x1440,1.66667"
] ++ [
",preferred,auto,auto"
# "Unknown-1,disable"
];
misc.disable_hyprland_logo = true;
animations = {
enabled = true;
bezier = "myBezier, 0.05, 0.9, 0.1, 1.05";
animation = [
"windows, 1, 7, myBezier"
"windowsOut, 1, 7, default, popin 80%"
"border, 1, 10, default"
"borderangle, 1, 8, default"
"fade, 1, 7, default"
"workspaces, 1, 6, default"
];
};
dwindle = {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/
# master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
pseudotile = true;
preserve_split = true; # you probably want this
};
master = {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_status = "master";
};
gestures = {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = true;
workspace_swipe_touch = true;
};
decoration = {
rounding = 10;
blur = {
enabled = true;
size = 3;
passes = 1;
new_optimizations = true;
};
shadow = {
enabled = true;
range = 4;
render_power = 3;
color = "rgba(1a1a1aee)";
};
};
"$mod" = "SUPER";
bind = [
"SUPER_SHIFT_L, L, exec, hyprctl keyword general:layout dwindle"
"SUPER_ALT_L, L, exec, hyprctl keyword general:layout master"
"SUPER, RETURN, exec, foot"
"SUPER, W, killactive,"
"SUPER, M, exec, ${config.programs.hyprlock.package}/bin/hyprlock"
"SUPER_ALT_L, Q, exit,"
"SUPER SHIFT, B, exec, brave"
"SUPER, B, exec, firefox"
"SUPER, E, exec, nemo"
"SUPER, L, exec, ${lib.optionalString (hostName == "thor") "env -u WAYLAND_DISPLAY "} obsidian"
"SUPER, V, togglefloating,"
"SUPER, SPACE, exec, sirula"
"SUPER, F, fullscreen,"
"SUPER, P, pseudo, # dwindle"
"SUPER, J, togglesplit, # dwindle"
"SUPER ALT, E, exec, wofi-emoji"
"SUPER ALT, P, exec, wl-clipedit"
"SUPER ALT, B, exec, wl-update-background"
",Print, exec, grimblast copy"
"SHIFT, Print, exec, grimblast copy area"
# Move focus to relative position
"SUPER, left, movefocus, l"
"SUPER, right, movefocus, r"
"SUPER, up, movefocus, u"
"SUPER, down, movefocus, d"
# Move window to relative position
"SUPER_SHIFT, left, movewindow, l"
"SUPER_SHIFT, right, movewindow, r"
"SUPER_SHIFT, up, movewindow, u"
"SUPER_SHIFT, down, movewindow, d"
# Switch workspaces with mainMod + [0-9]
"SUPER, 1, workspace, 1"
"SUPER, 2, workspace, 2"
"SUPER, 3, workspace, 3"
"SUPER, 4, workspace, 4"
"SUPER, 5, workspace, 5"
"SUPER, 6, workspace, 6"
"SUPER, 7, workspace, 7"
"SUPER, 8, workspace, 8"
"SUPER, 9, workspace, 9"
"SUPER, 0, workspace, 10"
# Move active window to a workspace with mainMod + SHIFT + [0-9]
"SUPER SHIFT, 1, movetoworkspace, 1"
"SUPER SHIFT, 2, movetoworkspace, 2"
"SUPER SHIFT, 3, movetoworkspace, 3"
"SUPER SHIFT, 4, movetoworkspace, 4"
"SUPER SHIFT, 5, movetoworkspace, 5"
"SUPER SHIFT, 6, movetoworkspace, 6"
"SUPER SHIFT, 7, movetoworkspace, 7"
"SUPER SHIFT, 8, movetoworkspace, 8"
"SUPER SHIFT, 9, movetoworkspace, 9"
"SUPER SHIFT, 0, movetoworkspace, 10"
# Move workspace to monitor with mainMod + SHIFT + CTRL + [0-9]
"SUPER SHIFT CTRL, 1, movecurrentworkspacetomonitor, 0"
"SUPER SHIFT CTRL, 2, movecurrentworkspacetomonitor, 1"
"SUPER SHIFT CTRL, 3, movecurrentworkspacetomonitor, 2"
"SUPER SHIFT CTRL, 4, movecurrentworkspacetomonitor, 3"
"SUPER SHIFT CTRL, 5, movecurrentworkspacetomonitor, 4"
"SUPER SHIFT CTRL, 6, movecurrentworkspacetomonitor, 5"
"SUPER SHIFT CTRL, 7, movecurrentworkspacetomonitor, 6"
"SUPER SHIFT CTRL, 8, movecurrentworkspacetomonitor, 7"
"SUPER SHIFT CTRL, 9, movecurrentworkspacetomonitor, 8"
"SUPER SHIFT CTRL, 0, movecurrentworkspacetomonitor, 9"
"ALT, Tab, cyclenext"
"ALT SHIFT, Tab, cyclenext, prev"
# Scroll through existing workspaces with mainMod + scroll
"SUPER, mouse_down, workspace, e+1"
"SUPER, mouse_up, workspace, e-1"
"SUPER ALT, M, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle"
", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle"
", XF86AudioNext, exec, playerctl next"
", XF86AudioPlay, exec, playerctl play-pause"
", XF86AudioPrev, exec, playerctl previous"
"SUPER ALT, Right, exec, playerctl next"
"SUPER ALT, Down, exec, playerctl play-pause"
"SUPER ALT, Left, exec, playerctl previous"
", XF86PowerOff, exec, wlogout"
", XF86Display, exec, ${pkgs.wdisplays}/bin/wdisplays"
];
bindel = [
", XF86MonBrightnessUp, exec, brightnessctl -q s 10%+"
", XF86MonBrightnessDown, exec, brightnessctl -q s 10%-"
", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%+ -l 1"
", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%- -l 1"
];
bindl = [
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
];
bindm = [
# mouse movements
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
"$mod ALT, mouse:272, resizewindow"
# Move/resize windows with mainMod + LMB/RMB and dragging
"SUPER, mouse:272, movewindow"
"SUPER, mouse:273, resizewindow"
];
windowrulev2 = [
"workspace 4, class:(Zotero)"
"workspace 9, class:(teams-for-linux)"
"workspace 9, initialTitle:(Microsoft Teams)"
"workspace 9, initialTitle:(Outlook .+)"
"workspace 10, class:(spotify)"
"workspace 10, initialTitle:(TIDAL)"
"tile, initialTitle:(TIDAL)"
"tile, class:(Godot)"
"idleinhibit fullscreen, class:(.*)"
"float,class:org.kde.kdeconnect.daemon"
"noborder,class:org.kde.kdeconnect.daemon"
"pin,class:org.kde.kdeconnect.daemon"
"size 100% 100%,class:org.kde.kdeconnect.daemon"
"center,class:org.kde.kdeconnect.daemon"
"noshadow,class:org.kde.kdeconnect.daemon"
"noblur,class:org.kde.kdeconnect.daemon"
];
};
};
}

70
hm/modules/hyprlock.nix Normal file
View file

@ -0,0 +1,70 @@
{ nixosConfig, ... }:
with nixosConfig.nix-rice.lib;
let
strPalette = palette.toRgbaShortHex nixosConfig.nix-rice.rice.colorPalette;
in
{
programs.hyprlock = {
enable = true;
settings = {
general = {
ignore_empty_input = true;
no_fade_in = false;
no_fade_out = false;
hide_cursor = true;
};
auth = {
"fingerprint:enabled" = true;
};
background = {
monitor = "";
path = "screenshot";
blur_passes = 2;
};
label = {
monitor = "";
text = "󰌾 $TIME";
color = "rgba(${strPalette.primary.foreground})";
font_size = 25;
font_family = nixosConfig.nix-rice.rice.font.monospace.name;
rotate = 0;
position = "85, 100";
halign = "left";
valign = "bottom";
};
input-field = {
monitor = "";
size = "170, 30";
outline_thickness = 2;
dots_size = 0.33;
dots_spacing = 0.15;
dots_center = true;
dots_rounding = -1;
outer_color = "rgba(${strPalette.primary.foreground})";
inner_color = "rgba(${strPalette.primary.background})";
font_color = "rgba(${strPalette.primary.foreground})";
fade_on_empty = true;
fade_timeout = 1000;
placeholder_text = "";
hide_input = false;
rounding = -1;
check_color = "rgba(${strPalette.normal.yellow})";
fail_color = "rgba(${strPalette.normal.yellow})";
fail_text = "Wrong password";
fail_transition = 200;
capslock_color = -1;
numlock_color = -1;
bothlock_color = -1;
invert_numlock = false;
swap_font_color = false;
position = "60, 50";
halign = "left";
valign = "bottom";
};
};
};
}

5
hm/modules/info.nix Normal file
View file

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

1
hm/modules/java.nix Normal file
View file

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

View file

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
home.packages = [
(pkgs.jellyfin-media-player.overrideAttrs (old: {
postInstall = ''
${old.postInstall}
wrapProgram $out/bin/jellyfinmediaplayer \
--unset WAYLAND_DISPLAY
'';
}))
];
}

450
hm/modules/joshuto.nix Normal file
View file

@ -0,0 +1,450 @@
{ pkgs, ... }:
let
tomlGenerate = (pkgs.formats.toml { }).generate;
in
{
# TODO: switch to module on next release
home.packages = [ pkgs.joshuto ];
home.shellAliases."fm" = "joshuto --change-directory";
xdg.configFile = {
"joshuto/joshuto.toml".source = tomlGenerate "joshuto-joshuto.toml" {
scroll_offset = 6;
# xdg_open = true;
# xdg_open_fork = true;
use_trash = true;
watch_files = true;
display = {
mode = "default";
collapse_preview = true;
column_ratio = [
1
3
4
];
show_borders = true;
show_hidden = false;
show_icons = true;
tilde_in_titlebar = true;
line_number_style = "absolute";
linemode = "size";
};
display.sort = {
sort_method = "natural";
case_sensitive = false;
directories_first = true;
reverse = false;
};
search = {
string_case_sensitivity = "insensitive";
glob_case_sensitivity = "sensitive";
fzf_case_sensitivity = "insensitive";
};
tab = {
display_mode = "all";
home_page = "inherit";
};
};
"joshuto/mimetype.toml".source = tomlGenerate "joshuto-mimetype.toml" {
class = {
audio_default = [
{
command = "mpv";
args = [ "--" ];
}
{
command = "mediainfo";
confirm_exit = true;
}
];
image_default = [
{
command = "geeqie";
fork = true;
silent = true;
}
{
command = "qimgv";
args = [ "--" ];
fork = true;
silent = true;
}
{
command = "krita";
args = [ "--" ];
fork = true;
silent = true;
}
{
command = "exiftool";
confirm_exit = true;
}
{
command = "swappy";
args = [ "-f" ];
fork = true;
}
];
video_default = [
{
command = "mpv";
args = [ "--" ];
fork = true;
silent = true;
}
{
command = "mediainfo";
confirm_exit = true;
}
{
command = "mpv";
args = [
"--mute"
"on"
"--"
];
fork = true;
silent = true;
}
];
text_default = [
{ command = "hx"; }
{ command = "micro"; }
{
command = "gedit";
fork = true;
silent = true;
}
{
command = "bat";
args = [ "--paging=always" ];
}
];
reader_default = [
{
command = "evince";
fork = true;
silent = true;
}
{
command = "zathura";
fork = true;
silent = true;
}
];
libreoffice_default = [
{
command = "libreoffice";
fork = true;
silent = true;
}
];
};
extension = {
## image formats
avif."inherit" = "image_default";
bmp."inherit" = "image_default";
gif."inherit" = "image_default";
heic."inherit" = "image_default";
jpeg."inherit" = "image_default";
jpe."inherit" = "image_default";
jpg."inherit" = "image_default";
pgm."inherit" = "image_default";
png."inherit" = "image_default";
ppm."inherit" = "image_default";
webp."inherit" = "image_default";
svg.app_list = [
{
command = "inkview";
fork = true;
silent = true;
}
{
command = "inkscape";
fork = true;
silent = true;
}
];
tiff.app_list = [
{
command = "qimgv";
fork = true;
silent = true;
}
{
command = "krita";
fork = true;
silent = true;
}
];
## audio formats
flac."inherit" = "audio_default";
m4a."inherit" = "audio_default";
mp3."inherit" = "audio_default";
ogg."inherit" = "audio_default";
wav."inherit" = "audio_default";
## video formats
avi."inherit" = "video_default";
av1."inherit" = "video_default";
flv."inherit" = "video_default";
mkv."inherit" = "video_default";
m4v."inherit" = "video_default";
mov."inherit" = "video_default";
mp4."inherit" = "video_default";
ts."inherit" = "video_default";
webm."inherit" = "video_default";
wmv."inherit" = "video_default";
## text formats
build."inherit" = "text_default";
c."inherit" = "text_default";
cmake."inherit" = "text_default";
conf."inherit" = "text_default";
cpp."inherit" = "text_default";
css."inherit" = "text_default";
csv."inherit" = "text_default";
cu."inherit" = "text_default";
ebuild."inherit" = "text_default";
eex."inherit" = "text_default";
env."inherit" = "text_default";
ex."inherit" = "text_default";
exs."inherit" = "text_default";
go."inherit" = "text_default";
h."inherit" = "text_default";
hpp."inherit" = "text_default";
hs."inherit" = "text_default";
html."inherit" = "text_default";
ini."inherit" = "text_default";
java."inherit" = "text_default";
js."inherit" = "text_default";
json."inherit" = "text_default";
kt."inherit" = "text_default";
lua."inherit" = "text_default";
log."inherit" = "text_default";
md."inherit" = "text_default";
micro."inherit" = "text_default";
ninja."inherit" = "text_default";
py."inherit" = "text_default";
rkt."inherit" = "text_default";
rs."inherit" = "text_default";
scss."inherit" = "text_default";
sh."inherit" = "text_default";
srt."inherit" = "text_default";
svelte."inherit" = "text_default";
toml."inherit" = "text_default";
tsx."inherit" = "text_default";
txt."inherit" = "text_default";
vim."inherit" = "text_default";
xml."inherit" = "text_default";
yaml."inherit" = "text_default";
yml."inherit" = "text_default";
# archive formats
"7z".app_list = [
{
command = "7z";
args = [ "x" ];
confirm_exit = true;
}
{
command = "file-roller";
fork = true;
silent = true;
}
];
bz2.app_list = [
{
command = "tar";
args = [ "-xvjf" ];
confirm_exit = true;
}
{
command = "file-roller";
fork = true;
silent = true;
}
];
gz.app_list = [
{
command = "tar";
args = [ "-xvzf" ];
confirm_exit = true;
}
{
command = "file-roller";
fork = true;
silent = true;
}
];
tar.app_list = [
{
command = "tar";
args = [ "-xvf" ];
confirm_exit = true;
}
{
command = "file-roller";
fork = true;
silent = true;
}
];
tgz.app_list = [
{
command = "tar";
args = [ "-xvzf" ];
confirm_exit = true;
}
{
command = "file-roller";
fork = true;
silent = true;
}
];
rar.app_list = [
{
command = "unrar";
args = [ "x" ];
confirm_exit = true;
}
{
command = "file-roller";
fork = true;
silent = true;
}
];
xz.app_list = [
{
command = "tar";
args = [ "-xvJf" ];
confirm_exit = true;
}
{
command = "file-roller";
fork = true;
silent = true;
}
];
zip.app_list = [
{
command = "unzip";
confirm_exit = true;
}
{
command = "file-roller";
fork = true;
silent = true;
}
];
# misc formats
aup.app_list = [
{
command = "audacity";
fork = true;
silent = true;
}
];
m3u.app_list = [
{ command = "micro"; }
{ command = "mpv"; }
{
command = "gedit";
fork = true;
silent = true;
}
{
command = "bat";
confirm_exit = true;
}
];
odt."inherit" = "libreoffice_default";
odf."inherit" = "libreoffice_default";
ods."inherit" = "libreoffice_default";
odp."inherit" = "libreoffice_default";
doc."inherit" = "libreoffice_default";
docx."inherit" = "libreoffice_default";
xls."inherit" = "libreoffice_default";
xlsx."inherit" = "libreoffice_default";
ppt."inherit" = "libreoffice_default";
pptx."inherit" = "libreoffice_default";
pdf."inherit" = "reader_default";
kra.app_list = [
{
command = "krita";
fork = true;
silent = true;
}
];
kdenlive.app_list = [
{
command = "kdenlive";
fork = true;
silent = true;
}
];
tex.app_list = [
{ command = "micro"; }
{
command = "gedit";
fork = true;
silent = true;
}
{
command = "bat";
confirm_exit = true;
}
{ command = "pdflatex"; }
];
torrent.app_list = [{ command = "transmission-gtk"; }];
};
mimetype = {
# application/octet-stream
application.subtype.octet-stream."inherit" = "video_default";
# text/*
text."inherit" = "text_default";
# video/*
video."inherit" = "video_default";
};
};
"joshuto/bookmarks.toml".source = tomlGenerate "joshuto-bookmarks.toml" {
bookmark = [
{
path = "/";
key = "r";
}
{
path = "~/";
key = "h";
}
{
path = "~/Scaricati";
key = "d";
}
{
path = "~/Syncthing";
key = "s";
}
];
};
};
}

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;
};
}

403
hm/modules/kakoune.nix Normal file
View file

@ -0,0 +1,403 @@
{ pkgs, nixosConfig, ... }:
with nixosConfig.nix-rice.lib;
let
inherit (nixosConfig.nix-rice) rice;
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
'';
desktopItem = 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++"
];
};
packages = builtins.attrValues {
inherit (pkgs) editorconfig-core-c;
inherit desktopItem;
};
in
{
programs = {
bash.shellAliases = {
k = "kak";
};
zsh.shellAliases = {
k = "kak";
};
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 = [
{
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 = builtins.attrluesVa {
inherit (pkgs.kakounePlugins)
prelude-kak
kak-lsp
auto-pairs-kak
powerline-kak
connect-kak
;
};
};
};
home.packages = packages;
# THEME FILE
xdg.configFile."kak/colors/nord.kak".text = themeBuilder (
palette.toRgbShortHex 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"]
'';
}

View file

@ -0,0 +1,6 @@
{
services.kdeconnect = {
enable = true;
indicator = true;
};
}

18
hm/modules/keepassxc.nix Normal file
View file

@ -0,0 +1,18 @@
{ 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";
};
};
}

9
hm/modules/keychain.nix Normal file
View file

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

4
hm/modules/kicad.nix Normal file
View file

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

51
hm/modules/kitty.nix Normal file
View file

@ -0,0 +1,51 @@
{ nixosConfig, ... }:
with nixosConfig.nix-rice.lib;
let
inherit (nixosConfig.nix-rice) rice;
strPalette = palette.toRgbHex {
inherit (rice.colorPalette)
background
foreground
color0
color1
color2
color3
color4
color5
color6
color7
color8
color9
color10
color11
color12
color13
color14
color15
;
};
in
{
programs.kitty = {
enable = true;
settings = {
scrollback_lines = 10000;
enable_audio_bell = false;
visual_bell_duration = toString 0.1;
update_check_interval = 0;
background_opacity = toString rice.opacity;
close_on_child_death = "yes";
clipboard_control = "write-clipboard write-primary read-clipboard read-primary";
disable_ligatures = "never";
editor = "nvim";
} // 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 = { inherit (rice.font.monospace) name package size; };
};
}

510
hm/modules/lf.nix Normal file
View file

@ -0,0 +1,510 @@
{ pkgs, ... }:
let
cleaner = pkgs.writeShellScript "cleaner" ''
kitty +kitten icat --clear --stdin no --silent --transfer-mode file < /dev/null > /dev/tty
'';
previewer = pkgs.writeShellScript "previewer" ''
file=$1
w=$2
h=$3
x=$4
y=$5
preview() {
kitty +kitten icat --silent --stdin no --transfer-mode file --place "''${w}x''${h}@''${x}x''${y}" "$1" < /dev/null > /dev/tty
}
TEMPDIR=~/.cache/lf
file="$1"; shift
case "$(basename "$file" | tr '[A-Z]' '[a-z]')" in
*.tar*) tar tf "$file" ;;
*.zip) unzip -l "$file" ;;
*.rar) unrar l "$file" ;;
*.7z) 7z l "$file" ;;
*.avi|*.mp4|*.mkv)
thumbnail="$TEMPDIR/thumbnail.png"
ffmpeg -y -i "$file" -vframes 1 "$thumbnail"
preview "$thumbnail"
;;
*.pdf)
thumbnail="$TEMPDIR/thumbnail.png"
gs -o "$thumbnail" -sDEVICE=pngalpha -dLastPage=1 "$file" >/dev/null
preview "$thumbnail"
;;
*.jpg|*.jpeg|*.png|*.bmp)
preview "$file"
;;
*.ttf|*.otf|*.woff)
thumbnail="$TEMPDIR/thumbnail.png"
fontpreview -i "$file" -o "$thumbnail"
preview "$thumbnail"
;;
*.svg)
thumbnail="$TEMPDIR/thumbnail.png"
convert "$file" "$thumbnail"
preview "$thumbnail"
;;
*) lf_bat_preview "$file" ;;
esac
return 127 # nonzero retcode required for lf previews to reload
'';
in
{
programs.lf = {
enable = true;
settings = {
dircounts = true;
icons = true;
# mouse = true;
number = true;
# scrollof = 3;
hidden = true;
ignorecase = true;
tabstop = 2;
};
previewer = {
source = previewer;
# keybinding = "i";
};
keybindings = {
"<c-f>" = "$EDITOR $(fzf)";
};
commands = {
mkdir = ''
''${{
printf "Directory name: "
read ans
mkdir $ans
}}'';
mkfile = ''
''${{
printf "File name: "
read ans
$VISUAL $ans
}}'';
trash = ''
''${{
files=$(printf "$fx" | tr '\n' ';')
while [ "$files" ]; do
file=''${files%%;*}
${pkgs.trash-cli}/bin/trash-put "$(basename "$file")"
if [ "$files" = "$file" ]; then
files=""
else
files="''${files#*;}"
fi
done
}}'';
restore_trash = ''
''${{
trash-restore
}}'';
z = ''
''${{
result="$(zoxide query --exclude "$PWD" -- "$@")"
lf -remote "send $id cd '$result'"
}}'';
zi = ''
''${{
result="$(zoxide query -i -- "$@")"
lf -remote "send $id cd '$result'"
}}'';
extract = ''
''${{
set -f
case $f in
*.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf $f;;
*.tar.gz|*.tgz) tar xzvf $f;;
*.tar.xz|*.txz) tar xJvf $f;;
*.zip) unzip $f;;
*.rar) unrar x $f;;
*.7z) 7z x $f;;
esac
}}'';
"tar" = ''
''${{
set -f
mkdir $1
cp -r $fx $1
tar czf $1.tar.gz $1
rm -rf $1
}}'';
"zip" = ''
''${{
set -f
mkdir $1
cp -r $fx $1
zip -r $1.zip $1
rm -rf $1
}}'';
};
extraConfig = ''
set cleaner ${cleaner}
'';
};
xdg.configFile."lf/icons".text = ''
# vim:ft=conf
# These examples require Nerd Fonts or a compatible font to be used.
# See https://www.nerdfonts.com for more information.
# default values from lf (with matching order)
# ln l # LINK
# or l # ORPHAN
# tw t # STICKY_OTHER_WRITABLE
# ow d # OTHER_WRITABLE
# st t # STICKY
# di d # DIR
# pi p # FIFO
# so s # SOCK
# bd b # BLK
# cd c # CHR
# su u # SETUID
# sg g # SETGID
# ex x # EXEC
# fi - # FILE
# file types (with matching order)
ln # LINK
or # ORPHAN
tw t # STICKY_OTHER_WRITABLE
ow # OTHER_WRITABLE
st t # STICKY
di # DIR
pi p # FIFO
so s # SOCK
bd b # BLK
cd c # CHR
su u # SETUID
sg g # SETGID
ex # EXEC
fi # FILE
# file extensions (vim-devicons)
*.styl
*.sass
*.scss
*.htm
*.html
*.slim
*.haml
*.ejs
*.css
*.less
*.md
*.mdx
*.markdown
*.rmd
*.json
*.webmanifest
*.js
*.mjs
*.jsx
*.rb
*.gemspec
*.rake
*.php
*.py
*.pyc
*.pyo
*.pyd
*.coffee
*.mustache
*.hbs
*.conf
*.ini
*.yml
*.yaml
*.toml
*.bat
*.mk
*.jpg
*.jpeg
*.bmp
*.png
*.webp
*.gif
*.ico
*.twig
*.cpp
*.c++
*.cxx
*.cc
*.cp
*.c
*.cs
*.h
*.hh
*.hpp
*.hxx
*.hs
*.lhs
*.nix
*.lua
*.java
*.sh
*.fish
*.bash
*.zsh
*.ksh
*.csh
*.awk
*.ps1
*.ml λ
*.mli λ
*.diff
*.db
*.sql
*.dump
*.clj
*.cljc
*.cljs
*.edn
*.scala
*.go
*.dart
*.xul
*.sln
*.suo
*.pl
*.pm
*.t
*.rss
'*.f#' 
*.fsscript
*.fsx
*.fs
*.fsi
*.rs
*.rlib
*.d
*.erl
*.hrl
*.ex
*.exs
*.eex
*.leex
*.heex
*.vim
*.ai
*.psd
*.psb
*.ts
*.tsx
*.jl
*.pp
*.vue
*.elm
*.swift
*.xcplayground
*.tex
*.r
*.rproj
*.sol
*.pem
# file names (vim-devicons) (case-insensitive not supported in lf)
*gruntfile.coffee
*gruntfile.js
*gruntfile.ls
*gulpfile.coffee
*gulpfile.js
*gulpfile.ls
*mix.lock
*dropbox
*.ds_store
*.gitconfig
*.gitignore
*.gitattributes
*.gitlab-ci.yml
*.bashrc
*.zshrc
*.zshenv
*.zprofile
*.vimrc
*.gvimrc
*_vimrc
*_gvimrc
*.bashprofile
*favicon.ico
*license
*node_modules
*react.jsx
*procfile
*dockerfile
*docker-compose.yml
*rakefile
*config.ru
*gemfile
*makefile
*cmakelists.txt
*robots.txt
# file names (case-sensitive adaptations)
*Gruntfile.coffee
*Gruntfile.js
*Gruntfile.ls
*Gulpfile.coffee
*Gulpfile.js
*Gulpfile.ls
*Dropbox
*.DS_Store
*LICENSE
*React.jsx
*Procfile
*Dockerfile
*Docker-compose.yml
*Rakefile
*Gemfile
*Makefile
*CMakeLists.txt
# file patterns (vim-devicons) (patterns not supported in lf)
# .*jquery.*\.js$ 
# .*angular.*\.js$ 
# .*backbone.*\.js$ 
# .*require.*\.js$ 
# .*materialize.*\.js$ 
# .*materialize.*\.css$ 
# .*mootools.*\.js$ 
# .*vimrc.* 
# Vagrantfile$ 
# file patterns (file name adaptations)
*jquery.min.js
*angular.min.js
*backbone.min.js
*require.min.js
*materialize.min.js
*materialize.min.css
*mootools.min.js
*vimrc
Vagrantfile
# archives or compressed (extensions from dircolors defaults)
*.tar
*.tgz
*.arc
*.arj
*.taz
*.lha
*.lz4
*.lzh
*.lzma
*.tlz
*.txz
*.tzo
*.t7z
*.zip
*.z
*.dz
*.gz
*.lrz
*.lz
*.lzo
*.xz
*.zst
*.tzst
*.bz2
*.bz
*.tbz
*.tbz2
*.tz
*.deb
*.rpm
*.jar
*.war
*.ear
*.sar
*.rar
*.alz
*.ace
*.zoo
*.cpio
*.7z
*.rz
*.cab
*.wim
*.swm
*.dwm
*.esd
# image formats (extensions from dircolors defaults)
*.jpg
*.jpeg
*.mjpg
*.mjpeg
*.gif
*.bmp
*.pbm
*.pgm
*.ppm
*.tga
*.xbm
*.xpm
*.tif
*.tiff
*.png
*.svg
*.svgz
*.mng
*.pcx
*.mov
*.mpg
*.mpeg
*.m2v
*.mkv
*.webm
*.ogm
*.mp4
*.m4v
*.mp4v
*.vob
*.qt
*.nuv
*.wmv
*.asf
*.rm
*.rmvb
*.flc
*.avi
*.fli
*.flv
*.gl
*.dl
*.xcf
*.xwd
*.yuv
*.cgm
*.emf
*.ogv
*.ogx
# audio formats (extensions from dircolors defaults)
*.aac
*.au
*.flac
*.m4a
*.mid
*.midi
*.mka
*.mp3
*.mpc
*.ogg
*.ra
*.wav
*.oga
*.opus
*.spx
*.xspf
# other formats
*.pdf
'';
}

View file

@ -0,0 +1,27 @@
{ 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
gesture swipe up ${xdotool} key alt+Tab
'';
}

1
hm/modules/lorri.nix Normal file
View file

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

7
hm/modules/lsd.nix Normal file
View file

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

7
hm/modules/lutris.nix Normal file
View file

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
home.packages = [
pkgs.lutris
pkgs.winePackages.full
];
}

6
hm/modules/man.nix Normal file
View file

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

32
hm/modules/mangohud.nix Normal file
View file

@ -0,0 +1,32 @@
{ nixosConfig, ... }:
with nixosConfig.nix-rice.lib;
let
inherit (nixosConfig.nix-rice) rice;
strPalette = palette.toRgbShortHex rice.colorPalette;
in
{
programs.mangohud = {
enable = true;
# enableSessionWide = true;
settings = {
toggle_fps_limit = "F1";
cpu_color = strPalette.normal.blue;
cpu_temp = true;
engine_color = strPalette.normal.red;
gpu_color = strPalette.normal.green;
gpu_stats = true;
gpu_temp = true;
io_color = strPalette.normal.white;
media_player_color = strPalette.normal.white;
media_player_name = "spotify";
output_folder = "/home/bertof";
position = "top-left";
ram = true;
ram_color = strPalette.normal.magenta;
toggle_hud = "Shift_L+F12";
toggle_logging = "Shift_L+F2";
vram = true;
vram_color = strPalette.dark.magenta;
};
};
}

22
hm/modules/megasync.nix Normal file
View file

@ -0,0 +1,22 @@
{ 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;
};
};
}

9
hm/modules/mpv.nix Normal file
View file

@ -0,0 +1,9 @@
{
programs.mpv = {
enable = true;
bindings = {
"Ctrl+Right" = "playlist-next";
"Ctrl+Left" = "playlist-prev";
};
};
}

7
hm/modules/nautilus.nix Normal file
View file

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

12
hm/modules/ncspot.nix Normal file
View file

@ -0,0 +1,12 @@
{
programs.ncspot = {
enable = true;
# package = pkgs.ncspot.overrideAttrs (o: {
# buildFeatures = o.buildFeatures ++ [ "cover" "mpris" "notify" "share_clipboard" ];
# });
settings = {
use_nerdfont = true;
notify = true;
};
};
}

4
hm/modules/nemo.nix Normal file
View file

@ -0,0 +1,4 @@
{ pkgs, ... }:
{
home.packages = builtins.attrValues { inherit (pkgs) nemo; };
}

7
hm/modules/nix-index.nix Normal file
View file

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

5
hm/modules/noti.nix Normal file
View file

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

14
hm/modules/ntfy.nix Normal file
View file

@ -0,0 +1,14 @@
{ nixosConfig
, pkgs
, config
, ...
}:
let
inherit (nixosConfig.networking) hostName;
in
{
home.packages = [ pkgs.ntfy-sh ];
xdg.configFile."ntfy/client.yml".source =
config.lib.file.mkOutOfStoreSymlink
nixosConfig.age.secrets."ntfy-${hostName}".path;
}

14
hm/modules/nushell.nix Normal file
View file

@ -0,0 +1,14 @@
{ pkgs, ... }: {
programs.nushell = {
enable = true;
extraConfig = ''
$env.config.show_banner = false
'';
envFile.text = "";
plugins = with pkgs.nushellPlugins;[
formats
polars
query
];
};
}

View file

@ -0,0 +1,37 @@
local cmp = require("cmp")
local luasnip = require("luasnip")
cmp.setup({
completion = {
completeopt = "menu,menuone,preview,noselect"
},
snippet = { -- configura how nvim-cmp interacts with snippet engine
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<Up>"] = cmp.mapping.select_prev_item(), -- previous suggestion
["<Down>"] = cmp.mapping.select_next_item(), -- next suggestion
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
["<C-e>"] = cmp.mapping.abort(), -- close cmpletion window
["<CR>"] = cmp.mapping.confirm({ select = false })
}),
-- sources for autocompletion
sources = cmp.config.sources({
{ name = "nvim_lsp" }, -- nvim_lsp
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
}),
})
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)

View file

@ -0,0 +1,98 @@
local lspconfig = require('lspconfig')
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local lsp_format = require("lsp-format")
-- Keymaps
local keymap = vim.keymap
local opts = { noremap = true, silent = true }
local on_attach = function(client, bufnr)
opts.buffer = bufnr
lsp_format.on_attach(client, bufrn)
opts.desc = "Show LSP references"
keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts)
opts.desc = "Go to declaration"
keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
opts.desc = "Go to definition"
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts)
opts.desc = "Show LSP implementations"
keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts)
opts.desc = "Show LSP type definitions"
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts)
opts.desc = "See available code actions"
keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts)
opts.desc = "Smart rename"
keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts)
opts.desc = "Smart show diagnostics"
keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics", opts)
opts.desc = "Smart show buffer diagnostics"
keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts)
opts.desc = "Smart show line diagnostics"
keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts)
opts.desc = "Go to previous diagnostic"
keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
opts.desc = "Go to next diagnostic"
keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
opts.desc = "Show documentation for what is under cursor"
keymap.set("n", "K", vim.lsp.buf.hover, opts)
opts.desc = "Restart LSP"
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts)
end
-- Change the Diagnostic symbols in the sign column (gutter)
-- (not in youtube nvim video)
local signs = { Error = "", Warn = "", Hint = "󰠠 ", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
-- LSP configuration
lspconfig["html"].setup { capabilities = capabilities, on_attach = on_attach}
lspconfig["gopls"].setup { capabilities = capabilities, on_attach = on_attach}
lspconfig["pylsp"].setup { capabilities = capabilities, on_attach = on_attach}
lspconfig["nil_ls"].setup { capabilities = capabilities, on_attach = on_attach, settings = {
["nil"] = {
formatting = { command = { "nixpkgs-fmt" } },
autoEvalInputs = true
}
}}
lspconfig["rust_analyzer"].setup { capabilities = capabilities, on_attach = on_attach}
lspconfig["texlab"].setup { capabilities = capabilities, on_attach = on_attach, settings = {
texlab = {
formatterLineLength = 0,
bibtexFormatter = "latexindent",
latexindent = { modifyLineBreaks = false },
chktex = { onEdit = true },
}
}}
lspconfig["clangd"].setup { capabilities = capabilities, on_attach = on_attach}
lspconfig["marksman"].setup { capabilities = capabilities, on_attach = on_attach}
lspconfig["yamlls"].setup { capabilities = capabilities, on_attach = on_attach, settings = {
yaml = {
keyOrdering = false,
schemas = {
["https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json"] = "*gitlab-ci*.{yml,yaml}",
["https://json.schemastore.org/ansible-playbook"] = "*play*.{yml,yaml}",
["https://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}",
["https://json.schemastore.org/chart"] = "Chart.{yml,yaml}",
["https://json.schemastore.org/dependabot-v2"] = ".github/dependabot.{yml,yaml}",
["https://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
["https://json.schemastore.org/github-workflow"] = ".github/workflows/*",
["https://json.schemastore.org/hugo"] = "hugo.{yml,yaml,toml}",
["https://json.schemastore.org/kustomization"] = "kustomization.{yml,yaml}",
["https://json.schemastore.org/prettierrc"] = ".prettierrc.{yml,yaml}",
["https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v3.1/schema.json"] = "*api*.{yml,yaml}",
["https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/jsonschema/schema.json"] = "*flow*.{yml,yaml}",
["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] = "*docker-compose*.{yml,yaml}",
["kubernetes"] = "*.yaml",
}
}
}}
lspconfig["pylsp"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
-- lspconfig["cmake-language-server"].setup { capabilities = capabilities, on_attach = on_attach}
-- lspconfig["vscode-css-language-server"].setup { capabilities = capabilities, on_attach = on_attach}

View file

@ -0,0 +1,150 @@
{
"Thesis structure": {
"prefix": "thesis structure",
"body": [
"## Introduction",
"",
"- Def. problema",
"- Motivations",
"- Thesis/Research questions",
"",
"## Background",
"",
"- Basic information required to understand the research",
"- Related work (similar works, pubblications)",
"",
"## Methodology",
"",
"- How do i test the thesis",
"",
"## Experiments",
"",
"- I do the experiments and verify the thesis (I try to disprove it)",
"",
"## Discussion",
"",
"- Comments on the obtained results",
"",
"## Conclusioni",
"",
"- Summary of the contents",
"- Remarks on future works",
""
],
"description": "Thesis structure"
},
"Person": {
"prefix": "person",
"body": [
"---",
"aliases: []",
"type: person",
"relationship: []",
"email: ${2:email}",
"---",
"",
"# ${1:example}",
"",
"- **Email**: ${2:email}"
],
"description": "Person"
},
"Thesis student": {
"prefix": "thesis student",
"body": [
"---",
"type: person",
"email: ${2:email}",
"relationships: [thesis_student]",
"supervisor: ${4:supervisor}",
"cosupervisors: [Filippo Berto]",
"thesis: ${3:thesis title}",
"---",
"",
"# ${1:name}",
"",
"- **Email**: ${2:example}",
"- **Thesis**: [[${3:thesis title}]]",
"- **Supervisor**: [[${4:supervisor}]]",
"- **Co-supervisor**: [Filippo Berto]"
],
"description": "Thesis student"
},
"Thesis": {
"prefix": "thesis",
"body": [
"---",
"type: thesis",
"title: ${1:title}",
"grade: ${2:grade}",
"supervisor: ${3:supervisor}",
"cosupervisors: [Filippo Berto]",
"tags: [${4:example}]",
"---",
"",
"# ${1:title}",
"",
"- **Supervisor**: [[${2:supervisor}]]",
"- **Co-supervisor**: [[Filippo Berto]]",
"- **Grade**: ${3:grade}",
"",
"**Main points**:"
],
"description": "Thesis"
},
"Meeting": {
"prefix": "meeting",
"body": [
"---",
"type: meeting",
"people: [Filippo Berto, ${2:people}]",
"date: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE",
"topic: ${1:title}",
"---",
"",
"# ${1:title}",
"",
"## Step 1",
"",
"## Step 2"
],
"description": "Meeting"
},
"Note of the day": {
"prefix": "note of the day",
"body": [
"---",
"date: $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE",
"---",
"",
"# ${1:title}",
"",
"## Step 1",
"",
"## Step 2"
],
"description": "Note of the day"
},
"Paper review": {
"prefix": "paper review",
"body": [
"# Paper review: ${1:title}",
"",
"## Notes",
"",
"${1:notes}",
"",
"## Overall evaluation",
"",
"${2:evaluation}",
"",
"## Comments",
"",
"${3:comments}",
"",
"## Confidential remarks",
"",
"${4:confidential remarks}"
]
}
}

View file

@ -0,0 +1,17 @@
{
"name": "personal-snippets",
"engines": {
"vscode": "^1.11.0"
},
"contributes": {
"snippets": [
{
"language": [
"markdown",
"rmd"
],
"path": "./markdown.json"
}
]
}
}

View file

@ -0,0 +1,27 @@
local telescope = require("telescope")
local actions = require("telescope.actions")
telescope.setup({
defaults = {
mappings = {
i = {
["<C-k>"] = actions.move_selection_previous, -- move to prev result
["<C-j>"] = actions.move_selection_next, -- move to next result
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
}
}
}
})
telescope.load_extension("fzf");
local keymap = vim.keymap
keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "Fuzzy find files in cwd" })
keymap.set("n", "<leader>fr", "<cmd>Telescope oldfiles<cr>", { desc = "Fuzzy find recent files" })
keymap.set("n", "<leader>fs", "<cmd>Telescope live_grep<cr>", { desc = "Find string in cwd" })
keymap.set("n", "<leader>fS", "<cmd>Telescope lsp_document_symbols<cr>", { desc = "Find symbols in document" })
keymap.set("n", "<leader>fc", "<cmd>Telescope grep_string<cr>", { desc = "Fuzzy string under cursor in cwd" })
keymap.set("n", "<leader>b", "<cmd>Telescope buffers<cr>", { desc = "Fuzzy search buffer names" })
keymap.set("n", "<leader>s", "<cmd>Telescope treesitter<cr>", { desc = "Fuzzy search treesitter symbols" })

22
hm/modules/obs-studio.nix Normal file
View file

@ -0,0 +1,22 @@
{ pkgs, ... }:
{
programs.obs-studio = {
enable = true;
package = pkgs.obs-studio;
plugins = builtins.attrValues {
inherit (pkgs.obs-studio-plugins)
# obs-backgroundremoval
# obs-multi-rtmp
# obs-nvfbc
obs-pipewire-audio-capture
obs-vkcapture
obs-backgroundremoval
input-overlay
# obs-linuxbrowser
# obs-gstreamer
# obs-move-transition
# obs-multi-rtmp
;
};
};
}

10
hm/modules/office.nix Normal file
View file

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
home.packages = builtins.attrValues {
inherit (pkgs)
hunspell
libreoffice-fresh
;
inherit (pkgs.hunspellDicts) en_GB-large en_US-large it_IT;
};
}

21
hm/modules/onedrive.nix Normal file
View file

@ -0,0 +1,21 @@
{ pkgs, ... }:
let
onedriveCmd = "${pkgs.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";
};
};
}

19
hm/modules/pass.nix Normal file
View file

@ -0,0 +1,19 @@
{ pkgs, ... }:
{
programs.password-store = {
package = pkgs.pass.withExtensions (
ext:
(builtins.attrValues {
inherit (ext)
# pass-audit
pass-checkup
pass-import
pass-otp
pass-tomb
pass-update
;
})
);
enable = true;
};
}

27
hm/modules/picom.nix Normal file
View file

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

388
hm/modules/polybar.nix Normal file
View file

@ -0,0 +1,388 @@
{ nixosConfig
, config
, pkgs
, lib
, ...
}:
with nixosConfig.nix-rice.lib;
let
inherit (nixosConfig.nix-rice.rice) colorPalette opacity;
alpha = 255 * opacity;
grep = "${pkgs.gnugrep}/bin/grep";
cut = "${pkgs.coreutils}/bin/cut";
pavucontrol = "${pkgs.pavucontrol}/bin/pavucontrol";
pgrep = "${pkgs.procps}/bin/pgrep";
pkill = "${pkgs.procps}/bin/pkill";
playerCtl = "${pkgs.playerctl}/bin/playerctl";
dunstctl = "${pkgs.dunst}/bin/dunstctl";
zscroll = "${pkgs.zscroll}/bin/zscroll";
notificationStatus = pkgs.writeShellScript "notificationStatus" ''
PATH=$PATH:"${lib.makeBinPath [ pkgs.dbus ]}"
if [[ `${dunstctl} is-paused` == "true" ]]; then echo 󰂛; else echo 󰂚; fi
'';
notificationToggle = pkgs.writeShellScript "notificationToggle" ''
PATH=$PATH:"${lib.makeBinPath [ pkgs.dbus ]}"
${dunstctl} set-paused toggle
'';
keyboardStatus = pkgs.writeShellScript "keyboardStatus" ''
PATH=$PATH:"${lib.makeBinPath [ pkgs.coreutils ]}"
STATE=~/.local/share/keyboard-switch.state
touch $STATE
if [[ `cat $STATE` == "disabled" ]]; then echo 󰌐; else echo 󰌌; fi
'';
keyboardToggle = pkgs.writeShellScript "keyboardToggle" ''
PATH=$PATH:"${lib.makeBinPath [ pkgs.keyboard-switch ]}"
keyboard-switch
'';
notificationHistory = pkgs.writeShellScript "notificationToggle" ''
PATH=$PATH:"${lib.makeBinPath [ pkgs.dbus ]}"
${dunstctl} set-paused false
for i in {1..10}; do ${dunstctl} history-pop; done
'';
playerStatusBasic = pkgs.writeShellScript "playerStatusBasic" ''
${playerCtl} status || true
'';
playerStatusSrc = pkgs.writeShellScript "playerStatusSrc" ''
${playerCtl} -f '{{title}} - {{artist}}' metadata || true
'';
playerStatus = pkgs.writeShellScript "playerStatus" ''
${zscroll} -l 25 -M ${playerStatusBasic} \
-m "Playing" "-b ' ' -s 1" \
-m "Paused" "-b ' ' -s 0" \
-u true ${playerStatusSrc} &
wait
'';
powermenu = pkgs.writeShellScript "powermenu" ''
PATH=$PATH:"${
lib.makeBinPath [
pkgs.rofi
pkgs.rofi-power-menu
pkgs.zsh
]
}"
zsh -c 'rofi -show menu -modi "menu:rofi-power-menu --choices=shutdown/reboot/hibernate/logout"'
'';
colors = palette.toARGBHex rec {
normal = {
foreground = color.darken 10 colorPalette.foreground;
background = color.setAlphaRgba alpha colorPalette.background;
underline = colorPalette.normal.blue;
};
active = {
inherit (colorPalette) foreground;
background = color.setAlphaRgba alpha colorPalette.background;
underline = colorPalette.normal.yellow;
};
selected = {
inherit (colorPalette) foreground;
background = color.setAlphaRgba alpha colorPalette.background;
underline = colorPalette.bright.red;
};
inherit (colorPalette.normal) green red yellow;
inherit (color) transparent;
orange = colorPalette.bright.red;
alert = orange;
};
commonBar = {
locale = config.home.language.base;
monitor = "\${env:MONITOR}";
width = "100%";
height = 20;
radius = 6.0;
fixed-center = false;
inherit (colors.normal) background foreground;
line-size = 2;
line-color = colors.normal.underline;
padding = 0;
module.margin = 0;
separator = " ";
border = {
color = colors.transparent;
left.size = 2;
righ.sizet = 2;
top.size = 2;
bottom.size = 0;
};
font = [
"${rice.font.monospace.name}:size=${toString rice.font.monospace.size};2"
# "Font Awesome 6 Free:size=14;0"
# "Noto Color Emoji:size=2;2"
"Noto Sans Symbols2:size=${toString rice.font.monospace.size};2"
"Material Design Icons:size=${toString rice.font.monospace.size};2"
# "EmojiOne Color:size=${toString rice.font.monospace.size};0"
"Noto Sans CJK JP:size=${toString rice.font.monospace.size};0"
"Noto Sans CJK KR:size=${toString rice.font.monospace.size};0"
"Noto Sans CJK CN:size=${toString rice.font.monospace.size};0"
"Noto Sans CJK HK:size=${toString rice.font.monospace.size};0"
];
enable-ipc = true;
wm-restack = "bspwm";
};
ramp = [ "" "" "" "" "" "" ];
in
{
home.packages = builtins.attrValues {
inherit (pkgs) noto-fonts material-design-icons noto-fonts-cjk-sans;
# emojione
# noto-fonts-emoji
# font-awesome
inherit (rice.font.monospace) package;
};
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" = lib.recursiveUpdate commonBar {
modules-left = "bspwm";
# modules-center =
modules-right = "player pulseaudio temperature cpu memory battery keyboard-switch notifications powermenu date";
tray = {
position = "right";
padding = 1;
};
};
"bar/secondary" = lib.recursiveUpdate commonBar {
modules-left = "bspwm";
# modules-center =
modules-right = "player pulseaudio temperature cpu memory battery keyboard-switch notifications powermenu date";
};
"module/battery" = {
type = "internal/battery";
adapter = "AC";
battery = "BAT0";
full.at = 98;
animation = {
charging = {
text = [
""
""
""
""
""
];
framerate = "750";
};
discharging = {
text = [
""
""
""
""
""
];
framerate = "750";
};
};
format = {
charging = lib.recursiveUpdate colors.selected { text = "<animation-charging> <label-charging>"; };
discharging = lib.recursiveUpdate colors.active {
text = "<animation-discharging> <label-discharging>";
};
full = lib.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 = lib.recursiveUpdate common colors.selected;
occupied = lib.recursiveUpdate common colors.active;
urgent = lib.recursiveUpdate (lib.recursiveUpdate common colors.active) {
background = colors.alert;
};
empty = lib.recursiveUpdate common colors.normal;
};
};
"module/cpu" = {
type = "internal/cpu";
format = lib.recursiveUpdate colors.normal { text = " <label>"; };
interval = 2;
label = "%percentage-sum%%";
ramp-load = ramp;
};
"module/date" = {
type = "internal/date";
format = colors.normal;
date = {
alt = "%Y-%m-%d";
text = "%a %d/%m/%y";
};
interval = "1";
label = "%date% %time%";
time = {
alt = "%H:%M:%S";
text = "%H:%M";
};
};
"module/memory" = {
type = "internal/memory";
format = lib.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 = lib.recursiveUpdate colors.normal { text = "<ramp-volume> <label-volume>"; };
};
label.muted.text = "󰝟 muted";
label.volume.text = "%percentage%%";
ramp.volume = [
"󰕿"
"󰖀"
"󰕾"
];
type = "internal/pulseaudio";
};
"module/temperature" = {
format = lib.recursiveUpdate colors.normal {
text = "<ramp> <label>";
warn = {
text = "<ramp> <label-warn>";
underline = colors.alert;
};
};
label = {
text = "%temperature-c%";
warn = "%temperature-c%";
};
ramp.text = [
""
""
""
""
""
];
thermal.zone = if nixosConfig.networking.hostName == "odin" then 8 else 0;
type = "internal/temperature";
warn.temperature = "90";
};
"module/powermenu" = {
type = "custom/script";
format = lib.recursiveUpdate colors.normal { padding = 0; };
exec = "echo ";
click.left = "${powermenu}";
};
"module/notifications" = {
type = "custom/script";
format = lib.recursiveUpdate colors.normal { padding = 0; };
exec = "${notificationStatus}";
click.left = "${notificationToggle}";
click.right = "${notificationHistory}";
interval = 0.5;
# tail = 1;
};
"module/keyboard-switch" = {
type = "custom/script";
format = lib.recursiveUpdate colors.normal { padding = 0; };
exec = "${keyboardStatus}";
click.left = "${keyboardToggle}";
interval = 1;
# tail = 1;
};
"module/player" = {
type = "custom/script";
format = colors.normal;
exec = playerStatus;
tail = true;
click.left = "${playerCtl} play-pause";
clicl.right = "${playerCtl} stop";
scroll = {
up = "${playerCtl} previous";
down = "${playerCtl} next";
};
};
"module/player-prev" = {
type = "custom/script";
format = colors.normal;
exec = "echo 󰒮";
click.left = "${playerCtl} previous";
};
"module/player-next" = {
type = "custom/script";
format = colors.normal;
exec = "echo 󰒭";
click.left = "${playerCtl} next";
};
"module/player-play-pause" = {
type = "custom/script";
format = colors.normal;
exec = "echo 󰐎";
click.left = "${playerCtl} play-pause";
};
};
};
}

62
hm/modules/pro_audio.nix Normal file
View file

@ -0,0 +1,62 @@
{ pkgs, ... }:
let
systemLibFolder = "/run/current-system/sw/lib/";
userLibFolder = "$HOME/.local/state/nix/profiles/home-manager/home-path/lib";
variables = {
DSSI_PATH = "$HOME/.dssi:${userLibFolder}/dssi:${systemLibFolder}/dssi";
LADSPA_PATH = "$HOME/.ladspa:${userLibFolder}/ladspa:${systemLibFolder}/ladspa";
LV2_PATH = "$HOME/.lv2:${userLibFolder}/lv2:${systemLibFolder}/lv2";
LXVST_PATH = "$HOME/.lxvst:${userLibFolder}/lxvst:${systemLibFolder}/lxvst";
VST_PATH = "$HOME/.vst:${userLibFolder}/vst:${systemLibFolder}/vst";
VST3_PATH = "$HOME/.vst3:${userLibFolder}/vst3:${systemLibFolder}/vst3";
};
in
{
home.packages = builtins.attrValues {
inherit (pkgs)
# Plugins
# helm
# noise-repellent
# speech-denoiser
# stochas
# sunvox
# tunefish
# zrythm
# mamba
aeolus
ardour
artyFX
autotalent
boops
# breeze-icons
calf
cardinal
# carla
fluidsynth
gxplugins-lv2
geonkick
giada
hydrogen
neural-amp-modeler-lv2
proteus
ninjas2
lsp-plugins
# mixxx
rnnoise
samplv1
sfizz
surge
surge-XT
talentedhack
vital
vocproc
x42-plugins
zam-plugins
zita-at1
zyn-fusion
zynaddsubfx
;
};
home.sessionVariables = variables;
}

7
hm/modules/pycharm.nix Normal file
View file

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
home.packages = builtins.attrValues {
inherit (pkgs) python3;
inherit (pkgs.jetbrains) pycharm-professional jdk;
};
}

View file

@ -0,0 +1,8 @@
{ config, nixosConfig, ... }: {
imports = [ ./rclone-mount.nix ];
rclone-mount = {
enable = true;
configPath = nixosConfig.age.secrets."minio_${config.home.username}".path;
mounts = { "minio" = "/home/${config.home.username}/rclone/minio/"; };
};
}

View file

@ -0,0 +1,8 @@
{ config, nixosConfig, ... }: {
imports = [ ./rclone-mount.nix ];
rclone-mount = {
enable = true;
configPath = nixosConfig.age.secrets."minio_${config.home.username}".path;
mounts = { "minio" = "/home/${config.home.username}/minio/"; };
};
}

View file

@ -0,0 +1,44 @@
{ pkgs, lib, config, ... }:
let cfg = config.rclone-mount; in {
options = {
rclone-mount = {
enable = lib.mkEnableOption "rclone mount user services";
mounts = lib.mkOption {
type = lib.types.attrs;
default = { };
example = { "minio" = "/home/${config.home.username}/minio/"; };
description = "List of mount configurations";
};
configPath = lib.mkOption {
type = lib.types.str;
default = "~/.config/rclone/rclone.conf";
description = "Path to the rclone configuration";
};
};
};
config = {
systemd.user.services = lib.attrsets.mapAttrs'
(name: path: {
name = "rclone-${name}";
value = {
Unit = {
Description = "rclone mount for ${name}";
After = [ "default.target" ];
PartOf = [ "default.target" ];
};
Install.WantedBy = [ "default.target" ];
Service = {
Type = "simple";
Environment = [ "PATH=${ lib.makeBinPath [ pkgs.rclone pkgs.coreutils pkgs.fuse ]}:/run/wrappers/bin/:$PATH" ];
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${path}";
ExecStart = "${pkgs.rclone}/bin/rclone --config '${cfg.configPath}' mount ${name}:/ ${path} -vv --vfs-cache-mode=writes --s3-upload-concurrency 32 --s3-chunk-size 128000";
Restart = "on-failure";
RestartSec = "30s";
};
};
})
(if cfg.enable then cfg.mounts else { });
};
}

1
hm/modules/readme.md Normal file
View file

@ -0,0 +1 @@

13
hm/modules/research.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
home.packages = builtins.attrValues {
inherit (pkgs)
# mendeley # Reference manager
# logseq
# drawio
obsidian
# zettlr
zotero
;
};
}

224
hm/modules/rofi.nix Normal file
View file

@ -0,0 +1,224 @@
{ pkgs, nixosConfig, ... }:
with nixosConfig.nix-rice.lib;
let
inherit (nixosConfig.nix-rice) rice;
in
{
home.packages = builtins.attrValues {
inherit (pkgs)
rofimoji
rofi-bluetooth
rofi-power-menu
rofi-vpn
xdotool
;
};
programs.rofi = {
enable = true;
location = "center";
font = "${rice.font.monospace.name} ${toString rice.font.monospace.size}";
plugins = [ pkgs.rofi-calc ];
extraConfig = {
modi = "drun,run,ssh,window,calc";
};
terminal = "alacritty";
theme = "onedark";
};
xdg.configFile."rofi/nord.rasi".text = ''
* {
nord0: #2e3440;
nord1: #3b4252;
nord2: #434c5e;
nord3: #4c566a;
nord4: #d8dee9;
nord5: #e5e9f0;
nord6: #eceff4;
nord7: #8fbcbb;
nord8: #88c0d0;
nord9: #81a1c1;
nord10: #5e81ac;
nord11: #bf616a;
nord12: #d08770;
nord13: #ebcb8b;
nord14: #a3be8c;
nord15: #b48ead;
background-color: @nord1;
border: 0px;
margin: 0px;
padding: 0px;
spacing: 0px;
text-color: @nord4;
}
#inputbar {
text-color: @nord3;
padding: 6px;
margin: 0px 0px 2px;
children: [ entry ];
}
#entry {
background-color: @nord3;
text-color: @nord4;
padding: 5px;
}
#message {
border: 0px 0px 1px;
border-color: @nord3;
padding: 0px 0px 6px 7px;
}
#listview {
lines: 10;
padding: 2px 0px 0px;
scrollbar: true;
}
#element {
padding: 0px 0px 0px 7px;
margin: 0px 0px 5px 0px;
text-color: @nord4;
}
#element.normal.normal {
text-color: @nord4;
}
#element.normal.urgent {
text-color: @nord11;
}
#element.normal.active {
text-color: @nord10;
}
#element.alternate.normal {
text-color: @nord4;
}
#element.alternate.urgent {
text-color: @nord11;
}
#element.alternate.active {
text-color: @nord10;
}
#element.selected.normal {
background-color: @nord8;
text-color: @nord1;
}
#element.selected.urgent {
background-color: @nord11;
text-color: @nord4;
}
#element.selected.active {
background-color: @nord10;
text-color: @nord4;
}
#scrollbar {
handle-color: @nord3;
handle-width: 0.50em;
}
#button.selected {
background-color: @nord8;
text-color: @nord4;
}
'';
xdg.configFile."rofi/onedark.rasi".text = ''
/*
* ROFI One Dark
*
* Based on OneDark.vim (https://github.com/joshdick/onedark.vim)
*
* Author: Benjamin Stauss
* User: me-benni
*
*/
* {
black: #000000;
red: #eb6e67;
green: #95ee8f;
yellow: #f8c456;
blue: #6eaafb;
mangenta: #d886f3;
cyan: #6cdcf7;
purple: #C678DF;
emphasis: #50536b;
text: #dfdfdf;
text-alt: #b2b2b2;
fg: #abb2bf;
bg: #282c34;
spacing: 0;
background-color: transparent;
font: "Knack Nerd Font 14";
text-color: @text;
}
window {
transparency: "real";
fullscreen: true;
background-color: #282c34dd;
}
mainbox {
padding: 30% 30%;
}
inputbar {
margin: 0px 0px 20px 0px;
children: [prompt, textbox-prompt-colon, entry, case-indicator];
}
prompt {
text-color: @blue;
}
textbox-prompt-colon {
expand: false;
str: ":";
text-color: @text-alt;
}
entry {
margin: 0px 10px;
}
listview {
spacing: 5px;
dynamic: true;
scrollbar: false;
}
element {
padding: 5px;
text-color: @text-alt;
highlight: bold #95ee8f; /* green */
border-radius: 3px;
}
element selected {
background-color: @emphasis;
text-color: @text;
}
element urgent, element selected urgent {
text-color: @red;
}
element active, element selected active {
text-color: @purple;
}
message {
padding: 5px;
border-radius: 3px;
background-color: @emphasis;
border: 1px;
border-color: @cyan;
}
button selected {
padding: 5px;
border-radius: 3px;
background-color: @emphasis;
}
'';
}

View file

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
services.screen-locker = {
enable = true;
lockCmd = "${pkgs.lockscreen}/bin/lockscreen";
inactiveInterval = 2; # minutes
xautolock.extraOptions = [
"-secure"
"-lockaftersleep"
];
};
}

21
hm/modules/security.nix Normal file
View file

@ -0,0 +1,21 @@
{ pkgs, ... }:
{
home.packages = builtins.attrValues {
inherit (pkgs)
nmap# RECOGNITION
# WEB
xh
# altair
# burpsuite
bintools
ghidra-bin
radare2# REVERSING
# cutter
# INFRASTRUCTURE
# cocktail-bar-cli
;
};
}

View file

@ -0,0 +1,47 @@
let
common = {
"jc" = "journalctl";
"jcu" = "journalctl --user";
"n" = "nix";
"nb" = "nix build";
"nr" = "nix repl";
"nR" = "nix run";
"ns" = "nix search nixpkgs";
"nsu" = "nix search unstable";
"nss" = "nix search stable";
"nS" = "nix shell";
"sc" = "systemctl";
"scu" = "systemctl --user";
"rm" = "rm -i"; # Remove a file
"cp" = "cp -i"; # Copy a file
"mv" = "mv -i"; # Move a file
"dud" = "du -d 1 -h"; # Display the size of files at depth 1 in current location in human-readable form
"t" = "tail -f"; # Shorthand for tail which outputs the last part of a file
"grep" = "grep --color"; # Searches for a query string
"sgrep" = "grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS}"; # Useful for searching within files
"h" = "history"; # Lists all recently used commands
"hgrep" = "fc -El 0 | grep"; # Searches for a word in the list of previously used commands
"help" = "man"; # Opens up the man page for a command
"sortnr" = "sort -n -r"; # Used to sort the lines of a text file
"unexport" = "unset"; # Used to unset an environment variable
};
sh_only = {
"nf" = "find /nix/store/ -maxdepth 1 | grep";
"duf*" = "du -sh"; # Display the size of files in current location in human-readable form
"fd*" = "find . -type d -name"; # Find a directory with the given name
"ff" = "find . -type f -name"; # Find a file with the given name
"p" = "ps -f"; # Displays currently executing processes
};
in
{
home.shellAliases = common;
programs.bash.shellAliases = common // sh_only;
programs.zsh.shellAliases = common // sh_only;
}

11
hm/modules/spotifyd.nix Normal file
View file

@ -0,0 +1,11 @@
{ nixosConfig, ... }:
{
services.spotifyd = {
enable = true;
settings.global = {
username = "filippoberto95";
password_cmd = "cat ${nixosConfig.age.secrets.spotify_password.path}";
backend = "pulseaudio";
};
};
}

22
hm/modules/ssh.nix Normal file
View file

@ -0,0 +1,22 @@
{
programs.ssh = {
enable = true;
compression = true;
matchBlocks = {
"*" = {
identityFile = "~/.ssh/id_ed25519";
};
};
extraConfig = ''
# --- START CODER VSCODE coder.ricerca.sesar.di.unimi.it ---
Host coder-vscode.coder.ricerca.sesar.di.unimi.it--*
ConnectTimeout 0
LogLevel ERROR
ProxyCommand "/home/bertof/.config/Code/User/globalStorage/coder.coder-remote/coder.ricerca.sesar.di.unimi.it/bin/coder-linux-amd64" vscodessh --network-info-dir "/home/bertof/.config/Code/User/globalStorage/coder.coder-remote/net" --session-token-file "/home/bertof/.config/Code/User/globalStorage/coder.coder-remote/coder.ricerca.sesar.di.unimi.it/session_token" --url-file "/home/bertof/.config/Code/User/globalStorage/coder.coder-remote/coder.ricerca.sesar.di.unimi.it/url" %h
SetEnv CODER_SSH_SESSION_TYPE=vscode
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
# --- END CODER VSCODE coder.ricerca.sesar.di.unimi.it ---
'';
};
}

Some files were not shown because too many files have changed in this diff Show more