From ca59cb8f3cbdd9c0d8d2afac8c7814ed15b4e9dc Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Fri, 24 Feb 2023 09:24:21 +0100 Subject: [PATCH] Switch to nixpkgs-fmt formatter --- baldur/configuration.nix | 76 ++++++----- custom/clipedit/default.nix | 9 +- custom/default.nix | 3 +- custom/lockscreen/default.nix | 16 ++- custom/update-background/default.nix | 13 +- flake.nix | 84 +++++++----- hm_modules/alacritty.nix | 3 +- hm_modules/autorandr.nix | 186 +++++++++++++------------- hm_modules/bspwm.nix | 3 +- hm_modules/cava.nix | 3 +- hm_modules/development/cpp.nix | 7 +- hm_modules/development/data.nix | 9 +- hm_modules/development/javascript.nix | 7 +- hm_modules/development/latex.nix | 6 +- hm_modules/development/nix.nix | 9 +- hm_modules/development/python.nix | 8 +- hm_modules/development/rust.nix | 29 ++-- hm_modules/dwarf-fortress.nix | 3 +- hm_modules/fonts.nix | 2 +- hm_modules/git.nix | 3 +- hm_modules/gnome_shell.nix | 3 +- hm_modules/helix.nix | 163 +++++++++++----------- hm_modules/kakoune.nix | 3 +- hm_modules/kitty.nix | 3 +- hm_modules/lf.nix | 3 +- hm_modules/libinput-gestures.nix | 3 +- hm_modules/polybar.nix | 101 +++++++------- hm_modules/pro_audio.nix | 3 +- hm_modules/research.nix | 6 +- hm_modules/security.nix | 6 +- hm_modules/sxhkd.nix | 178 ++++++++++++------------ hm_modules/terminator.nix | 3 +- hm_modules/twmn.nix | 3 +- hm_modules/webapp.nix | 14 +- hm_modules/xidlehook.nix | 3 +- loki/configuration.nix | 164 ++++++++++++----------- nixos_modules/big_data.nix | 3 +- nixos_modules/btrfs_scrub.nix | 3 +- nixos_modules/dnsmasq.nix | 3 +- nixos_modules/nix-serve.nix | 5 +- odin/common_configuration.nix | 56 ++++---- odin/hm.nix | 34 ++--- secrets/secrets.nix | 3 +- thor/configuration.nix | 22 +-- thor/hm.nix | 34 ++--- 45 files changed, 695 insertions(+), 606 deletions(-) diff --git a/baldur/configuration.nix b/baldur/configuration.nix index 64086ee..e404b7e 100644 --- a/baldur/configuration.nix +++ b/baldur/configuration.nix @@ -82,46 +82,48 @@ with lib; { recommendedOptimisation = true; recommendedGzipSettings = true; recommendedTlsSettings = true; - virtualHosts = let - ssl = { - enableACME = true; - forceSSL = true; - }; - loki = "172.23.254.55"; - in { - "unimi.bertof.net" = ssl // { - locations."/".extraConfig = - "rewrite ^/(.*)$ https://homes.di.unimi.it/berto/$1 redirect ;"; - }; - "home-assistant.bertof.net" = ssl // { - locations."/" = { - proxyPass = "http://${loki}:8123/"; - proxyWebsockets = true; + virtualHosts = + let + ssl = { + enableACME = true; + forceSSL = true; }; - extraConfig = '' - proxy_pass_header Authorization; - proxy_buffering off; - ''; - }; - "radarr.bertof.net" = ssl // { - locations."/" = { - proxyPass = "http://${loki}:7878/"; - proxyWebsockets = true; + loki = "172.23.254.55"; + in + { + "unimi.bertof.net" = ssl // { + locations."/".extraConfig = + "rewrite ^/(.*)$ https://homes.di.unimi.it/berto/$1 redirect ;"; + }; + "home-assistant.bertof.net" = ssl // { + locations."/" = { + proxyPass = "http://${loki}:8123/"; + proxyWebsockets = true; + }; + extraConfig = '' + proxy_pass_header Authorization; + proxy_buffering off; + ''; + }; + "radarr.bertof.net" = ssl // { + locations."/" = { + proxyPass = "http://${loki}:7878/"; + proxyWebsockets = true; + }; + }; + "sonarr.bertof.net" = ssl // { + locations."/" = { + proxyPass = "http://${loki}:8989/"; + proxyWebsockets = true; + }; + }; + "jellyfin.bertof.net" = ssl // { + locations."/" = { + proxyPass = "http://${loki}:8096/"; + proxyWebsockets = true; + }; }; }; - "sonarr.bertof.net" = ssl // { - locations."/" = { - proxyPass = "http://${loki}:8989/"; - proxyWebsockets = true; - }; - }; - "jellyfin.bertof.net" = ssl // { - locations."/" = { - proxyPass = "http://${loki}:8096/"; - proxyWebsockets = true; - }; - }; - }; }; openssh = { enable = true; diff --git a/custom/clipedit/default.nix b/custom/clipedit/default.nix index c465baa..9ade3f8 100644 --- a/custom/clipedit/default.nix +++ b/custom/clipedit/default.nix @@ -1,5 +1,10 @@ -{ writeShellScriptBin, lib, xclip, coreutils, terminal-command ? "kitty sh -c" -, editor-command ? "hx" }: +{ writeShellScriptBin +, lib +, xclip +, coreutils +, terminal-command ? "kitty sh -c" +, editor-command ? "hx" +}: # 64 │ function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; } # 65 │ function clippaste() { xclip -out -selection clipboard; } clip writeShellScriptBin "clipedit" '' diff --git a/custom/default.nix b/custom/default.nix index 50e07f6..768d8cf 100644 --- a/custom/default.nix +++ b/custom/default.nix @@ -9,4 +9,5 @@ let update-background = pkgs.callPackage ./update-background { }; vital-synth = pkgs.callPackage ./vital-synth { }; }; -in self +in +self diff --git a/custom/lockscreen/default.nix b/custom/lockscreen/default.nix index d59d741..16e1f84 100644 --- a/custom/lockscreen/default.nix +++ b/custom/lockscreen/default.nix @@ -1,7 +1,15 @@ -{ lib, rice, roboto, i3lock-color, writeScriptBin, font ? { - package = roboto; - name = "Roboto"; -}, palette ? rice.palette.palette { }, ... }: +{ lib +, rice +, roboto +, i3lock-color +, writeScriptBin +, font ? { + package = roboto; + name = "Roboto"; + } +, palette ? rice.palette.palette { } +, ... +}: let strPalette = lib.nix-rice.palette.toRGBAHex palette; in writeScriptBin "lockscreen" '' # Using font package ${font.package} diff --git a/custom/update-background/default.nix b/custom/update-background/default.nix index d57f2e8..92d3c17 100644 --- a/custom/update-background/default.nix +++ b/custom/update-background/default.nix @@ -1,10 +1,17 @@ -{ feh, glib, findutils, gnugrep, coreutils, writeScriptBin -, backgrounds_directory ? "$HOME/Immagini/Sfondi" }: +{ feh +, glib +, findutils +, gnugrep +, coreutils +, writeScriptBin +, backgrounds_directory ? "$HOME/Immagini/Sfondi" +}: let find = "${findutils}/bin/find"; grep = "${gnugrep}/bin/grep"; shuf = "${coreutils}/bin/shuf"; -in writeScriptBin "update-background" '' +in +writeScriptBin "update-background" '' #!/bin/sh if [ $# -eq 0 ]; then image=`${find} ${backgrounds_directory} -type f | ${grep} -v "/\." | ${shuf} -n 1` diff --git a/flake.nix b/flake.nix index 4f19531..b405aa9 100644 --- a/flake.nix +++ b/flake.nix @@ -43,9 +43,20 @@ }; }; - outputs = { self, nixpkgs, nixpkgs-u, home-manager, agenix, deploy-rs - , flake-utils, nixos-generators, nixos-hardware, nix-rice, pre-commit-hooks - , tex2nix }: + outputs = + { self + , nixpkgs + , nixpkgs-u + , home-manager + , agenix + , deploy-rs + , flake-utils + , nixos-generators + , nixos-hardware + , nix-rice + , pre-commit-hooks + , tex2nix + }: let config = { allowUnfree = true; @@ -98,16 +109,14 @@ eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system config overlays; }; in { - formatter = pkgs.writeShellScriptBin "formatter" '' - ${pkgs.findutils}/bin/find . -name '*.nix' -exec ${pkgs.nixfmt}/bin/nixfmt {} \+ - ''; + formatter = pkgs.nixpkgs-fmt; checks = { pre-commit-check = pre-commit-hooks.lib.${system}.run { src = ./.; hooks = { deadnix.enable = true; - nixfmt.enable = true; + nixpkgs-fmt.enable = true; statix.enable = true; }; }; @@ -235,37 +244,39 @@ }; odinConfig = { - nixosConfigurations = let - odinCommonModules = [ - nixos-hardware.nixosModules.common-cpu-intel - nixos-hardware.nixosModules.common-pc-laptop - nixos-hardware.nixosModules.common-pc-laptop-ssd - ./odin/hardware-configuration.nix - ./odin/common_configuration.nix + nixosConfigurations = + let + odinCommonModules = [ + nixos-hardware.nixosModules.common-cpu-intel + nixos-hardware.nixosModules.common-pc-laptop + nixos-hardware.nixosModules.common-pc-laptop-ssd + ./odin/hardware-configuration.nix + ./odin/common_configuration.nix - ./nixos_modules/pro_audio.nix - ./nixos_modules/sesar.nix - ./nixos_modules/pentablet.nix - ./nixos_modules/steam-link.nix - ./nixos_modules/kdeconnect.nix + ./nixos_modules/pro_audio.nix + ./nixos_modules/sesar.nix + ./nixos_modules/pentablet.nix + ./nixos_modules/steam-link.nix + ./nixos_modules/kdeconnect.nix - { home-manager.users.bertof = import ./odin/hm.nix; } - ]; - in rec { - odin-nvidia = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = commonModules ++ odinCommonModules - ++ [ ./odin/configuration-nvidia.nix ]; + { home-manager.users.bertof = import ./odin/hm.nix; } + ]; + in + rec { + odin-nvidia = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = commonModules ++ odinCommonModules + ++ [ ./odin/configuration-nvidia.nix ]; + }; + + odin-intel = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = commonModules ++ odinCommonModules + ++ [ ./odin/configuration-intel.nix ]; + }; + + odin = odin-intel; }; - - odin-intel = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = commonModules ++ odinCommonModules - ++ [ ./odin/configuration-intel.nix ]; - }; - - odin = odin-intel; - }; }; # freyaConfig = { @@ -380,7 +391,8 @@ }; }); - in builtins.foldl' nixpkgs.lib.recursiveUpdate { } [ + in + builtins.foldl' nixpkgs.lib.recursiveUpdate { } [ basic thorConfig odinConfig diff --git a/hm_modules/alacritty.nix b/hm_modules/alacritty.nix index 2100b3a..96ee39d 100644 --- a/hm_modules/alacritty.nix +++ b/hm_modules/alacritty.nix @@ -21,7 +21,8 @@ let }; }; }; -in { +in +{ # Include fonts packages home.packages = [ pkgs.rice.font.monospace.package ]; programs.alacritty = { diff --git a/hm_modules/autorandr.nix b/hm_modules/autorandr.nix index 9d265e9..83c9eb0 100644 --- a/hm_modules/autorandr.nix +++ b/hm_modules/autorandr.nix @@ -1,100 +1,102 @@ { programs.autorandr = { enable = true; - profiles = let - dell-laptop = { - dpi = 96; - fingerprint = - "00ffffffffffff0030e43f0500000000001a010495221378eaa1c59459578f27205054000000010101010101010101010101010101012e3680a070381f403020350058c21000001a5c2b80a070381f403020350058c21000001a000000fe0034584b3133803135365746360a000000000000413196001000000a010a202000c5"; - mode = "1920x1080"; - }; - in { - odin-nvidia = { - fingerprint = { "eDP-1-1" = dell-laptop.fingerprint; }; - config = { - "eDP-1-1" = { - inherit (dell-laptop) mode dpi; - primary = true; - crtc = 0; + profiles = + let + dell-laptop = { + dpi = 96; + fingerprint = + "00ffffffffffff0030e43f0500000000001a010495221378eaa1c59459578f27205054000000010101010101010101010101010101012e3680a070381f403020350058c21000001a5c2b80a070381f403020350058c21000001a000000fe0034584b3133803135365746360a000000000000413196001000000a010a202000c5"; + mode = "1920x1080"; + }; + in + { + odin-nvidia = { + fingerprint = { "eDP-1-1" = dell-laptop.fingerprint; }; + config = { + "eDP-1-1" = { + inherit (dell-laptop) mode dpi; + primary = true; + crtc = 0; + }; + }; + }; + odin-intel = { + fingerprint = { "eDP1" = dell-laptop.fingerprint; }; + config = { + "eDP1" = { + inherit (dell-laptop) mode dpi; + primary = true; + crtc = 0; + }; + }; + }; + odin-intel-laboratorio-dock-dell = { + fingerprint = { + "DP1-3" = + "00ffffffffffff0010ac10d04c36453221110103682b1b78ee8db0a2544a9c25115054a54b00714f818001010101010101010101010121399030621a274068b03600ae0e1100001c000000ff00434b3632373738413245364c0a000000fd00384b1e530f000a202020202020000000fc0044454c4c20453230375746500a0088"; + "eDP1" = dell-laptop.fingerprint; + }; + config = { + "DP1-3" = { + crtc = 1; + mode = "1680x1050"; + position = "120x0"; + primary = true; + dpi = 96; + }; + "eDP1" = { + inherit (dell-laptop) mode dpi; + crtc = 0; + position = "0x1080"; + }; + }; + }; + odin-intel-laboratorio = { + fingerprint = { + "DP1-3" = + "00ffffffffffff0010ac71404c473344281601030e331d78eadd45a3554fa027125054a54b00714f8180d1c001010101010101010101023a801871382d40582c4500fe1f1100001e000000ff004b463837593241364433474c0a000000fc0044454c4c205532333132484d0a000000fd00384c1e5311000a2020202020200081"; + "eDP1" = dell-laptop.fingerprint; + }; + config = { + "DP1-3" = { + crtc = 1; + mode = "1920x1080"; + position = "0x0"; + primary = true; + dpi = 96; + }; + "eDP1" = { + inherit (dell-laptop) mode dpi; + crtc = 0; + position = "0x1080"; + }; + }; + }; + thor-default = { + fingerprint = { + "DP-2" = + "00ffffffffffff001e6d7f5ba1c60a00011f0104b53c22789f8cb5af4f43ab260e5054254b007140818081c0a9c0b300d1c08100d1cf09ec00a0a0a0675030203a0055502100001a000000fd0030901ee63c000a202020202020000000fc004c4720554c545241474541520a000000ff003130314e5454514c533230390a017102031a7123090607e305c000e606050160592846100403011f136fc200a0a0a0555030203a0055502100001a565e00a0a0a029503020350055502100001a5aa000a0a0a0465030203a005550210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000da"; + "HDMI-0" = + "00ffffffffffff004c2d2c0d443650302e19010380341d782a5295a556549d250e5054bb8c00b30081c0810081809500a9c001010101023a801871382d40582c450009252100001e000000fd0030481e5216000a202020202020000000fc00433234463339300a2020202020000000ff00485451483330353636370a20200163020324f14690041f131203230907078301000067030c001000802b681a00000101304800011d00bc52d01e20b828554009252100001e8c0ad090204031200c4055000925210000188c0ad08a20e02d10103e9600092521000018215280a07238304088c8350009252100001c00000000000000000000000000000000000000fa"; + }; + config = { + "DP-2" = { + crtc = 0; + mode = "2560x1440"; + position = "1080x162"; + primary = true; + dpi = 96; + }; + "HDMI-0" = { + crtc = 1; + mode = "1920x1080"; + position = "0x0"; + rotate = "right"; + dpi = 96; + }; }; }; }; - odin-intel = { - fingerprint = { "eDP1" = dell-laptop.fingerprint; }; - config = { - "eDP1" = { - inherit (dell-laptop) mode dpi; - primary = true; - crtc = 0; - }; - }; - }; - odin-intel-laboratorio-dock-dell = { - fingerprint = { - "DP1-3" = - "00ffffffffffff0010ac10d04c36453221110103682b1b78ee8db0a2544a9c25115054a54b00714f818001010101010101010101010121399030621a274068b03600ae0e1100001c000000ff00434b3632373738413245364c0a000000fd00384b1e530f000a202020202020000000fc0044454c4c20453230375746500a0088"; - "eDP1" = dell-laptop.fingerprint; - }; - config = { - "DP1-3" = { - crtc = 1; - mode = "1680x1050"; - position = "120x0"; - primary = true; - dpi = 96; - }; - "eDP1" = { - inherit (dell-laptop) mode dpi; - crtc = 0; - position = "0x1080"; - }; - }; - }; - odin-intel-laboratorio = { - fingerprint = { - "DP1-3" = - "00ffffffffffff0010ac71404c473344281601030e331d78eadd45a3554fa027125054a54b00714f8180d1c001010101010101010101023a801871382d40582c4500fe1f1100001e000000ff004b463837593241364433474c0a000000fc0044454c4c205532333132484d0a000000fd00384c1e5311000a2020202020200081"; - "eDP1" = dell-laptop.fingerprint; - }; - config = { - "DP1-3" = { - crtc = 1; - mode = "1920x1080"; - position = "0x0"; - primary = true; - dpi = 96; - }; - "eDP1" = { - inherit (dell-laptop) mode dpi; - crtc = 0; - position = "0x1080"; - }; - }; - }; - thor-default = { - fingerprint = { - "DP-2" = - "00ffffffffffff001e6d7f5ba1c60a00011f0104b53c22789f8cb5af4f43ab260e5054254b007140818081c0a9c0b300d1c08100d1cf09ec00a0a0a0675030203a0055502100001a000000fd0030901ee63c000a202020202020000000fc004c4720554c545241474541520a000000ff003130314e5454514c533230390a017102031a7123090607e305c000e606050160592846100403011f136fc200a0a0a0555030203a0055502100001a565e00a0a0a029503020350055502100001a5aa000a0a0a0465030203a005550210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000da"; - "HDMI-0" = - "00ffffffffffff004c2d2c0d443650302e19010380341d782a5295a556549d250e5054bb8c00b30081c0810081809500a9c001010101023a801871382d40582c450009252100001e000000fd0030481e5216000a202020202020000000fc00433234463339300a2020202020000000ff00485451483330353636370a20200163020324f14690041f131203230907078301000067030c001000802b681a00000101304800011d00bc52d01e20b828554009252100001e8c0ad090204031200c4055000925210000188c0ad08a20e02d10103e9600092521000018215280a07238304088c8350009252100001c00000000000000000000000000000000000000fa"; - }; - config = { - "DP-2" = { - crtc = 0; - mode = "2560x1440"; - position = "1080x162"; - primary = true; - dpi = 96; - }; - "HDMI-0" = { - crtc = 1; - mode = "1920x1080"; - position = "0x0"; - rotate = "right"; - dpi = 96; - }; - }; - }; - }; }; } diff --git a/hm_modules/bspwm.nix b/hm_modules/bspwm.nix index 6eda653..8ff577d 100644 --- a/hm_modules/bspwm.nix +++ b/hm_modules/bspwm.nix @@ -13,7 +13,8 @@ let systemctl --user restart kdeconnect-indicator # Restart polybar ''; strPalette = palette.toRGBHex pkgs.rice.colorPalette; -in { +in +{ xsession.windowManager.bspwm = { enable = true; settings = { diff --git a/hm_modules/cava.nix b/hm_modules/cava.nix index 61b1059..6eeabe1 100644 --- a/hm_modules/cava.nix +++ b/hm_modules/cava.nix @@ -2,7 +2,8 @@ let strPalette = pkgs.lib.nix-rice.palette.toRgbHex pkgs.rice.colorPalette; fmtString = str: "'${str}'"; -in { +in +{ home.packages = [ pkgs.cava ]; xdg.configFile."cava/config".text = lib.generators.toINI { } { diff --git a/hm_modules/development/cpp.nix b/hm_modules/development/cpp.nix index 35be769..261a725 100644 --- a/hm_modules/development/cpp.nix +++ b/hm_modules/development/cpp.nix @@ -1,8 +1,9 @@ { 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 { + 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; }; } diff --git a/hm_modules/development/data.nix b/hm_modules/development/data.nix index 929f90f..ac5b325 100644 --- a/hm_modules/development/data.nix +++ b/hm_modules/development/data.nix @@ -1,9 +1,10 @@ { 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 { + 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; }; diff --git a/hm_modules/development/javascript.nix b/hm_modules/development/javascript.nix index cc31aa4..6a34662 100644 --- a/hm_modules/development/javascript.nix +++ b/hm_modules/development/javascript.nix @@ -1,8 +1,9 @@ { 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 { + 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; diff --git a/hm_modules/development/latex.nix b/hm_modules/development/latex.nix index 783a85c..ad4a4f6 100644 --- a/hm_modules/development/latex.nix +++ b/hm_modules/development/latex.nix @@ -2,7 +2,7 @@ home.packages = [ pkgs.bibtool pkgs.texlive.combined.scheme-medium ] ++ lib.optionals config.programs.helix.enable [ pkgs.texlab ] ++ lib.optionals config.programs.kakoune.enable (builtins.attrValues { - inherit (pkgs) texlab aspell; - inherit (pkgs.aspellDicts) en en-computers en-science it; - }); + inherit (pkgs) texlab aspell; + inherit (pkgs.aspellDicts) en en-computers en-science it; + }); } diff --git a/hm_modules/development/nix.nix b/hm_modules/development/nix.nix index c3f6b7e..db6e59e 100644 --- a/hm_modules/development/nix.nix +++ b/hm_modules/development/nix.nix @@ -1,7 +1,8 @@ { pkgs, config, lib, ... }: { - home.packages = builtins.attrValues { - inherit (pkgs) nixpkgs-fmt nixfmt nix-prefetch-scripts nix-review nix-tree; - } ++ lib.optionals config.programs.helix.enable [ pkgs.nil ] - ++ lib.optionals config.programs.kakoune.enable [ pkgs.rnix-lsp ]; + home.packages = builtins.attrValues + { + inherit (pkgs) nixpkgs-fmt nixfmt nix-prefetch-scripts nix-review nix-tree; + } ++ lib.optionals config.programs.helix.enable [ pkgs.nil ] + ++ lib.optionals config.programs.kakoune.enable [ pkgs.rnix-lsp ]; programs.neovim.plugins = [ pkgs.vimPlugins.vim-nix ]; } diff --git a/hm_modules/development/python.nix b/hm_modules/development/python.nix index 1715ab6..48cbaad 100644 --- a/hm_modules/development/python.nix +++ b/hm_modules/development/python.nix @@ -1,9 +1,9 @@ { pkgs, lib, config, ... }: { home.packages = [ pkgs.black ] ++ lib.optionals config.programs.helix.enable builtins.attrValues { - inherit (pkgs.python3Packages) python-lsp-server pyls-flake8 pyls-isort; - } ++ lib.optionals config.programs.kakoune.enable builtins.attrValues { - inherit (pkgs.python3Packages) python-lsp-server pyls-flake8 pyls-isort; - }; + inherit (pkgs.python3Packages) python-lsp-server pyls-flake8 pyls-isort; + } ++ lib.optionals config.programs.kakoune.enable builtins.attrValues { + inherit (pkgs.python3Packages) python-lsp-server pyls-flake8 pyls-isort; + }; programs.neovim.withPython3 = true; } diff --git a/hm_modules/development/rust.nix b/hm_modules/development/rust.nix index 146367f..e1b91a4 100644 --- a/hm_modules/development/rust.nix +++ b/hm_modules/development/rust.nix @@ -1,19 +1,20 @@ { pkgs, lib, config, ... }: { - 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-inspect - cargo-modules cargo-outdated cargo-profiler cargo-release cargo-show-asm - cargo-spellcheck cargo-tarpaulin cargo-udeps cargo-watch cargo-workspaces - clippy rustc rustfmt; - # cargo-about - # cargo-auditable - # cargo-deny - # cargo-deps - # cargo-feature + 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-inspect + cargo-modules cargo-outdated cargo-profiler cargo-release cargo-show-asm + cargo-spellcheck cargo-tarpaulin cargo-udeps cargo-watch cargo-workspaces + clippy rustc rustfmt; + # cargo-about + # cargo-auditable + # cargo-deny + # cargo-deps + # cargo-feature - } ++ lib.optionals config.programs.helix.enable + } ++ lib.optionals config.programs.helix.enable (builtins.attrValues { inherit (pkgs) lldb rust-analyzer; }) - ++ lib.optionals config.programs.kakoune.enable + ++ lib.optionals config.programs.kakoune.enable (builtins.attrValues { inherit (pkgs) rust-analyzer; }); } diff --git a/hm_modules/dwarf-fortress.nix b/hm_modules/dwarf-fortress.nix index 1d553f6..2268991 100644 --- a/hm_modules/dwarf-fortress.nix +++ b/hm_modules/dwarf-fortress.nix @@ -5,4 +5,5 @@ let theme = themes.ironhand; enableFPS = true; }; -in { home.packages = [ package ]; } +in +{ home.packages = [ package ]; } diff --git a/hm_modules/fonts.nix b/hm_modules/fonts.nix index 497be0b..ff2f2ad 100644 --- a/hm_modules/fonts.nix +++ b/hm_modules/fonts.nix @@ -3,7 +3,7 @@ home.packages = builtins.attrValues { inherit (pkgs) dejavu_fonts noto-fonts noto-fonts-extra noto-fonts-cjk-sans font-awesome - corefonts # Microsoft fonts + corefonts# Microsoft fonts vistafonts; }; } diff --git a/hm_modules/git.nix b/hm_modules/git.nix index 3281f7c..edad598 100644 --- a/hm_modules/git.nix +++ b/hm_modules/git.nix @@ -87,7 +87,8 @@ let "gup" = "git pull --rebase"; "gupv" = "git pull --rebase -v"; }; -in { +in +{ programs.git = { enable = true; userName = "Filippo Berto"; diff --git a/hm_modules/gnome_shell.nix b/hm_modules/gnome_shell.nix index cef0309..f182fa8 100644 --- a/hm_modules/gnome_shell.nix +++ b/hm_modules/gnome_shell.nix @@ -28,4 +28,5 @@ let user-themes # vitals ]; -in { home.packages = [ pkgs.gnome.gnome-tweaks ] ++ gnomeExtensions; } +in +{ home.packages = [ pkgs.gnome.gnome-tweaks ] ++ gnomeExtensions; } diff --git a/hm_modules/helix.nix b/hm_modules/helix.nix index e743078..46f9963 100644 --- a/hm_modules/helix.nix +++ b/hm_modules/helix.nix @@ -26,7 +26,8 @@ let "text/x-c++" ]; }; -in { +in +{ programs.bash.shellAliases = { x = "hx"; }; programs.zsh.shellAliases = { x = "hx"; }; home.sessionVariables = { @@ -40,95 +41,101 @@ in { programs.helix = { enable = true; package = pkgs.unstable_pkgs.helix; - languages = [ ]; + languages = [{ + name = "nix"; + formatter = { command = "nixpkgs-fmt"; }; + # config = { nil = { formatting = { command = "nixpkgs-fmt"; }; }; }; + }]; settings = { theme = "ayu_mirage"; editor.lsp.display-messages = true; editor.scrolloff = 5; editor.true-color = true; - editor.soft-wrap.enable = true; + # editor.soft-wrap.enable = true; keys.normal = { "C-A-l" = ":format"; "C-A-r" = ":reload"; "C-A-S-r" = ":reload-all"; }; }; - 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; + 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; }; - "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; }; - }; }; } diff --git a/hm_modules/kakoune.nix b/hm_modules/kakoune.nix index e82244c..2f1e5e2 100644 --- a/hm_modules/kakoune.nix +++ b/hm_modules/kakoune.nix @@ -61,7 +61,8 @@ let inherit desktopItem; }; -in { +in +{ programs.bash.shellAliases = { k = "kak"; }; programs.zsh.shellAliases = { k = "kak"; }; home.packages = packages; diff --git a/hm_modules/kitty.nix b/hm_modules/kitty.nix index 35eb307..0e90fd2 100644 --- a/hm_modules/kitty.nix +++ b/hm_modules/kitty.nix @@ -5,7 +5,8 @@ let background foreground color0 color1 color2 color3 color4 color5 color6 color7 color8 color9 color10 color11 color12 color13 color14 color15; }; -in { +in +{ programs.kitty = { enable = true; settings = { diff --git a/hm_modules/lf.nix b/hm_modules/lf.nix index 8799236..15152f7 100644 --- a/hm_modules/lf.nix +++ b/hm_modules/lf.nix @@ -17,7 +17,8 @@ let ${pkgs.pistol}/bin/pistol "$file" ''; -in { +in +{ programs.lf = { enable = true; settings = { diff --git a/hm_modules/libinput-gestures.nix b/hm_modules/libinput-gestures.nix index 64135ca..a8c844c 100644 --- a/hm_modules/libinput-gestures.nix +++ b/hm_modules/libinput-gestures.nix @@ -2,7 +2,8 @@ let libinputGesturesCmd = "${pkgs.libinput-gestures}/bin/libinput-gestures"; xdotool = "${pkgs.xdotool}/bin/xdotool"; -in { +in +{ systemd.user.services."libinput-gestures" = { Unit = { Description = "Touchpad gestures"; diff --git a/hm_modules/polybar.nix b/hm_modules/polybar.nix index 66152ab..6ff848d 100644 --- a/hm_modules/polybar.nix +++ b/hm_modules/polybar.nix @@ -109,7 +109,8 @@ let }; ramp = [ "▂" "▃" "▄" "▅" "▆" "▇" ]; -in { +in +{ home.packages = builtins.attrValues { inherit (pkgs) noto-fonts material-design-icons noto-fonts-cjk-sans; # emojione @@ -190,20 +191,22 @@ in { type = "internal/bspwm"; format = ""; - label = let - common = { - padding = 1; - # separator = " "; - text = "%name%"; + label = + let + common = { + padding = 1; + # separator = " "; + text = "%name%"; + }; + in + { + focused = recursiveUpdate common colors.selected; + occupied = recursiveUpdate common colors.active; + urgent = recursiveUpdate (recursiveUpdate common colors.active) { + background = colors.alert; + }; + empty = recursiveUpdate common colors.normal; }; - in { - focused = recursiveUpdate common colors.selected; - occupied = recursiveUpdate common colors.active; - urgent = recursiveUpdate (recursiveUpdate common colors.active) { - background = colors.alert; - }; - empty = recursiveUpdate common colors.normal; - }; }; "module/cpu" = { @@ -298,40 +301,42 @@ in { open = recursiveUpdate colors.normal { text = "●"; }; close = recursiveUpdate colors.normal { text = ""; }; }; - menu = [[ - { - text = ""; - exec = confirm_command { - cmd = logout; - title = "Logout"; - text = "Do you want to logout?"; - }; - } - { - text = ""; - exec = confirm_command { - cmd = "${systemctl} reboot"; - title = "Reboot"; - text = "Do you want to reboot?"; - }; - } - { - text = ""; - exec = confirm_command { - cmd = "${systemctl} hibernate"; - title = "Hibernate"; - text = "Do you want to hibernate?"; - }; - } - { - text = ""; - exec = confirm_command { - cmd = "${shutdown} now"; - title = "Shutdown"; - text = "Do you want to shutdown?"; - }; - } - ]]; + menu = [ + [ + { + text = ""; + exec = confirm_command { + cmd = logout; + title = "Logout"; + text = "Do you want to logout?"; + }; + } + { + text = ""; + exec = confirm_command { + cmd = "${systemctl} reboot"; + title = "Reboot"; + text = "Do you want to reboot?"; + }; + } + { + text = ""; + exec = confirm_command { + cmd = "${systemctl} hibernate"; + title = "Hibernate"; + text = "Do you want to hibernate?"; + }; + } + { + text = ""; + exec = confirm_command { + cmd = "${shutdown} now"; + title = "Shutdown"; + text = "Do you want to shutdown?"; + }; + } + ] + ]; }; "module/notifications" = { diff --git a/hm_modules/pro_audio.nix b/hm_modules/pro_audio.nix index da6116b..21176bc 100644 --- a/hm_modules/pro_audio.nix +++ b/hm_modules/pro_audio.nix @@ -13,7 +13,8 @@ let VST_PATH = "$HOME/.vst:${userLibFolder}/vst:${systemLibFolder}/vst"; VST3_PATH = "$HOME/.vst3:${userLibFolder}/vst3:${systemLibFolder}/vst3"; }; -in { +in +{ home.packages = builtins.attrValues { inherit (pkgs) carla rnnoise ardour diff --git a/hm_modules/research.nix b/hm_modules/research.nix index 5f83e63..0102482 100644 --- a/hm_modules/research.nix +++ b/hm_modules/research.nix @@ -1,8 +1,8 @@ { pkgs, ... }: { home.packages = builtins.attrValues { inherit (pkgs.unstable_pkgs) - # mendeley # Reference manager - obsidian # Note manager - ; + # mendeley # Reference manager + obsidian# Note manager + ; }; } diff --git a/hm_modules/security.nix b/hm_modules/security.nix index 032b502..fa17341 100644 --- a/hm_modules/security.nix +++ b/hm_modules/security.nix @@ -1,18 +1,18 @@ { pkgs, ... }: { home.packages = builtins.attrValues { inherit (pkgs) - nmap # RECOGNITION + nmap# RECOGNITION # WEB httpie # altair # burpsuite - bintools ghidra-bin radare2 # REVERSING + bintools ghidra-bin radare2# REVERSING # cutter # INFRASTRUCTURE # cocktail-bar-cli - ; + ; }; } diff --git a/hm_modules/sxhkd.nix b/hm_modules/sxhkd.nix index cad0bbc..bd8448a 100644 --- a/hm_modules/sxhkd.nix +++ b/hm_modules/sxhkd.nix @@ -5,97 +5,99 @@ ]; home.packages = builtins.attrValues { inherit (pkgs) - # bc + # bc bsp-layout clipedit lockscreen terminator; # required by bsp-layout }; - services.sxhkd = let - primaryTerminal = "kitty"; - secondaryTerminal = "terminator"; - fileManager = "nautilus"; - secondaryFileManager = "thunar"; - emojiChooser = "rofimoji --skin-tone light -a copy"; - yad = "${pkgs.yad}/bin/yad"; - notify = "${pkgs.libnotify}/bin/notify-send"; - pamixer = "${pkgs.pamixer}/bin/pamixer"; - playerctl = "${pkgs.playerctl}/bin/playerctl"; - xbacklight = "${pkgs.xorg.xbacklight}/bin/xbacklight"; - resetBspwm = pkgs.writeShellScript "resetBspwm" '' - bspc wm -r - systemctl --user restart polybar # Restart polybar - ''; - moveAllNodesToPrimary = pkgs.writeShellScript "moveAllNodesToPrimary" '' - comm -23 <(bspc query -N | sort) <(bspc query -m primary -N | sort) | while read n; do bspc node $n -m primary; done - ''; - notifyVolume = pkgs.writeShellScript "notifyVolume" '' - volume=`${pamixer} --get-volume` - ${notify} -r 1 -h "int:value:$volume" "Volume $volume%" - ''; - notifyBrightness = pkgs.writeShellScript "notifyBrightness" '' - level=`printf "%.0f" $(${xbacklight} -get)` - ${notify} -r 2 -h "int:value:$level" "Luminosità $level" - ''; - in { - enable = true; - keybindings = { - "alt + Tab" = "rofi -show window"; - "Print" = "${pkgs.gnome.gnome-screenshot}/bin/gnome-screenshot"; - "super + alt + {h,j,k,l}" = - "bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}"; - "super + alt + m" = "lockscreen"; - "super + alt + p" = "autorandr -c"; - "super + alt + shift + p" = "arandr"; - "super + alt + q" = '' - ${yad} --question --center --on-top --sticky --timeout=30 --timeout-indicator=bottom --image=gnome-shutdown --title "Shutdown" --text "Do you want to shutdown?" && bspc quit + services.sxhkd = + let + primaryTerminal = "kitty"; + secondaryTerminal = "terminator"; + fileManager = "nautilus"; + secondaryFileManager = "thunar"; + emojiChooser = "rofimoji --skin-tone light -a copy"; + yad = "${pkgs.yad}/bin/yad"; + notify = "${pkgs.libnotify}/bin/notify-send"; + pamixer = "${pkgs.pamixer}/bin/pamixer"; + playerctl = "${pkgs.playerctl}/bin/playerctl"; + xbacklight = "${pkgs.xorg.xbacklight}/bin/xbacklight"; + resetBspwm = pkgs.writeShellScript "resetBspwm" '' + bspc wm -r + systemctl --user restart polybar # Restart polybar ''; - "super + alt + o" = "${moveAllNodesToPrimary}"; - "super + alt + r" = "${resetBspwm}"; - "super + alt + shift + {h,j,k,l}" = - "bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}"; - "super + bracket{left,right}" = "bspc desktop -f {prev,next}.local"; - "super + b" = "${pkgs.update-background}/bin/update-background"; - "super + ctrl + {1-9}" = "bspc node -o 0.{1-9}"; - "super + ctrl + {h,j,k,l}" = "bspc node -p {west,south,north,east}"; - "super + ctrl + {m,x,y,z}" = - "bspc node -g {marked,locked,sticky,private}"; - "super + ctrl + shift + space" = - "bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel"; - "super + ctrl + space" = "bspc node -p cancel"; - "super + e {_,+shift}" = "{${fileManager},${secondaryFileManager}}"; - "super + shift + p" = "clipedit"; - "super + Escape" = "pkill -USR1 -x sxhkd"; - "super + g" = "bspc node -s biggest"; - "super + {grave,Tab}" = "bspc {node,desktop} -f last"; - "super + {h,j,k,l}" = - "dir={west,south,north,east}; bspc node -f $dir || bspc monitor -f $dir"; - "super + {Left,Down,Up,Right}" = "bspc node -v {-20 0,0 20,0 -20,20 0}"; - "super + m" = "bspc desktop -l next"; - "super + n {_, + shift}" = "bsp-layout {next, previous}"; - "super + {o,i}" = - "bspc wm -h off;bspc node {older,newer} -f;bspc wm -h on"; - "super + {p,b,comma,period}" = - "bspc node -f @{parent,brother,first,second}"; - "super + {_,shift + }{1-9,0}" = - "bspc {desktop -f,node -d} 'focused:^{1-9,10}'"; - "super + {_,shift + } c" = "bspc node -f {next,prev}.local"; - "super + {_,shift + } space" = "rofi -show {drun,run}"; - "super + shift + ctrl + d" = "rofi -show ssh"; - "super + alt + e" = emojiChooser; - "super + shift + {h,j,k,l}" = '' - dir={west,south,north,east}; bspc node -s "$dir.local" --follow || bspc node -m "$dir" --follow + moveAllNodesToPrimary = pkgs.writeShellScript "moveAllNodesToPrimary" '' + comm -23 <(bspc query -N | sort) <(bspc query -m primary -N | sort) | while read n; do bspc node $n -m primary; done ''; - "super + {_,shift + } Return" = - "{${primaryTerminal} , ${secondaryTerminal}}"; - "super + {_,shift + } w" = "bspc node -{c,k}"; - "super + {t,shift + t,s,f}" = - "bspc node -t {tiled,pseudo_tiled,floating,fullscreen}"; - # "super + y" = "bspc node newest.marked.local -n newest.!automatic.local"; - "XF86Audio{LowerVolume,Mute,RaiseVolume}" = - "${pamixer} {-d 2 -u,-t,-i 2 -u} && ${notifyVolume}"; - "XF86Audio{Next,Play,Prev}" = "${playerctl} {next,play-pause,previous}"; - "super + alt + {Right,Down,Left}" = - "${playerctl} {next,play-pause,previous}"; - "XF86MonBrightness{Up,Down}" = - " ${xbacklight} -{inc,dec} 10 && ${notifyBrightness}"; + notifyVolume = pkgs.writeShellScript "notifyVolume" '' + volume=`${pamixer} --get-volume` + ${notify} -r 1 -h "int:value:$volume" "Volume $volume%" + ''; + notifyBrightness = pkgs.writeShellScript "notifyBrightness" '' + level=`printf "%.0f" $(${xbacklight} -get)` + ${notify} -r 2 -h "int:value:$level" "Luminosità $level" + ''; + in + { + enable = true; + keybindings = { + "alt + Tab" = "rofi -show window"; + "Print" = "${pkgs.gnome.gnome-screenshot}/bin/gnome-screenshot"; + "super + alt + {h,j,k,l}" = + "bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}"; + "super + alt + m" = "lockscreen"; + "super + alt + p" = "autorandr -c"; + "super + alt + shift + p" = "arandr"; + "super + alt + q" = '' + ${yad} --question --center --on-top --sticky --timeout=30 --timeout-indicator=bottom --image=gnome-shutdown --title "Shutdown" --text "Do you want to shutdown?" && bspc quit + ''; + "super + alt + o" = "${moveAllNodesToPrimary}"; + "super + alt + r" = "${resetBspwm}"; + "super + alt + shift + {h,j,k,l}" = + "bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}"; + "super + bracket{left,right}" = "bspc desktop -f {prev,next}.local"; + "super + b" = "${pkgs.update-background}/bin/update-background"; + "super + ctrl + {1-9}" = "bspc node -o 0.{1-9}"; + "super + ctrl + {h,j,k,l}" = "bspc node -p {west,south,north,east}"; + "super + ctrl + {m,x,y,z}" = + "bspc node -g {marked,locked,sticky,private}"; + "super + ctrl + shift + space" = + "bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel"; + "super + ctrl + space" = "bspc node -p cancel"; + "super + e {_,+shift}" = "{${fileManager},${secondaryFileManager}}"; + "super + shift + p" = "clipedit"; + "super + Escape" = "pkill -USR1 -x sxhkd"; + "super + g" = "bspc node -s biggest"; + "super + {grave,Tab}" = "bspc {node,desktop} -f last"; + "super + {h,j,k,l}" = + "dir={west,south,north,east}; bspc node -f $dir || bspc monitor -f $dir"; + "super + {Left,Down,Up,Right}" = "bspc node -v {-20 0,0 20,0 -20,20 0}"; + "super + m" = "bspc desktop -l next"; + "super + n {_, + shift}" = "bsp-layout {next, previous}"; + "super + {o,i}" = + "bspc wm -h off;bspc node {older,newer} -f;bspc wm -h on"; + "super + {p,b,comma,period}" = + "bspc node -f @{parent,brother,first,second}"; + "super + {_,shift + }{1-9,0}" = + "bspc {desktop -f,node -d} 'focused:^{1-9,10}'"; + "super + {_,shift + } c" = "bspc node -f {next,prev}.local"; + "super + {_,shift + } space" = "rofi -show {drun,run}"; + "super + shift + ctrl + d" = "rofi -show ssh"; + "super + alt + e" = emojiChooser; + "super + shift + {h,j,k,l}" = '' + dir={west,south,north,east}; bspc node -s "$dir.local" --follow || bspc node -m "$dir" --follow + ''; + "super + {_,shift + } Return" = + "{${primaryTerminal} , ${secondaryTerminal}}"; + "super + {_,shift + } w" = "bspc node -{c,k}"; + "super + {t,shift + t,s,f}" = + "bspc node -t {tiled,pseudo_tiled,floating,fullscreen}"; + # "super + y" = "bspc node newest.marked.local -n newest.!automatic.local"; + "XF86Audio{LowerVolume,Mute,RaiseVolume}" = + "${pamixer} {-d 2 -u,-t,-i 2 -u} && ${notifyVolume}"; + "XF86Audio{Next,Play,Prev}" = "${playerctl} {next,play-pause,previous}"; + "super + alt + {Right,Down,Left}" = + "${playerctl} {next,play-pause,previous}"; + "XF86MonBrightness{Up,Down}" = + " ${xbacklight} -{inc,dec} 10 && ${notifyBrightness}"; + }; }; - }; } diff --git a/hm_modules/terminator.nix b/hm_modules/terminator.nix index b565bfc..3f02b03 100644 --- a/hm_modules/terminator.nix +++ b/hm_modules/terminator.nix @@ -26,7 +26,8 @@ let bright.cyan bright.white ]; -in { +in +{ home.packages = [ pkgs.terminator ]; xdg.configFile."terminator/config".text = with strPalette; '' diff --git a/hm_modules/twmn.nix b/hm_modules/twmn.nix index ca29b27..8497251 100644 --- a/hm_modules/twmn.nix +++ b/hm_modules/twmn.nix @@ -3,7 +3,8 @@ with pkgs.lib.nix-rice; let strPalette = palette.toRGBHex pkgs.rice.colorPalette; font = pkgs.rice.font.normal; -in { +in +{ services.twmn = { enable = true; text = { diff --git a/hm_modules/webapp.nix b/hm_modules/webapp.nix index 013feff..7353481 100644 --- a/hm_modules/webapp.nix +++ b/hm_modules/webapp.nix @@ -75,11 +75,17 @@ let categories = [ "AudioVideo" ]; } ]; - webAppBuilder = { desktopName - , name ? builtins.replaceStrings [ " " ] [ "_" ] desktopName, link - , icon ? lib.toLower name, comment ? null, categories ? [ "Network" ] }: + webAppBuilder = + { desktopName + , name ? builtins.replaceStrings [ " " ] [ "_" ] desktopName + , link + , icon ? lib.toLower name + , comment ? null + , categories ? [ "Network" ] + }: pkgs.makeDesktopItem { inherit name icon desktopName comment categories; exec = cmd link; }; -in { home.packages = map webAppBuilder links; } +in +{ home.packages = map webAppBuilder links; } diff --git a/hm_modules/xidlehook.nix b/hm_modules/xidlehook.nix index 674657b..8105c9d 100644 --- a/hm_modules/xidlehook.nix +++ b/hm_modules/xidlehook.nix @@ -19,7 +19,8 @@ let shutDownScreens = pkgs.writeShellScript "shutdown_screens" '' ${xsetCmd} dpms force off ''; -in { +in +{ services.xidlehook = { enable = true; package = pkgs.writeScriptBin "xidlehook" '' diff --git a/loki/configuration.nix b/loki/configuration.nix index b14a4e2..67292f4 100644 --- a/loki/configuration.nix +++ b/loki/configuration.nix @@ -132,40 +132,42 @@ with lib; { load printers = no smb encrypt = required ''; - shares = let - common = { - "public" = "no"; - "writeable" = "yes"; - "create mask" = "0700"; - "directory mask" = "2700"; - "browseable" = "yes"; - "guest ok" = "no"; - "read only" = "no"; - "force group" = "users"; + shares = + let + common = { + "public" = "no"; + "writeable" = "yes"; + "create mask" = "0700"; + "directory mask" = "2700"; + "browseable" = "yes"; + "guest ok" = "no"; + "read only" = "no"; + "force group" = "users"; + }; + in + { + bertof = recursiveUpdate common { + path = "/home/bertof/"; + comment = "Bertof samba share"; + "force user" = "bertof"; + "valid users" = "bertof"; + }; + tiziano = recursiveUpdate common { + path = "/home/tiziano/"; + comment = "Tiziano samba share"; + "force user" = "tiziano"; + "valid users" = "tiziano"; + }; + condiviso = recursiveUpdate common { + path = "/mnt/raid0/condiviso"; + comment = "Samba share condiviso"; + "valid users" = "bertof tiziano"; + "create mask" = "0770"; + "directory mask" = "2770"; + "force create mode" = "0660"; + "force directory mode" = "2770"; + }; }; - in { - bertof = recursiveUpdate common { - path = "/home/bertof/"; - comment = "Bertof samba share"; - "force user" = "bertof"; - "valid users" = "bertof"; - }; - tiziano = recursiveUpdate common { - path = "/home/tiziano/"; - comment = "Tiziano samba share"; - "force user" = "tiziano"; - "valid users" = "tiziano"; - }; - condiviso = recursiveUpdate common { - path = "/mnt/raid0/condiviso"; - comment = "Samba share condiviso"; - "valid users" = "bertof tiziano"; - "create mask" = "0770"; - "directory mask" = "2770"; - "force create mode" = "0660"; - "force directory mode" = "2770"; - }; - }; }; smartd.enable = true; sonarr = { @@ -239,55 +241,57 @@ with lib; { }; services.snapper = { - configs = let - commonExtraConfig = '' - TIMELINE_CREATE=yes - TIMELINE_CLEANUP=yes - ''; - in { - bertof_raid0 = { - subvolume = "/home/bertof/raid0"; - extraConfig = '' - ALLOW_USERS="bertof" - ${commonExtraConfig} + configs = + let + commonExtraConfig = '' + TIMELINE_CREATE=yes + TIMELINE_CLEANUP=yes ''; + in + { + bertof_raid0 = { + subvolume = "/home/bertof/raid0"; + extraConfig = '' + ALLOW_USERS="bertof" + ${commonExtraConfig} + ''; + }; + tiziano_raid0 = { + subvolume = "/home/tiziano/raid0"; + extraConfig = '' + ALLOW_USERS="tiziano" + ${commonExtraConfig} + ''; + }; + bertof_raid1 = { + subvolume = "/home/bertof/raid1"; + extraConfig = '' + ALLOW_USERS="bertof" + ${commonExtraConfig} + ''; + }; + tiziano_raid1 = { + subvolume = "/home/tiziano/raid1"; + extraConfig = '' + ALLOW_USERS="tiziano" + ${commonExtraConfig} + ''; + }; + condiviso_raid0 = { + subvolume = "/mnt/raid0/condiviso"; + extraConfig = '' + ALLOW_USERS="bertof tiziano" + ${commonExtraConfig} + ''; + }; + condiviso_raid1 = { + subvolume = "/mnt/raid1/condiviso"; + extraConfig = '' + ALLOW_USERS="bertof tiziano" + ${commonExtraConfig} + ''; + }; }; - tiziano_raid0 = { - subvolume = "/home/tiziano/raid0"; - extraConfig = '' - ALLOW_USERS="tiziano" - ${commonExtraConfig} - ''; - }; - bertof_raid1 = { - subvolume = "/home/bertof/raid1"; - extraConfig = '' - ALLOW_USERS="bertof" - ${commonExtraConfig} - ''; - }; - tiziano_raid1 = { - subvolume = "/home/tiziano/raid1"; - extraConfig = '' - ALLOW_USERS="tiziano" - ${commonExtraConfig} - ''; - }; - condiviso_raid0 = { - subvolume = "/mnt/raid0/condiviso"; - extraConfig = '' - ALLOW_USERS="bertof tiziano" - ${commonExtraConfig} - ''; - }; - condiviso_raid1 = { - subvolume = "/mnt/raid1/condiviso"; - extraConfig = '' - ALLOW_USERS="bertof tiziano" - ${commonExtraConfig} - ''; - }; - }; }; networking.firewall = { diff --git a/nixos_modules/big_data.nix b/nixos_modules/big_data.nix index 0b03f69..fcecad0 100644 --- a/nixos_modules/big_data.nix +++ b/nixos_modules/big_data.nix @@ -77,7 +77,8 @@ let STOP ''; }; -in { +in +{ networking = { hosts = { "127.0.0.1" = [ "ds.my.engine" "kdc.my.engine" "my.engine" ]; }; diff --git a/nixos_modules/btrfs_scrub.nix b/nixos_modules/btrfs_scrub.nix index e131095..4f1fdeb 100644 --- a/nixos_modules/btrfs_scrub.nix +++ b/nixos_modules/btrfs_scrub.nix @@ -6,7 +6,8 @@ let filterAttrs (_k: v: v.fsType == "btrfs") config.fileSystems; btrfsDevices = unique (attrValues (mapAttrs (_: v: v.device) btrfsFileSystems)); -in { +in +{ services.btrfs.autoScrub = { enable = btrfsDevices != [ ]; fileSystems = btrfsDevices; diff --git a/nixos_modules/dnsmasq.nix b/nixos_modules/dnsmasq.nix index df07b16..1a025d7 100644 --- a/nixos_modules/dnsmasq.nix +++ b/nixos_modules/dnsmasq.nix @@ -4,7 +4,8 @@ let url = "https://github.com/notracking/hosts-blocklists/raw/master/dnsmasq/dnsmasq.blacklist.txt"; }; -in { +in +{ networking.firewall.allowedTCPPorts = [ 53 ]; networking.firewall.allowedUDPPorts = [ 53 ]; diff --git a/nixos_modules/nix-serve.nix b/nixos_modules/nix-serve.nix index 739354c..af24f3c 100644 --- a/nixos_modules/nix-serve.nix +++ b/nixos_modules/nix-serve.nix @@ -3,8 +3,9 @@ let user_keys = user: lib.optionals (builtins.hasAttr "bertof" config.users.users) - config.users.users.${user}.openssh.authorizedKeys.keys; -in { + config.users.users.${user}.openssh.authorizedKeys.keys; +in +{ # nix.buildMachines nix.distributedBuilds = true; diff --git a/odin/common_configuration.nix b/odin/common_configuration.nix index 0c1bb3a..32d3124 100644 --- a/odin/common_configuration.nix +++ b/odin/common_configuration.nix @@ -171,33 +171,35 @@ with lib; { services.smartd.enable = true; services.snapper = { - configs = let - bertofExtraConfig = '' - ALLOW_USERS="bertof" - TIMELINE_CREATE=yes - TIMELINE_CLEANUP=yes - ''; - common = { extraConfig = bertofExtraConfig; }; - in { - bertof_home = recursiveUpdate common { subvolume = "/home/bertof"; }; - bertof_music = - recursiveUpdate common { subvolume = "/home/bertof/Musica"; }; - bertof_downloads = - recursiveUpdate common { subvolume = "/home/bertof/Scaricati"; }; - bertof_images = - recursiveUpdate common { subvolume = "/home/bertof/Immagini"; }; - bertof_videos = - recursiveUpdate common { subvolume = "/home/bertof/Video"; }; - bertof_documents = - recursiveUpdate common { subvolume = "/home/bertof/Documenti"; }; - bertof_games_ssd = - recursiveUpdate common { subvolume = "/home/bertof/Giochi/SSD"; }; - bertof_games_sata = - recursiveUpdate common { subvolume = "/home/bertof/Giochi/SATA"; }; - # bertof_games_hdd = recursiveUpdate common { subvolume = "/home/bertof/Giochi/HDD"; }; - bertof_git = - recursiveUpdate common { subvolume = "/home/bertof/Documenti/Git"; }; - }; + configs = + let + bertofExtraConfig = '' + ALLOW_USERS="bertof" + TIMELINE_CREATE=yes + TIMELINE_CLEANUP=yes + ''; + common = { extraConfig = bertofExtraConfig; }; + in + { + bertof_home = recursiveUpdate common { subvolume = "/home/bertof"; }; + bertof_music = + recursiveUpdate common { subvolume = "/home/bertof/Musica"; }; + bertof_downloads = + recursiveUpdate common { subvolume = "/home/bertof/Scaricati"; }; + bertof_images = + recursiveUpdate common { subvolume = "/home/bertof/Immagini"; }; + bertof_videos = + recursiveUpdate common { subvolume = "/home/bertof/Video"; }; + bertof_documents = + recursiveUpdate common { subvolume = "/home/bertof/Documenti"; }; + bertof_games_ssd = + recursiveUpdate common { subvolume = "/home/bertof/Giochi/SSD"; }; + bertof_games_sata = + recursiveUpdate common { subvolume = "/home/bertof/Giochi/SATA"; }; + # bertof_games_hdd = recursiveUpdate common { subvolume = "/home/bertof/Giochi/HDD"; }; + bertof_git = + recursiveUpdate common { subvolume = "/home/bertof/Documenti/Git"; }; + }; }; services.dbus = { diff --git a/odin/hm.nix b/odin/hm.nix index dbb1bbf..7531b61 100644 --- a/odin/hm.nix +++ b/odin/hm.nix @@ -8,29 +8,29 @@ }; packages = builtins.attrValues { inherit (pkgs) - # element-desktop # matrix client - # evolution - # freecad - # lutris - # minecraft - # mycrypto - # pcmanfm - # pulseaudio - # retroarchFull - # signal-desktop - # slack - # wineFull + # element-desktop # matrix client + # evolution + # freecad + # lutris + # minecraft + # mycrypto + # pcmanfm + # pulseaudio + # retroarchFull + # signal-desktop + # slack + # wineFull arandr authy bitwarden cava discord dmenu droidcam easyeffects evince gallery-dl krita meld openvpn p7zip pavucontrol pentablet-driver postman procps pulseaudio shotwell skypeforlinux spotify tdesktop teams thunderbird transmission-gtk virt-manager virt-viewer wireguard-tools xournalpp zoom-us gucharmap handbrake httpie inkscape; inherit (pkgs.gnome) - # geary - # gnome-boxes - # gnome-calendar - # gnome-sound-recorder - # seahorse + # geary + # gnome-boxes + # gnome-calendar + # gnome-sound-recorder + # seahorse eog file-roller gnome-font-viewer gnome-screenshot gnome-system-monitor totem; inherit (pkgs.jetbrains) datagrip; diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 9353947..c8f07fd 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -18,7 +18,8 @@ let loki = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICeomEH/27XFlOjQ/GTO2mo8qPMHTbzLIsX0dloxXfhb"; systems = [ odin thor baldur loki ]; -in { +in +{ # "oauth_proxy_client_credentials.age".publicKeys = users ++ systems; "spotify_password.age".publicKeys = users ++ systems; } diff --git a/thor/configuration.nix b/thor/configuration.nix index d1a48c4..a49a1e3 100644 --- a/thor/configuration.nix +++ b/thor/configuration.nix @@ -122,17 +122,19 @@ with lib; { power-profiles-daemon.enable = true; smartd.enable = true; snapper = { - configs = let - common = { - extraConfig = '' - ALLOW_USERS="bertof" - TIMELINE_CREATE=yes - TIMELINE_CLEANUP=yes - ''; + configs = + let + common = { + extraConfig = '' + ALLOW_USERS="bertof" + TIMELINE_CREATE=yes + TIMELINE_CLEANUP=yes + ''; + }; + in + { + bertof_home = recursiveUpdate common { subvolume = "/home/bertof"; }; }; - in { - bertof_home = recursiveUpdate common { subvolume = "/home/bertof"; }; - }; }; thermald.enable = true; xserver = { diff --git a/thor/hm.nix b/thor/hm.nix index cb04cce..30c694d 100644 --- a/thor/hm.nix +++ b/thor/hm.nix @@ -8,18 +8,18 @@ }; packages = builtins.attrValues { inherit (pkgs) - # electrum - # element-desktop # matrix client - # evolution - # freecad - # lutris - # minecraft - # mycrypto - # pcmanfm - # pulseaudio - # signal-desktop - # slack - # wineFull + # electrum + # element-desktop # matrix client + # evolution + # freecad + # lutris + # minecraft + # mycrypto + # pcmanfm + # pulseaudio + # signal-desktop + # slack + # wineFull arandr authy bitwarden discord dmenu docker-compose docker-machine droidcam easyeffects evince filelight gallery-dl gucharmap handbrake httpie inkscape krita meld openvpn p7zip pavucontrol pcsx2 @@ -27,11 +27,11 @@ skypeforlinux spotify tdesktop teams thunderbird transmission-gtk virt-manager virt-viewer wireguard-tools xournalpp zoom-us; inherit (pkgs.gnome) - # geary - # gnome-boxes - # gnome-calendar - # gnome-sound-recorder - # seahorse + # geary + # gnome-boxes + # gnome-calendar + # gnome-sound-recorder + # seahorse eog file-roller gnome-font-viewer gnome-screenshot gnome-system-monitor totem; inherit (pkgs.jetbrains) datagrip;