diff --git a/baldur/configuration.nix b/baldur/configuration.nix index 206d77b..aaa89a9 100644 --- a/baldur/configuration.nix +++ b/baldur/configuration.nix @@ -1,6 +1,5 @@ { pkgs, lib, ... }: -with lib; -{ +with lib; { # boot = { # # binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ]; # # kernelPackages = pkgs.linuxPackages_5_18; @@ -24,8 +23,14 @@ with lib; programs = { dconf.enable = true; - gnupg.agent = { enable = true; enableSSHSupport = true; }; - zsh = { enable = true; syntaxHighlighting.enable = true; }; + gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + zsh = { + enable = true; + syntaxHighlighting.enable = true; + }; }; networking = { @@ -56,14 +61,22 @@ with lib; # bazarr = { enable = true; openFirewall = true; group = "users"; }; # blueman.enable = true; dbus.packages = with pkgs; [ dconf ]; - fail2ban = { enable = true; bantime-increment.enable = true; }; + fail2ban = { + enable = true; + bantime-increment.enable = true; + }; # gnome.gnome-keyring.enable = true; # gvfs = { enable = true; package = mkForce pkgs.gnome3.gvfs; }; # jackett = { enable = true; openFirewall = true; group = "users"; }; # jellyfin = { enable = true; openFirewall = true; group = "users"; }; # logind.lidSwitch = "ignore"; # node-red = { enable = true; openFirewall = true; withNpmAndGcc = true; }; - openssh = { enable = true; openFirewall = true; permitRootLogin = "no"; passwordAuthentication = false; }; + openssh = { + enable = true; + openFirewall = true; + permitRootLogin = "no"; + passwordAuthentication = false; + }; # plex = { enable = true; openFirewall = true; group = "users"; }; # power-profiles-daemon.enable = true; # radarr = { enable = true; openFirewall = true; group = "users"; }; @@ -104,7 +117,17 @@ with lib; users.users.bertof = { isNormalUser = true; - extraGroups = [ "audio" "input" "docker" "libvirtd" "network" "networkmanager" "usb" "video" "wheel" ]; + extraGroups = [ + "audio" + "input" + "docker" + "libvirtd" + "network" + "networkmanager" + "usb" + "video" + "wheel" + ]; shell = pkgs.zsh; }; @@ -142,7 +165,6 @@ with lib; # }; # }; - # systemd.packages = with pkgs; [ syncthing ]; # systemd.services = # let @@ -230,7 +252,6 @@ with lib; # }; # }; - security.sudo.extraConfig = '' Defaults pwfeedback ''; diff --git a/baldur/hm.nix b/baldur/hm.nix index 0676db0..7f761d8 100644 --- a/baldur/hm.nix +++ b/baldur/hm.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { nixpkgs.overlays = [ (_: _: { devEnvironment = (import ./environment.nix) { diff --git a/custom/default.nix b/custom/default.nix index 1956996..9ef2d80 100644 --- a/custom/default.nix +++ b/custom/default.nix @@ -1,6 +1,4 @@ -{ pkgs ? import { inherit system; } -, system ? builtins.currentSystem -}: +{ pkgs ? import { inherit system; }, system ? builtins.currentSystem }: let self = with pkgs; { diff --git a/custom/lockscreen/default.nix b/custom/lockscreen/default.nix index 3b8e1da..ebed126 100644 --- a/custom/lockscreen/default.nix +++ b/custom/lockscreen/default.nix @@ -3,14 +3,15 @@ , roboto , i3lock-color , writeScriptBin -, font ? { package = roboto; name = "Roboto"; } +, font ? { + package = roboto; + name = "Roboto"; + } , palette ? rice.palette.palette { } , ... }: -let - strPalette = lib.rice.palette.toRGBAHex palette; -in -writeScriptBin "lockscreen" '' +let strPalette = lib.rice.palette.toRGBAHex palette; +in writeScriptBin "lockscreen" '' #!/bin/sh # Using font package ${font.package} ${i3lock-color}/bin/i3lock-color \ diff --git a/flake.nix b/flake.nix index 927d05c..02f020d 100644 --- a/flake.nix +++ b/flake.nix @@ -3,17 +3,41 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/release-22.05"; - home-manager = { url = "github:nix-community/home-manager/release-22.05"; inputs.nixpkgs.follows = "nixpkgs"; }; + home-manager = { + url = "github:nix-community/home-manager/release-22.05"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nixpkgs-u.url = "github:NixOS/nixpkgs/nixos-unstable"; - home-manager-u = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs-u"; }; + home-manager-u = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs-u"; + }; flake-utils.url = "github:numtide/flake-utils"; nixos-hardware.url = "github:NixOS/nixos-hardware"; - nix-rice = { url = "github:bertof/nix-rice"; inputs = { inxpkgs.follows = "nixpkgs-u"; flake-utils.follows = "flake-utils"; }; }; - pre-commit-hooks = { url = "github:cachix/pre-commit-hooks.nix"; inputs = { nixpkgs.follows = "nixpkgs-u"; flake-utils.follows = "flake-utils"; }; }; - tex2nix = { url = "github:Mic92/tex2nix"; inputs = { nixpkgs.follows = "nixpkgs-u"; flake-utils.follows = "flake-utils"; }; }; + nix-rice = { + url = "github:bertof/nix-rice"; + inputs = { + inxpkgs.follows = "nixpkgs-u"; + flake-utils.follows = "flake-utils"; + }; + }; + pre-commit-hooks = { + url = "github:cachix/pre-commit-hooks.nix"; + inputs = { + nixpkgs.follows = "nixpkgs-u"; + flake-utils.follows = "flake-utils"; + }; + }; + tex2nix = { + url = "github:Mic92/tex2nix"; + inputs = { + nixpkgs.follows = "nixpkgs-u"; + flake-utils.follows = "flake-utils"; + }; + }; }; outputs = @@ -30,13 +54,25 @@ }: let overlaysBuilder = system: [ - (_: _: { inherit (tex2nix.packages.${system}) tex2nix; stable = pkgs { inherit system; }; unstable = pkgs-u { inherit system; }; }) + (_: _: { + inherit (tex2nix.packages.${system}) tex2nix; + stable = pkgs { inherit system; }; + unstable = pkgs-u { inherit system; }; + }) (nix-rice.overlays.default) (import ./rice.nix) (final: _: { - update-background = final.callPackage ./custom/update-background { backgrounds_directory = "$HOME/Immagini/Sfondi/1080+/1440+"; }; - lockscreen = final.callPackage ./custom/lockscreen { palette = final.rice.colorPalette; font = final.rice.font.normal; }; - sddm-theme-clairvoyance = final.callPackage ./custom/sddm-theme-clairvoyance { wallpaper = ./wallpapers/comfy_waves.jpg; }; + update-background = final.callPackage ./custom/update-background { + backgrounds_directory = "$HOME/Immagini/Sfondi/1080+/1440+"; + }; + lockscreen = final.callPackage ./custom/lockscreen { + palette = final.rice.colorPalette; + font = final.rice.font.normal; + }; + sddm-theme-clairvoyance = + final.callPackage ./custom/sddm-theme-clairvoyance { + wallpaper = ./wallpapers/comfy_waves.jpg; + }; }) ]; defaultConfig = { @@ -44,10 +80,18 @@ allowUnfree = true; permittedInsecurePackages = [ "electron-9.4.4" ]; # authy dependency }; - nixpkgsSettings = { system, overlays ? overlaysBuilder system, config ? defaultConfig }: { inherit system overlays config; }; + nixpkgsSettings = + { system, overlays ? overlaysBuilder system, config ? defaultConfig }: { + inherit system overlays config; + }; pkgs = s: import nixpkgs (nixpkgsSettings s); pkgs-u = s: import nixpkgs-u (nixpkgsSettings s); - homeManagerSettings = { home-manager = { useGlobalPkgs = true; useUserPackages = true; }; }; + homeManagerSettings = { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + }; + }; commonBaseModules = [ ./nixos_modules/bertof_user.nix @@ -79,22 +123,22 @@ odinIntelModules = [ ./odin/configuration-intel.nix ]; odinNvidiaModules = [ ./odin/configuration-nvidia.nix ]; - odinIntelBuilder = { extraModules ? [ ] }: nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - modules = - [{ nixpkgs = nixpkgsSettings { inherit system; }; }] ++ - commonBaseModules ++ odinBaseModules ++ odinIntelModules ++ - (homeManagerModules { bertof = import ./odin/hm.nix; }) ++ - extraModules; - }; - odinNvidiaBuilder = { extraModules ? [ ] }: nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - modules = - [{ nixpkgs = nixpkgsSettings { inherit system; }; }] ++ - commonBaseModules ++ odinBaseModules ++ odinNvidiaModules ++ - (homeManagerModules { bertof = import ./odin/hm.nix; }) ++ - extraModules; - }; + odinIntelBuilder = { extraModules ? [ ] }: + nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + modules = [{ nixpkgs = nixpkgsSettings { inherit system; }; }] + ++ commonBaseModules ++ odinBaseModules ++ odinIntelModules + ++ (homeManagerModules { bertof = import ./odin/hm.nix; }) + ++ extraModules; + }; + odinNvidiaBuilder = { extraModules ? [ ] }: + nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + modules = [{ nixpkgs = nixpkgsSettings { inherit system; }; }] + ++ commonBaseModules ++ odinBaseModules ++ odinNvidiaModules + ++ (homeManagerModules { bertof = import ./odin/hm.nix; }) + ++ extraModules; + }; thorBaseModules = [ ./thor/hardware-configuration.nix @@ -102,14 +146,14 @@ nixos-hardware.nixosModules.common-pc-ssd ./thor/configuration.nix ]; - thorBuilder = { extraModules ? [ ] }: nixpkgs-u.lib.nixosSystem rec { - system = "x86_64-linux"; - modules = - [{ nixpkgs = nixpkgsSettings { inherit system; }; }] ++ - commonBaseModules ++ thorBaseModules ++ - (homeManagerUModules { bertof = import ./thor/hm.nix; }) ++ - extraModules; - }; + thorBuilder = { extraModules ? [ ] }: + nixpkgs-u.lib.nixosSystem rec { + system = "x86_64-linux"; + modules = [{ nixpkgs = nixpkgsSettings { inherit system; }; }] + ++ commonBaseModules ++ thorBaseModules + ++ (homeManagerUModules { bertof = import ./thor/hm.nix; }) + ++ extraModules; + }; lokiBaseModules = [ ./loki/hardware-configuration.nix @@ -117,39 +161,38 @@ nixos-hardware.nixosModules.common-pc-ssd ./loki/configuration.nix ]; - lokiBuilder = { extraModules ? [ ] }: nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - modules = - [{ nixpkgs = nixpkgsSettings { inherit system; }; }] ++ - commonBaseModules ++ lokiBaseModules ++ - (homeManagerModules { bertof = import ./loki/hm.nix; }) ++ - extraModules; - }; + lokiBuilder = { extraModules ? [ ] }: + nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + modules = [{ nixpkgs = nixpkgsSettings { inherit system; }; }] + ++ commonBaseModules ++ lokiBaseModules + ++ (homeManagerModules { bertof = import ./loki/hm.nix; }) + ++ extraModules; + }; freyaBaseModules = [ # ./freya/hardware-configuration.nix nixos-hardware.nixosModules.raspberry-pi."4" ./freya/configuration.nix ]; - freyaBuilder = { extraModules ? [ ] }: nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - modules = - [{ nixpkgs = nixpkgsSettings { inherit system; }; }] ++ - commonBaseModules ++ freyaBaseModules ++ - (homeManagerModules { bertof = import ./freya/hm.nix; }) ++ - extraModules; - }; + freyaBuilder = { extraModules ? [ ] }: + nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + modules = [{ nixpkgs = nixpkgsSettings { inherit system; }; }] + ++ commonBaseModules ++ freyaBaseModules + ++ (homeManagerModules { bertof = import ./freya/hm.nix; }) + ++ extraModules; + }; - baldurBaseModules = [ - ./baldur/configuration.nix - ]; - balurBuilder = { extraModules ? [ ] }: nixpkgs.lib.nixosSystem rec { - system = "x86_64-linux"; - modules = [{ nixpkgs = nixpkgsSettings { inherit system; }; }] ++ - commonBaseModules ++ baldurBaseModules ++ - (homeManagerModules { bertof = import ./baldur/hm.nix; }) ++ - extraModules; - }; + baldurBaseModules = [ ./baldur/configuration.nix ]; + balurBuilder = { extraModules ? [ ] }: + nixpkgs.lib.nixosSystem rec { + system = "x86_64-linux"; + modules = [{ nixpkgs = nixpkgsSettings { inherit system; }; }] + ++ commonBaseModules ++ baldurBaseModules + ++ (homeManagerModules { bertof = import ./baldur/hm.nix; }) + ++ extraModules; + }; in (flake-utils.lib.eachDefaultSystem (system: rec { packages = pkgs-u { inherit system; }; @@ -157,7 +200,10 @@ checks = { pre-commit-check = pre-commit-hooks.lib.${system}.run { src = ./.; - hooks = { nixpkgs-fmt.enable = true; nix-linter.enable = true; }; + hooks = { + nixpkgs-fmt.enable = true; + nix-linter.enable = true; + }; }; }; diff --git a/freya/configuration.nix b/freya/configuration.nix index 52cce1d..2573229 100644 --- a/freya/configuration.nix +++ b/freya/configuration.nix @@ -1,6 +1,5 @@ { pkgs, lib, ... }: -with lib; -{ +with lib; { boot = { binfmt.emulatedSystems = [ "armv7l-linux" "aarch64-linux" ]; kernelPackages = pkgs.linuxPackages_5_18; @@ -24,8 +23,14 @@ with lib; programs = { dconf.enable = true; - gnupg.agent = { enable = true; enableSSHSupport = true; }; - zsh = { enable = true; syntaxHighlighting.enable = true; }; + gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + zsh = { + enable = true; + syntaxHighlighting.enable = true; + }; }; networking = { @@ -63,7 +68,12 @@ with lib; # jellyfin = { enable = true; openFirewall = true; group = "users"; }; # logind.lidSwitch = "ignore"; # node-red = { enable = true; openFirewall = true; withNpmAndGcc = true; }; - openssh = { enable = true; openFirewall = true; permitRootLogin = "no"; passwordAuthentication = false; }; + openssh = { + enable = true; + openFirewall = true; + permitRootLogin = "no"; + passwordAuthentication = false; + }; # plex = { enable = true; openFirewall = true; group = "users"; }; # power-profiles-daemon.enable = true; # radarr = { enable = true; openFirewall = true; group = "users"; }; @@ -136,7 +146,10 @@ with lib; # }; # }; # }; - smartd = { enable = true; notifications.x11.enable = true; }; + smartd = { + enable = true; + notifications.x11.enable = true; + }; # sonarr = { enable = true; openFirewall = true; group = "users"; }; thermald.enable = true; # transmission = { @@ -173,7 +186,17 @@ with lib; users.users = { bertof = { isNormalUser = true; - extraGroups = [ "audio" "input" "docker" "libvirtd" "network" "networkmanager" "usb" "video" "wheel" ]; + extraGroups = [ + "audio" + "input" + "docker" + "libvirtd" + "network" + "networkmanager" + "usb" + "video" + "wheel" + ]; shell = pkgs.zsh; }; # tiziano = { diff --git a/freya/hm.nix b/freya/hm.nix index ae62fc1..bb03061 100644 --- a/freya/hm.nix +++ b/freya/hm.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { nixpkgs.overlays = [ (_: _: { devEnvironment = (import ./environment.nix) { diff --git a/hm_modules/__basic.nix b/hm_modules/__basic.nix index 2d4eadb..24eadc5 100644 --- a/hm_modules/__basic.nix +++ b/hm_modules/__basic.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { home = { language.base = "it_IT.UTF-8"; packages = with pkgs; [ diff --git a/hm_modules/alacritty.nix b/hm_modules/alacritty.nix index 7534c09..ea28ad4 100644 --- a/hm_modules/alacritty.nix +++ b/hm_modules/alacritty.nix @@ -1,31 +1,32 @@ { pkgs, ... }: let - strPalette = with pkgs.rice; pkgs.lib.rice.palette.toRgbHex rec { - inherit (colorPalette) normal bright; - dim = colorPalette.dark; + strPalette = with pkgs.rice; + pkgs.lib.rice.palette.toRgbHex rec { + inherit (colorPalette) normal bright; + dim = colorPalette.dark; - primary = { - background = normal.black; - foreground = normal.white; - dim_foreground = dim.white; - }; - cursor = { - cursor = normal.white; - text = normal.black; - }; - vi_mode_cursor = { - cursor = normal.white; - text = normal.black; - }; - selection.background = dim.blue; - search = { - matches.background = dim.cyan; - bar = { - foreground = dim.cyan; - background = dim.yellow; + primary = { + background = normal.black; + foreground = normal.white; + dim_foreground = dim.white; + }; + cursor = { + cursor = normal.white; + text = normal.black; + }; + vi_mode_cursor = { + cursor = normal.white; + text = normal.black; + }; + selection.background = dim.blue; + search = { + matches.background = dim.cyan; + bar = { + foreground = dim.cyan; + background = dim.yellow; + }; }; }; - }; in { # Include fonts packages @@ -45,10 +46,11 @@ in # hide_when_typing = true; hints.modifiers = "Control"; }; - colors = with pkgs.rice; strPalette // { - selection.text = "CellForeground"; - search.matches.foreground = "CellForeground"; - }; + colors = with pkgs.rice; + strPalette // { + selection.text = "CellForeground"; + search.matches.foreground = "CellForeground"; + }; }; }; } diff --git a/hm_modules/any_nix_shell.nix b/hm_modules/any_nix_shell.nix deleted file mode 100644 index a56b9a6..0000000 --- a/hm_modules/any_nix_shell.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: -{ - programs.zsh.enable = true; - programs.zsh.initExtra = '' - source <(${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right) - ''; -} diff --git a/hm_modules/autorandr.nix b/hm_modules/autorandr.nix index ff92311..a129c72 100644 --- a/hm_modules/autorandr.nix +++ b/hm_modules/autorandr.nix @@ -5,7 +5,8 @@ let dell-laptop = { dpi = 96; - fingerprint = "00ffffffffffff0030e43f0500000000001a010495221378eaa1c59459578f27205054000000010101010101010101010101010101012e3680a070381f403020350058c21000001a5c2b80a070381f403020350058c21000001a000000fe0034584b3133803135365746360a000000000000413196001000000a010a202000c5"; + fingerprint = + "00ffffffffffff0030e43f0500000000001a010495221378eaa1c59459578f27205054000000010101010101010101010101010101012e3680a070381f403020350058c21000001a5c2b80a070381f403020350058c21000001a000000fe0034584b3133803135365746360a000000000000413196001000000a010a202000c5"; mode = "1920x1080"; }; in @@ -13,43 +14,87 @@ odin-nvidia = { fingerprint = { "eDP-1-1" = dell-laptop.fingerprint; }; config = { - "eDP-1-1" = { inherit (dell-laptop) mode dpi; primary = true; crtc = 0; }; + "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; }; + "eDP1" = { + inherit (dell-laptop) mode dpi; + primary = true; + crtc = 0; + }; }; }; odin-intel-laboratorio-dock-dell = { fingerprint = { - "DP1-3" = "00ffffffffffff0010ac10d04c36453221110103682b1b78ee8db0a2544a9c25115054a54b00714f818001010101010101010101010121399030621a274068b03600ae0e1100001c000000ff00434b3632373738413245364c0a000000fd00384b1e530f000a202020202020000000fc0044454c4c20453230375746500a0088"; + "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"; }; + "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"; + "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"; }; + "DP1-3" = { + crtc = 1; + mode = "1920x1080"; + position = "0x0"; + primary = true; + dpi = 96; + }; + "eDP1" = { + inherit (dell-laptop) mode dpi; + crtc = 0; + position = "0x1080"; + }; }; }; thor-two-screens = { fingerprint = { - "DP-4" = "00ffffffffffff001e6d7f5ba1c60a00011f0104b53c22789f8cb5af4f43ab260e5054254b007140818081c0a9c0b300d1c08100d1cf09ec00a0a0a0675030203a0055502100001a000000fd0030901ee63c000a202020202020000000fc004c4720554c545241474541520a000000ff003130314e5454514c533230390a017102031a7123090607e305c000e606050160592846100403011f136fc200a0a0a0555030203a0055502100001a565e00a0a0a029503020350055502100001a5aa000a0a0a0465030203a005550210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000da"; - "HDMI-0" = "00ffffffffffff004c2d2c0d443650302e19010380341d782a5295a556549d250e5054bb8c00b30081c0810081809500a9c001010101023a801871382d40582c450009252100001e000000fd0030481e5216000a202020202020000000fc00433234463339300a2020202020000000ff00485451483330353636370a20200163020324f14690041f131203230907078301000067030c001000802b681a00000101304800011d00bc52d01e20b828554009252100001e8c0ad090204031200c4055000925210000188c0ad08a20e02d10103e9600092521000018215280a07238304088c8350009252100001c00000000000000000000000000000000000000fa"; + "DP-4" = + "00ffffffffffff001e6d7f5ba1c60a00011f0104b53c22789f8cb5af4f43ab260e5054254b007140818081c0a9c0b300d1c08100d1cf09ec00a0a0a0675030203a0055502100001a000000fd0030901ee63c000a202020202020000000fc004c4720554c545241474541520a000000ff003130314e5454514c533230390a017102031a7123090607e305c000e606050160592846100403011f136fc200a0a0a0555030203a0055502100001a565e00a0a0a029503020350055502100001a5aa000a0a0a0465030203a005550210000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000da"; + "HDMI-0" = + "00ffffffffffff004c2d2c0d443650302e19010380341d782a5295a556549d250e5054bb8c00b30081c0810081809500a9c001010101023a801871382d40582c450009252100001e000000fd0030481e5216000a202020202020000000fc00433234463339300a2020202020000000ff00485451483330353636370a20200163020324f14690041f131203230907078301000067030c001000802b681a00000101304800011d00bc52d01e20b828554009252100001e8c0ad090204031200c4055000925210000188c0ad08a20e02d10103e9600092521000018215280a07238304088c8350009252100001c00000000000000000000000000000000000000fa"; }; config = { - "DP-4" = { crtc = 0; mode = "2560x1440"; position = "1080x162"; primary = true; dpi = 96; }; - "HDMI-0" = { crtc = 1; mode = "1920x1080"; position = "0x0"; rotate = "right"; dpi = 96; }; + "DP-4" = { + 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/bottom.nix b/hm_modules/bottom.nix index d83d4c5..f44a88a 100644 --- a/hm_modules/bottom.nix +++ b/hm_modules/bottom.nix @@ -1,8 +1,6 @@ { pkgs, ... }: -let - tomlGenerate = (pkgs.formats.toml { }).generate "bottom-toml"; -in -{ +let tomlGenerate = (pkgs.formats.toml { }).generate "bottom-toml"; +in { home.packages = with pkgs; [ bottom ]; xdg.configFile."bottom/bottom.toml".source = tomlGenerate { "flags" = { diff --git a/hm_modules/cava.nix b/hm_modules/cava.nix index bf53f60..1524db7 100644 --- a/hm_modules/cava.nix +++ b/hm_modules/cava.nix @@ -1,11 +1,14 @@ { pkgs, lib, ... }: let strPalette = with pkgs.rice; pkgs.lib.rice.palette.toRgbHex colorPalette; - fmtString = str: "\'${str}\'"; + fmtString = str: "'${str}'"; in { xdg.configFile."cava/config".text = lib.generators.toINI { } { - general = { bar_width = 1; bar_spacing = 1; }; + general = { + bar_width = 1; + bar_spacing = 1; + }; color = { gradient = 1; gradient_count = 5; diff --git a/hm_modules/cpp.nix b/hm_modules/cpp.nix index 08fa37c..2f6794b 100644 --- a/hm_modules/cpp.nix +++ b/hm_modules/cpp.nix @@ -1,6 +1 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ - clang-tools - ]; -} +{ pkgs, ... }: { home.packages = with pkgs; [ clang-tools ]; } diff --git a/hm_modules/dunst.nix b/hm_modules/dunst.nix index 38ba672..4e85049 100644 --- a/hm_modules/dunst.nix +++ b/hm_modules/dunst.nix @@ -1,8 +1,6 @@ { pkgs, ... }: -let - palette = pkgs.lib.rice.palette.toRGBHex pkgs.rice.colorPalette; -in -{ +let palette = pkgs.lib.rice.palette.toRGBHex pkgs.rice.colorPalette; +in { home.packages = with pkgs; [ dunst rice.font.normal.package ]; services.dunst = { enable = true; diff --git a/hm_modules/easyeffects.nix b/hm_modules/easyeffects.nix index 6a94385..9bb9841 100644 --- a/hm_modules/easyeffects.nix +++ b/hm_modules/easyeffects.nix @@ -1,3 +1 @@ -{ - services.easyeffects.enable = true; -} +{ services.easyeffects.enable = true; } diff --git a/hm_modules/fonts.nix b/hm_modules/fonts.nix index c85dac8..1bc7f8d 100644 --- a/hm_modules/fonts.nix +++ b/hm_modules/fonts.nix @@ -1,8 +1,5 @@ -{ pkgs, ... }: -{ - fonts.fontconfig = { - enable = true; - }; +{ pkgs, ... }: { + fonts.fontconfig = { enable = true; }; home.packages = with pkgs; [ dejavu_fonts noto-fonts diff --git a/hm_modules/git.nix b/hm_modules/git.nix index 5260296..4ef6932 100644 --- a/hm_modules/git.nix +++ b/hm_modules/git.nix @@ -44,11 +44,13 @@ let "gdw" = "git diff --word-diff"; "gf" = "git fetch"; "gfa" = "git fetch --all --prune"; - "gfg" = "git ls-files \| grep"; + "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"; + "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"; @@ -117,10 +119,5 @@ in }; programs.bash.shellAliases = shellAliases; programs.zsh.shellAliases = shellAliases; - home.packages = with pkgs; [ - gh - git-secret - glab - meld - ]; + home.packages = with pkgs; [ gh git-secret glab meld ]; } diff --git a/hm_modules/go.nix b/hm_modules/go.nix index 2e06326..fafc036 100644 --- a/hm_modules/go.nix +++ b/hm_modules/go.nix @@ -4,7 +4,5 @@ goPath = ".go"; }; - home.packages = with pkgs; [ - gopls - ]; + home.packages = with pkgs; [ gopls ]; } diff --git a/hm_modules/gtk_theme.nix b/hm_modules/gtk_theme.nix index 9cd79c2..106ed70 100644 --- a/hm_modules/gtk_theme.nix +++ b/hm_modules/gtk_theme.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { gtk = with pkgs.rice; { enable = true; font = font.normal; diff --git a/hm_modules/helix.nix b/hm_modules/helix.nix index 74624bf..1c6b50f 100644 --- a/hm_modules/helix.nix +++ b/hm_modules/helix.nix @@ -1,36 +1,37 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { programs.bash.shellAliases = { x = "hx"; }; programs.zsh.shellAliases = { x = "hx"; }; - home.sessionVariables = { EDITOR = "hx"; VISUAL = "hx"; }; + home.sessionVariables = { + EDITOR = "hx"; + VISUAL = "hx"; + }; home.packages = [ - (pkgs.makeDesktopItem - { - name = "helix"; - exec = "hx %F"; - icon = "helix"; - desktopName = "Helix"; - comment = "Helix text editor"; - terminal = true; - categories = [ "Development" ]; - mimeTypes = [ - "text/english" - "text/plain" - "text/x-makefile" - "text/x-c++hdr" - "text/x-c++src" - "text/x-chdr" - "text/x-csrc" - "text/x-java" - "text/x-moc" - "text/x-pascal" - "text/x-tcl" - "text/x-tex" - "application/x-shellscript" - "text/x-c" - "text/x-c++" - ]; - }) + (pkgs.makeDesktopItem { + name = "helix"; + exec = "hx %F"; + icon = "helix"; + desktopName = "Helix"; + comment = "Helix text editor"; + terminal = true; + categories = [ "Development" ]; + mimeTypes = [ + "text/english" + "text/plain" + "text/x-makefile" + "text/x-c++hdr" + "text/x-c++src" + "text/x-chdr" + "text/x-csrc" + "text/x-java" + "text/x-moc" + "text/x-pascal" + "text/x-tcl" + "text/x-tex" + "application/x-shellscript" + "text/x-c" + "text/x-c++" + ]; + }) ]; programs.helix = { enable = true; @@ -65,15 +66,34 @@ base16 = { "ui.menu" = transparent; "ui.menu.selected" = { modifiers = [ "reversed" ]; }; - "ui.linenr" = { fg = gray; bg = dark-gray; }; + "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.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.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; @@ -81,7 +101,10 @@ "constant" = orange; "attributes" = yellow; "type" = yellow; - "ui.cursor.match" = { fg = yellow; modifiers = [ "underlined" ]; }; + "ui.cursor.match" = { + fg = yellow; + modifiers = [ "underlined" ]; + }; "string" = green; "variable.other.member" = red; "constant.character.escape" = cyan; diff --git a/hm_modules/info.nix b/hm_modules/info.nix index 3f0ee2a..b07463d 100644 --- a/hm_modules/info.nix +++ b/hm_modules/info.nix @@ -1,5 +1 @@ -{ - programs.info = { - enable = true; - }; -} +{ programs.info = { enable = true; }; } diff --git a/hm_modules/java.nix b/hm_modules/java.nix index 5910761..ced7771 100644 --- a/hm_modules/java.nix +++ b/hm_modules/java.nix @@ -1,3 +1 @@ -{ - programs.java.enable = true; -} +{ programs.java.enable = true; } diff --git a/hm_modules/javascript.nix b/hm_modules/javascript.nix index 80e714a..a1f3074 100644 --- a/hm_modules/javascript.nix +++ b/hm_modules/javascript.nix @@ -1,7 +1,2 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ - flow - ]; -} +{ pkgs, ... }: { home.packages = with pkgs; [ flow ]; } diff --git a/hm_modules/joystickwake.nix b/hm_modules/joystickwake.nix index e25b20c..f178502 100644 --- a/hm_modules/joystickwake.nix +++ b/hm_modules/joystickwake.nix @@ -1,17 +1,13 @@ { pkgs, ... }: -let - joystickwakeCmd = "${pkgs.joystickwake}/bin/joystickwake"; -in -{ +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" ]; - }; + Install = { WantedBy = [ "graphical-session.target" ]; }; Service = { Type = "simple"; ExecStart = joystickwakeCmd; diff --git a/hm_modules/jq.nix b/hm_modules/jq.nix index 9d9f199..1e9d66a 100644 --- a/hm_modules/jq.nix +++ b/hm_modules/jq.nix @@ -1,5 +1 @@ -{ - programs.jq = { - enable = true; - }; -} +{ programs.jq = { enable = true; }; } diff --git a/hm_modules/kakoune.nix b/hm_modules/kakoune.nix index 336d7a6..f0cc198 100644 --- a/hm_modules/kakoune.nix +++ b/hm_modules/kakoune.nix @@ -1,33 +1,34 @@ { pkgs, ... }: let - themeBuilder = palette: with palette; '' - set-face global value rgb:${normal.magenta},default - set-face global type rgb:${bright.white},default - set-face global identifier rgb:${normal.cyan},default - set-face global string rgb:${normal.green},default - set-face global error rgb:${normal.red},default - set-face global keyword rgb:${normal.blue},default - set-face global operator rgb:${normal.blue},default - set-face global attribute rgb:${bright.blue},default - set-face global comment rgb:${bright.blue},default - set-face global meta rgb:${normal.yellow},default - set-face global Default rgb:${normal.white},default - set-face global PrimarySelection rgb:${normal.black},rgb:${dark.yellow} - set-face global SecondarySelection rgb:${normal.black},rgb:${dark.white} - set-face global PrimaryCursor rgb:${normal.black},rgb:${normal.yellow} - set-face global SecondaryCursor rgb:${normal.black},rgb:${normal.white} - set-face global MenuForeground rgb:${normal.white},rgb:${bright.black} - set-face global MenuBackground default,rgb:${normal.black} - set-face global MenuInfo default,rgb:${normal.black} - set-face global Information rgb:${dark.black},rgb:${normal.cyan} - set-face global StatusLine rgb:${normal.white},rgb:${normal.black} - set-face global StatusLineMode rgb:${normal.blue},rgb:${normal.black} - set-face global StatusLineInfo rgb:${normal.blue},rgb:${normal.black} - set-face global StatusLineValue rgb:${normal.blue},rgb:${normal.black} - set-face global StatusCursor rgb:${dark.black},rgb:${normal.yellow} - set-face global Prompt rgb:${normal.cyan},rgb:${normal.black} - set-face global BufferPadding default,default - ''; + themeBuilder = palette: + with palette; '' + set-face global value rgb:${normal.magenta},default + set-face global type rgb:${bright.white},default + set-face global identifier rgb:${normal.cyan},default + set-face global string rgb:${normal.green},default + set-face global error rgb:${normal.red},default + set-face global keyword rgb:${normal.blue},default + set-face global operator rgb:${normal.blue},default + set-face global attribute rgb:${bright.blue},default + set-face global comment rgb:${bright.blue},default + set-face global meta rgb:${normal.yellow},default + set-face global Default rgb:${normal.white},default + set-face global PrimarySelection rgb:${normal.black},rgb:${dark.yellow} + set-face global SecondarySelection rgb:${normal.black},rgb:${dark.white} + set-face global PrimaryCursor rgb:${normal.black},rgb:${normal.yellow} + set-face global SecondaryCursor rgb:${normal.black},rgb:${normal.white} + set-face global MenuForeground rgb:${normal.white},rgb:${bright.black} + set-face global MenuBackground default,rgb:${normal.black} + set-face global MenuInfo default,rgb:${normal.black} + set-face global Information rgb:${dark.black},rgb:${normal.cyan} + set-face global StatusLine rgb:${normal.white},rgb:${normal.black} + set-face global StatusLineMode rgb:${normal.blue},rgb:${normal.black} + set-face global StatusLineInfo rgb:${normal.blue},rgb:${normal.black} + set-face global StatusLineValue rgb:${normal.blue},rgb:${normal.black} + set-face global StatusCursor rgb:${dark.black},rgb:${normal.yellow} + set-face global Prompt rgb:${normal.cyan},rgb:${normal.black} + set-face global BufferPadding default,default + ''; packages = with pkgs; [ yaml-language-server @@ -40,33 +41,32 @@ let aspellDicts.en-science aspellDicts.it - (pkgs.makeDesktopItem - { - name = "kakoune"; - exec = "kak %F"; - icon = "kakoune"; - desktopName = "Kakoune"; - comment = "Kakoune text editor"; - terminal = true; - categories = [ "Development" ]; - mimeTypes = [ - "text/english" - "text/plain" - "text/x-makefile" - "text/x-c++hdr" - "text/x-c++src" - "text/x-chdr" - "text/x-csrc" - "text/x-java" - "text/x-moc" - "text/x-pascal" - "text/x-tcl" - "text/x-tex" - "application/x-shellscript" - "text/x-c" - "text/x-c++" - ]; - }) + (pkgs.makeDesktopItem { + name = "kakoune"; + exec = "kak %F"; + icon = "kakoune"; + desktopName = "Kakoune"; + comment = "Kakoune text editor"; + terminal = true; + categories = [ "Development" ]; + mimeTypes = [ + "text/english" + "text/plain" + "text/x-makefile" + "text/x-c++hdr" + "text/x-c++src" + "text/x-chdr" + "text/x-csrc" + "text/x-java" + "text/x-moc" + "text/x-pascal" + "text/x-tcl" + "text/x-tex" + "application/x-shellscript" + "text/x-c" + "text/x-c++" + ]; + }) ]; in @@ -81,40 +81,166 @@ in 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; }; + 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 = ""; effect = ":edit"; } - { mode = "user"; docstring = "Code actions"; key = "a"; effect = ":lsp-code-actions"; } - { mode = "user"; docstring = "Comment block"; key = "b"; effect = ":comment-block"; } - { mode = "user"; docstring = "Comment line"; key = "l"; effect = ":comment-line"; } - { mode = "user"; docstring = "Copy to clipboard"; key = "y"; effect = "${pkgs.xclip}/bin/xclip -i -selection clipboard"; } - { mode = "user"; docstring = "Format code with formatter"; key = "f"; effect = ":format"; } - { mode = "user"; docstring = "Format code with LSP"; key = "F"; effect = ":lsp-formatting-sync"; } - { mode = "user"; docstring = "Jump to definition"; key = "d"; effect = ":lsp-definition"; } - { mode = "user"; docstring = "Rename object"; key = "r"; effect = ":lsp-rename-prompt"; } - { mode = "user"; docstring = "Jump to type definition"; key = "t"; effect = ":lsp-type-definition"; } - { mode = "user"; docstring = "List project diagnostics"; key = "i"; effect = ":lsp-diagnostics"; } - { mode = "user"; docstring = "Paste from clipboard (after)"; key = "P"; effect = "${pkgs.xclip}/bin/xclip -selection clipboard -o"; } - { mode = "user"; docstring = "Paste from clipboard (before)"; key = "p"; effect = "!${pkgs.xclip}/bin/xclip -selection clipboard -o"; } - { mode = "user"; docstring = "Show hover info"; key = "q"; effect = ":lsp-hover"; } - { mode = "user"; docstring = "Spellcheck English"; key = "S"; effect = ":spell en"; } - { mode = "user"; docstring = "Spellcheck"; key = "s"; effect = ":spell "; } - { mode = "normal"; docstring = "Try next snippet placeholder"; key = ""; effect = ": insert-c-n"; } + { + mode = "normal"; + docstring = "Edit file"; + key = ""; + effect = ":edit"; + } + { + mode = "user"; + docstring = "Code actions"; + key = "a"; + effect = ":lsp-code-actions"; + } + { + mode = "user"; + docstring = "Comment block"; + key = "b"; + effect = ":comment-block"; + } + { + mode = "user"; + docstring = "Comment line"; + key = "l"; + effect = ":comment-line"; + } + { + mode = "user"; + docstring = "Copy to clipboard"; + key = "y"; + effect = "${pkgs.xclip}/bin/xclip -i -selection clipboard"; + } + { + mode = "user"; + docstring = "Format code with formatter"; + key = "f"; + effect = ":format"; + } + { + mode = "user"; + docstring = "Format code with LSP"; + key = "F"; + effect = ":lsp-formatting-sync"; + } + { + mode = "user"; + docstring = "Jump to definition"; + key = "d"; + effect = ":lsp-definition"; + } + { + mode = "user"; + docstring = "Rename object"; + key = "r"; + effect = ":lsp-rename-prompt"; + } + { + mode = "user"; + docstring = "Jump to type definition"; + key = "t"; + effect = ":lsp-type-definition"; + } + { + mode = "user"; + docstring = "List project diagnostics"; + key = "i"; + effect = ":lsp-diagnostics"; + } + { + mode = "user"; + docstring = "Paste from clipboard (after)"; + key = "P"; + effect = "${pkgs.xclip}/bin/xclip -selection clipboard -o"; + } + { + mode = "user"; + docstring = "Paste from clipboard (before)"; + key = "p"; + effect = "!${pkgs.xclip}/bin/xclip -selection clipboard -o"; + } + { + mode = "user"; + docstring = "Show hover info"; + key = "q"; + effect = ":lsp-hover"; + } + { + mode = "user"; + docstring = "Spellcheck English"; + key = "S"; + effect = ":spell en"; + } + { + mode = "user"; + docstring = "Spellcheck"; + key = "s"; + effect = ":spell "; + } + { + mode = "normal"; + docstring = "Try next snippet placeholder"; + key = ""; + effect = ": insert-c-n"; + } # { mode = "normal"; docstring = "Search"; key = "/"; effect = "/(?i)"; } # { mode = "normal"; docstring = "Reverse search"; key = ""; effect = "(?i)"; } ]; hooks = with pkgs; [ - { name = "BufCreate"; option = ".*"; commands = "editorconfig-load"; } + { + 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'"; } + { + 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 }; @@ -148,7 +274,8 @@ in }; # THEME FILE - xdg.configFile."kak/colors/nord.kak".text = themeBuilder (pkgs.lib.rice.palette.toRgbShortHex pkgs.rice.colorPalette); + xdg.configFile."kak/colors/nord.kak".text = + themeBuilder (pkgs.lib.rice.palette.toRgbShortHex pkgs.rice.colorPalette); xdg.configFile."kak-lsp/kak-lsp.toml".text = '' snippet_support = false diff --git a/hm_modules/keepassxc.nix b/hm_modules/keepassxc.nix index f1effce..a96ac50 100644 --- a/hm_modules/keepassxc.nix +++ b/hm_modules/keepassxc.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { config.systemd.user.services.keepassxc = { Unit = { Description = "KeePassXC password manager"; diff --git a/hm_modules/kitty.nix b/hm_modules/kitty.nix index 17fe279..c12b694 100644 --- a/hm_modules/kitty.nix +++ b/hm_modules/kitty.nix @@ -1,25 +1,26 @@ { pkgs, ... }: let - strPalette = with pkgs.rice; pkgs.lib.rice.palette.toRgbHex rec { - foreground = colorPalette.normal.white; - background = colorPalette.normal.black; - color0 = colorPalette.normal.black; - color1 = colorPalette.normal.red; - color2 = colorPalette.normal.green; - color3 = colorPalette.normal.yellow; - color4 = colorPalette.normal.blue; - color5 = colorPalette.normal.magenta; - color6 = colorPalette.normal.cyan; - color7 = colorPalette.normal.white; - color8 = colorPalette.bright.black; - color9 = colorPalette.bright.red; - color10 = colorPalette.bright.green; - color11 = colorPalette.bright.yellow; - color12 = colorPalette.bright.blue; - color13 = colorPalette.bright.magenta; - color14 = colorPalette.bright.cyan; - color15 = colorPalette.bright.white; - }; + strPalette = with pkgs.rice; + pkgs.lib.rice.palette.toRgbHex rec { + foreground = colorPalette.normal.white; + background = colorPalette.normal.black; + color0 = colorPalette.normal.black; + color1 = colorPalette.normal.red; + color2 = colorPalette.normal.green; + color3 = colorPalette.normal.yellow; + color4 = colorPalette.normal.blue; + color5 = colorPalette.normal.magenta; + color6 = colorPalette.normal.cyan; + color7 = colorPalette.normal.white; + color8 = colorPalette.bright.black; + color9 = colorPalette.bright.red; + color10 = colorPalette.bright.green; + color11 = colorPalette.bright.yellow; + color12 = colorPalette.bright.blue; + color13 = colorPalette.bright.magenta; + color14 = colorPalette.bright.cyan; + color15 = colorPalette.bright.white; + }; in { programs.kitty = { @@ -32,7 +33,8 @@ in update_check_interval = 0; background_opacity = toString pkgs.rice.opacity; close_on_child_death = "yes"; - clipboard_control = "write-clipboard write-primary read-clipboard read-primary"; + clipboard_control = + "write-clipboard write-primary read-clipboard read-primary"; disable_ligatures = "never"; editor = "kak"; } // strPalette; diff --git a/hm_modules/latex.nix b/hm_modules/latex.nix index 96e61ef..90cf8a2 100644 --- a/hm_modules/latex.nix +++ b/hm_modules/latex.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { home.packages = with pkgs; [ bibtool tex2nix diff --git a/hm_modules/lf.nix b/hm_modules/lf.nix index 54701bf..15152f7 100644 --- a/hm_modules/lf.nix +++ b/hm_modules/lf.nix @@ -34,43 +34,46 @@ in source = lf_kitty_preview; # keybinding = "i"; }; - keybindings = { - "" = "$EDITOR $(fzf)"; - }; + keybindings = { "" = "$EDITOR $(fzf)"; }; commands = { - "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 - }}''; + "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 ${lf_kitty_cleaner} diff --git a/hm_modules/libinput-gestures.nix b/hm_modules/libinput-gestures.nix index c578c63..a8c844c 100644 --- a/hm_modules/libinput-gestures.nix +++ b/hm_modules/libinput-gestures.nix @@ -10,9 +10,7 @@ in After = [ "graphical-session-pre.target" ]; PartOf = [ "graphical-session.target" ]; }; - Install = { - WantedBy = [ "graphical-session.target" ]; - }; + Install = { WantedBy = [ "graphical-session.target" ]; }; Service = { Type = "simple"; ExecStart = libinputGesturesCmd; diff --git a/hm_modules/lorri.nix b/hm_modules/lorri.nix index ea26f6c..b00b6ac 100644 --- a/hm_modules/lorri.nix +++ b/hm_modules/lorri.nix @@ -1,3 +1 @@ -{ - services.lorri.enable = true; -} +{ services.lorri.enable = true; } diff --git a/hm_modules/mangohud.nix b/hm_modules/mangohud.nix index 42518ad..3b771bf 100644 --- a/hm_modules/mangohud.nix +++ b/hm_modules/mangohud.nix @@ -3,7 +3,38 @@ enable = true; enableSessionWide = true; settings = { + toggle_fps_limit = "F1"; + legacy_layout = false; + gpu_stats = true; + gpu_temp = true; + gpu_text = "GPU"; + cpu_stats = true; + cpu_temp = true; + cpu_color = "2e97cb"; + cpu_text = "CPU"; + io_color = "a491d3"; + vram = true; + vram_color = "ad64c1"; + ram = true; + ram_color = "c26693"; + fps = true; + engine_color = "eb5b5b"; + gpu_color = "2e9762"; + wine_color = "eb5b5b"; + frame_timing = 1; + frametime_color = "00ff00"; + media_player_color = "ffffff"; + background_alpha = 0.4; + font_size = 24; + background_color = "020202"; + position = "top-left"; + text_color = "ffffff"; + round_corners = 0; toggle_hud = "Shift_L+F12"; + toggle_logging = "Shift_L+F2"; + upload_log = "F5"; + output_folder = "/home/bertof"; + media_player_name = "spotify"; }; }; } diff --git a/hm_modules/megasync.nix b/hm_modules/megasync.nix index 363d9d9..f329e45 100644 --- a/hm_modules/megasync.nix +++ b/hm_modules/megasync.nix @@ -1,11 +1,7 @@ { pkgs, ... }: -let - megasyncCmd = "${pkgs.megacmd}/bin/mega-cmd-server"; -in -{ - home.packages = [ - pkgs.megacmd - ]; +let megasyncCmd = "${pkgs.megacmd}/bin/mega-cmd-server"; +in { + home.packages = [ pkgs.megacmd ]; systemd.user.services."mega-cmd-server" = { Unit = { @@ -13,9 +9,7 @@ in After = [ "default.target" ]; PartOf = [ "default.target" ]; }; - Install = { - WantedBy = [ "default.target" ]; - }; + Install = { WantedBy = [ "default.target" ]; }; Service = { Type = "simple"; ExecStart = megasyncCmd; diff --git a/hm_modules/nautilus.nix b/hm_modules/nautilus.nix index a6f4e75..0b9b7b6 100644 --- a/hm_modules/nautilus.nix +++ b/hm_modules/nautilus.nix @@ -1,4 +1 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ gnome.nautilus ]; -} +{ pkgs, ... }: { home.packages = with pkgs; [ gnome.nautilus ]; } diff --git a/hm_modules/nix-index.nix b/hm_modules/nix-index.nix index 975c5ac..8a730d0 100644 --- a/hm_modules/nix-index.nix +++ b/hm_modules/nix-index.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { programs.nix-index = { enable = true; enableBashIntegration = true; @@ -20,7 +19,11 @@ timers."nix-index" = { Unit.Description = "Daily update the nix-locate database"; - Timer = { OnCalendar = "daily"; Persistent = true; Unit = "nix-index.service"; }; + Timer = { + OnCalendar = "daily"; + Persistent = true; + Unit = "nix-index.service"; + }; Install.WantedBy = [ "timers.target" ]; }; }; diff --git a/hm_modules/noti.nix b/hm_modules/noti.nix index d15112c..2f8d940 100644 --- a/hm_modules/noti.nix +++ b/hm_modules/noti.nix @@ -1,5 +1 @@ -{ - programs.noti = { - enable = true; - }; -} +{ programs.noti = { enable = true; }; } diff --git a/hm_modules/nushell.nix b/hm_modules/nushell.nix index c314fa3..5b47474 100644 --- a/hm_modules/nushell.nix +++ b/hm_modules/nushell.nix @@ -1,5 +1 @@ -{ - programs.nushell = { - enable = true; - }; -} +{ programs.nushell = { enable = true; }; } diff --git a/hm_modules/obs-studio.nix b/hm_modules/obs-studio.nix index 24d75cc..2c88b13 100644 --- a/hm_modules/obs-studio.nix +++ b/hm_modules/obs-studio.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { programs.obs-studio = { enable = true; package = pkgs.obs-studio; diff --git a/hm_modules/office.nix b/hm_modules/office.nix index 7813c0a..994cbe0 100644 --- a/hm_modules/office.nix +++ b/hm_modules/office.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { home.packages = with pkgs; [ # libreoffice-fresh onlyoffice-bin diff --git a/hm_modules/onedrive.nix b/hm_modules/onedrive.nix index f8b9fa0..11d6113 100644 --- a/hm_modules/onedrive.nix +++ b/hm_modules/onedrive.nix @@ -1,17 +1,13 @@ { pkgs, ... }: -let - onedriveCmd = "${pkgs.unstable.onedrive}/bin/onedrive --monitor"; -in -{ +let onedriveCmd = "${pkgs.unstable.onedrive}/bin/onedrive --monitor"; +in { systemd.user.services."onedrive" = { Unit = { Description = "OneDrive synchronization service"; After = [ "network.target" ]; PartOf = [ "default.target" ]; }; - Install = { - WantedBy = [ "default.target" ]; - }; + Install = { WantedBy = [ "default.target" ]; }; Service = { ExecStart = onedriveCmd; Restart = "always"; diff --git a/hm_modules/pass.nix b/hm_modules/pass.nix index 23de304..869e557 100644 --- a/hm_modules/pass.nix +++ b/hm_modules/pass.nix @@ -1,5 +1 @@ -{ - programs.password-store = { - enable = true; - }; -} +{ programs.password-store = { enable = true; }; } diff --git a/hm_modules/polybar.nix b/hm_modules/polybar.nix index e9cfe67..939ae80 100644 --- a/hm_modules/polybar.nix +++ b/hm_modules/polybar.nix @@ -9,7 +9,8 @@ let pgrep = "${pkgs.procps}/bin/pgrep"; pkill = "${pkgs.procps}/bin/pkill"; playerCtl = "${pkgs.playerctl}/bin/playerctl"; - playerStatus = "${playerCtl} -f '{{emoji(status)}} {{title}} - {{artist}}' metadata | ${head} -c 60"; + playerStatus = + "${playerCtl} -f '{{emoji(status)}} {{title}} - {{artist}}' metadata | ${head} -c 60"; systemctl = "${pkgs.systemd}/bin/systemctl"; loginctl = "${pkgs.systemd}/bin/loginctl"; shutdown = "${pkgs.systemd}/bin/shutdown"; @@ -17,39 +18,39 @@ let session=`${loginctl} session-status | ${pkgs.coreutils}/bin/head -n 1 | ${pkgs.gawk}/bin/awk '{print $1}'` ${loginctl} terminate-session $session ''; - colors = with pkgs.lib.rice; let - alpha = 255 * opacity; - in - palette.toARGBHex rec { + colors = with pkgs.lib.rice; + let alpha = 255 * opacity; + in palette.toARGBHex rec { - normal = { - foreground = colorPalette.normal.white; - background = color.setAlphaRgba alpha (colorPalette.normal.black); - underline = colorPalette.dark.blue; + normal = { + foreground = colorPalette.normal.white; + background = color.setAlphaRgba alpha (colorPalette.normal.black); + underline = colorPalette.dark.blue; + }; + + active = { + foreground = colorPalette.bright.white; + background = color.setAlphaRgba alpha (colorPalette.normal.black); + underline = colorPalette.bright.blue; + }; + + selected = { + foreground = colorPalette.bright.white; + background = color.setAlphaRgba alpha + (color.brighten 10 colorPalette.bright.black); + underline = colorPalette.bright.red; + }; + + alert = colorPalette.bright.red; + + green = colorPalette.normal.green; + yellow = colorPalette.normal.yellow; + orange = colorPalette.bright.red; + red = colorPalette.normal.red; + + transparent = color.transparent; }; - active = { - foreground = colorPalette.bright.white; - background = color.setAlphaRgba alpha (colorPalette.normal.black); - underline = colorPalette.bright.blue; - }; - - selected = { - foreground = colorPalette.bright.white; - background = color.setAlphaRgba alpha (color.brighten 10 colorPalette.bright.black); - underline = colorPalette.bright.red; - }; - - alert = colorPalette.bright.red; - - green = colorPalette.normal.green; - yellow = colorPalette.normal.yellow; - orange = colorPalette.bright.red; - red = colorPalette.normal.red; - - transparent = color.transparent; - }; - commonBar = { locale = config.home.language.base; monitor = "\${env:MONITOR}"; @@ -61,8 +62,14 @@ let foreground = colors.normal.foreground; line-size = 2; line-color = colors.normal.underline; - padding = { left = 0; right = 0; }; - module.margin = { left = 0; right = 0; }; + padding = { + left = 0; + right = 0; + }; + module.margin = { + left = 0; + right = 0; + }; separator = " "; border = { color = colors.transparent; @@ -72,7 +79,9 @@ let bottom.size = 0; }; font = [ - "${pkgs.rice.font.monospace.name}:size=${toString pkgs.rice.font.monospace.size};2" + "${pkgs.rice.font.monospace.name}:size=${ + toString pkgs.rice.font.monospace.size + };2" # "Font Awesome 6 Free:size=14;0" # "Noto Color Emoji:size=2;2" "Noto Sans Symbols2:size=${toString pkgs.rice.font.monospace.size};2" @@ -96,25 +105,23 @@ in 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 - ''; + 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; - }; + "settings" = { screenchange-reload = false; }; "bar/primary" = recursiveUpdate commonBar { modules-left = "bspwm"; # modules-center = - modules-right = "player pulseaudio temperature cpu memory battery date powermenu"; + modules-right = + "player pulseaudio temperature cpu memory battery date powermenu"; enable-ipc = true; tray = { position = "right"; @@ -125,7 +132,8 @@ in "bar/secondary" = recursiveUpdate commonBar { modules-left = "bspwm"; # modules-center = - modules-right = "player pulseaudio temperature cpu memory battery date powermenu"; + modules-right = + "player pulseaudio temperature cpu memory battery date powermenu"; enable-ipc = true; }; @@ -148,8 +156,12 @@ in }; format = { - charging = recursiveUpdate colors.selected { text = " "; }; - discharging = recursiveUpdate colors.active { text = " "; }; + charging = recursiveUpdate colors.selected { + text = " "; + }; + discharging = recursiveUpdate colors.active { + text = " "; + }; full = recursiveUpdate colors.normal { text = " "; }; }; @@ -176,8 +188,13 @@ in { focused = recursiveUpdate colors.selected common; occupied = recursiveUpdate colors.active common; - urgent = recursiveUpdate (recursiveUpdate colors.active common) { background = colors.alert; }; - empty = recursiveUpdate (recursiveUpdate colors.normal common) { text = "󰧟"; padding = 0; }; + urgent = recursiveUpdate (recursiveUpdate colors.active common) { + background = colors.alert; + }; + empty = recursiveUpdate (recursiveUpdate colors.normal common) { + text = "󰧟"; + padding = 0; + }; }; }; @@ -230,11 +247,14 @@ in colors.red ]; }; - click.right = "${pgrep} pavucontrol && ${pkill} pavucontrol || ${pavucontrol}"; + click.right = + "${pgrep} pavucontrol && ${pkill} pavucontrol || ${pavucontrol}"; format = { padding = 1; muted = colors.active; - volume = recursiveUpdate colors.normal { text = " "; }; + volume = recursiveUpdate colors.normal { + text = " "; + }; }; label.muted.text = "婢 muted"; label.volume.text = "%percentage%%"; @@ -250,7 +270,8 @@ in underline = colors.alert; }; }; - hwmon.path = "/sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input"; + hwmon.path = + "/sys/devices/platform/coretemp.0/hwmon/hwmon5/temp1_input"; label = { text = "%temperature-c%"; warn = "%temperature-c%"; @@ -275,22 +296,46 @@ in }; menu = [ [ - ({ text = "Logout"; exec = "#powermenu.open.1"; }) - ({ text = "Reboot"; exec = "#powermenu.open.2"; }) - ({ text = "Hibernate"; exec = "#powermenu.open.3"; }) - ({ text = "Power off"; exec = "#powermenu.open.4"; }) + ({ + text = "Logout"; + exec = "#powermenu.open.1"; + }) + ({ + text = "Reboot"; + exec = "#powermenu.open.2"; + }) + ({ + text = "Hibernate"; + exec = "#powermenu.open.3"; + }) + ({ + text = "Power off"; + exec = "#powermenu.open.4"; + }) ] [ - ({ text = "Logout"; exec = logout; }) + ({ + text = "Logout"; + exec = logout; + }) ] [ - ({ text = "Reboot"; exec = "${systemctl} reboot"; }) + ({ + text = "Reboot"; + exec = "${systemctl} reboot"; + }) ] [ - ({ text = "Hibernate"; exec = "${systemctl} hibernate"; }) + ({ + text = "Hibernate"; + exec = "${systemctl} hibernate"; + }) ] [ - ({ text = "Power off"; exec = "${shutdown} now"; }) + ({ + text = "Power off"; + exec = "${shutdown} now"; + }) ] ]; }; diff --git a/hm_modules/pro_audio.nix b/hm_modules/pro_audio.nix index 44d909a..784534e 100644 --- a/hm_modules/pro_audio.nix +++ b/hm_modules/pro_audio.nix @@ -2,10 +2,12 @@ let user = "bertof"; systemLibFolder = "/run/current-system/sw/lib/"; - userLibFolder = "/nix/var/nix/profiles/per-user/${user}/home-manager/home-path/lib/"; + userLibFolder = + "/nix/var/nix/profiles/per-user/${user}/home-manager/home-path/lib/"; variables = { DSSI_PATH = "$HOME/.dssi:${userLibFolder}/dssi:${systemLibFolder}/dssi"; - LADSPA_PATH = "$HOME/.ladspa:${userLibFolder}/ladspa:${systemLibFolder}/ladspa"; + 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"; diff --git a/hm_modules/pycharm.nix b/hm_modules/pycharm.nix index 3f98070..04d201c 100644 --- a/hm_modules/pycharm.nix +++ b/hm_modules/pycharm.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { home.packages = with pkgs; [ jetbrains.pycharm-professional python3 diff --git a/hm_modules/python.nix b/hm_modules/python.nix index a6ab8fa..351a48c 100644 --- a/hm_modules/python.nix +++ b/hm_modules/python.nix @@ -1,10 +1,9 @@ { pkgs, ... }: { - home.packages = with pkgs; [ - black - ] ++ (with pkgs.python3Packages; [ - python-lsp-server - # pyls-black # not updated to the new pylsp - pyls-flake8 - pyls-isort - ]); + home.packages = with pkgs; + [ black ] ++ (with pkgs.python3Packages; [ + python-lsp-server + # pyls-black # not updated to the new pylsp + pyls-flake8 + pyls-isort + ]); } diff --git a/hm_modules/rofi.nix b/hm_modules/rofi.nix index d486547..7b759ce 100644 --- a/hm_modules/rofi.nix +++ b/hm_modules/rofi.nix @@ -2,10 +2,10 @@ programs.rofi = { enable = true; location = "center"; - font = "${pkgs.rice.font.monospace.name} ${toString pkgs.rice.font.monospace.size}"; - extraConfig = { - modi = "drun,run,ssh,window"; - }; + font = "${pkgs.rice.font.monospace.name} ${ + toString pkgs.rice.font.monospace.size + }"; + extraConfig = { modi = "drun,run,ssh,window"; }; terminal = "kitty"; theme = "onedark"; }; diff --git a/hm_modules/rofimoji.nix b/hm_modules/rofimoji.nix index f897e44..c1a6901 100644 --- a/hm_modules/rofimoji.nix +++ b/hm_modules/rofimoji.nix @@ -1,8 +1,5 @@ -{ pkgs, ... }: -{ - home.packages = [ - pkgs.rofimoji - ]; +{ pkgs, ... }: { + home.packages = [ pkgs.rofimoji ]; xdg.configFile."rofimoji.rc".text = '' action=copy diff --git a/hm_modules/rust.nix b/hm_modules/rust.nix index ce75c16..04f9a87 100644 --- a/hm_modules/rust.nix +++ b/hm_modules/rust.nix @@ -1,10 +1,3 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ - bacon - cargo - clippy - rust-analyzer - rustfmt - ]; +{ pkgs, ... }: { + home.packages = with pkgs; [ bacon cargo clippy rust-analyzer rustfmt ]; } diff --git a/hm_modules/screen_locker.nix b/hm_modules/screen_locker.nix index 6045e4c..6439ddb 100644 --- a/hm_modules/screen_locker.nix +++ b/hm_modules/screen_locker.nix @@ -1,12 +1,8 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { services.screen-locker = { enable = true; lockCmd = "${pkgs.lockscreen}/bin/lockscreen"; inactiveInterval = 2; # minutes - xautolock.extraOptions = [ - "-secure" - "-lockaftersleep" - ]; + xautolock.extraOptions = [ "-secure" "-lockaftersleep" ]; }; } diff --git a/hm_modules/security.nix b/hm_modules/security.nix index 6054f64..23d49fe 100644 --- a/hm_modules/security.nix +++ b/hm_modules/security.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { home.packages = with pkgs; [ # RECOGNITION nmap diff --git a/hm_modules/ssh.nix b/hm_modules/ssh.nix index 64c96c1..cc4e51a 100644 --- a/hm_modules/ssh.nix +++ b/hm_modules/ssh.nix @@ -2,8 +2,6 @@ programs.ssh = { enable = true; compression = true; - matchBlocks = { - "*" = { identityFile = "~/.ssh/id_ed25519"; }; - }; + matchBlocks = { "*" = { identityFile = "~/.ssh/id_ed25519"; }; }; }; } diff --git a/hm_modules/sxhkd.nix b/hm_modules/sxhkd.nix index cbc2778..47b9e1c 100644 --- a/hm_modules/sxhkd.nix +++ b/hm_modules/sxhkd.nix @@ -1,5 +1,4 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { imports = [ ./nautilus.nix ]; home.packages = with pkgs; [ bc @@ -25,41 +24,55 @@ keybindings = { "alt + Tab" = "rofi -show window"; "Print" = "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 + {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 + {q,r}" = "bspc {quit,wm -r}"; - "super + alt + {Right,Down,Left}" = "playerctl {next,play-pause,previous}"; - "super + alt + shift + {h,j,k,l}" = "bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}"; + "super + alt + {Right,Down,Left}" = + "playerctl {next,play-pause,previous}"; + "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" = "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 + {m,x,y,z}" = + "bspc node -g {marked,locked,sticky,private}"; + "super + ctrl + shift + space" = + "bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel"; "super + ctrl + space" = "bspc node -p cancel"; "super + e" = fileManager; "super + 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 + {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 + {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 + 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 + {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 + }@space " = "rofi -show {drun,run}"; "super + {_,shift + }w" = "bspc node -{c,k}"; - "super + {t,shift + t,s,f}" = "bspc node -t {tiled,pseudo_tiled,floating,fullscreen}"; + "super + {t,shift + t,s,f}" = + "bspc node -t {tiled,pseudo_tiled,floating,fullscreen}"; # "super + y" = "bspc node newest.marked.local -n newest.!automatic.local"; - "{XF86AudioLowerVolume,XF86AudioMute,XF86AudioRaiseVolume}" = "pamixer {-d 2 -u,-t,-i 2 -u} && dunstify -r 1 Volume `pamixer --get-volume-human`"; + "{XF86AudioLowerVolume,XF86AudioMute,XF86AudioRaiseVolume}" = + "pamixer {-d 2 -u,-t,-i 2 -u} && dunstify -r 1 Volume `pamixer --get-volume-human`"; "XF86Audio{Next,Play,Prev}" = "playerctl {next,play-pause,previous}"; - "XF86MonBrightness{Up,Down}" = ''xbacklight -{inc,dec} 10 && dunstify -r 2 Luminosità `printf "%.0f" $(xbacklight -get)`''; + "XF86MonBrightness{Up,Down}" = '' + xbacklight -{inc,dec} 10 && dunstify -r 2 Luminosità `printf "%.0f" $(xbacklight -get)`''; }; }; } diff --git a/hm_modules/syncthing.nix b/hm_modules/syncthing.nix index 2ab81c9..66ea77d 100644 --- a/hm_modules/syncthing.nix +++ b/hm_modules/syncthing.nix @@ -1,5 +1 @@ -{ - services.syncthing = { - enable = true; - }; -} +{ services.syncthing = { enable = true; }; } diff --git a/hm_modules/terminator.nix b/hm_modules/terminator.nix index eb73588..f07a284 100644 --- a/hm_modules/terminator.nix +++ b/hm_modules/terminator.nix @@ -7,12 +7,29 @@ let }; opacity = toString pkgs.rice.opacity; font = pkgs.rice.font.monospace; - colorString = with strPalette; normal: bright: builtins.concatStringsSep ":" [ normal.black normal.red normal.green normal.yellow normal.blue normal.magenta normal.cyan normal.white bright.black bright.red bright.green bright.yellow bright.blue bright.magenta bright.cyan bright.white ]; + colorString = with strPalette; + normal: bright: + builtins.concatStringsSep ":" [ + normal.black + normal.red + normal.green + normal.yellow + normal.blue + normal.magenta + normal.cyan + normal.white + bright.black + bright.red + bright.green + bright.yellow + bright.blue + bright.magenta + bright.cyan + bright.white + ]; in { - home.packages = with pkgs; [ - terminator - ]; + home.packages = with pkgs; [ terminator ]; xdg.configFile."terminator/config".text = with strPalette; '' [global_config] diff --git a/hm_modules/thunar.nix b/hm_modules/thunar.nix index 92d40b6..59166a0 100644 --- a/hm_modules/thunar.nix +++ b/hm_modules/thunar.nix @@ -1,8 +1 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs.xfce; [ - thunar - tumbler - xfconf - ]; -} +{ pkgs, ... }: { home.packages = with pkgs.xfce; [ thunar tumbler xfconf ]; } diff --git a/hm_modules/tmux.nix b/hm_modules/tmux.nix index 728270f..5e05551 100644 --- a/hm_modules/tmux.nix +++ b/hm_modules/tmux.nix @@ -1,14 +1,10 @@ -{ pkgs, ... }: -{ +{ pkgs, ... }: { programs.tmux = { enable = true; clock24 = true; escapeTime = 25; terminal = "screen-256color"; - plugins = with pkgs.tmuxPlugins; [ - nord - prefix-highlight - ]; + plugins = with pkgs.tmuxPlugins; [ nord prefix-highlight ]; extraConfig = '' set -g mouse on ''; diff --git a/hm_modules/update_background.nix b/hm_modules/update_background.nix index 5a8a556..e6ac4e5 100644 --- a/hm_modules/update_background.nix +++ b/hm_modules/update_background.nix @@ -1,8 +1,6 @@ { pkgs, ... }: -let - update_time = "10m"; -in -{ +let update_time = "10m"; +in { home.packages = [ pkgs.update-background ]; systemd.user.services."update-background" = { @@ -12,9 +10,7 @@ in PartOf = [ "graphical-session.target" ]; RequiresMountsFor = [ "/home/bertof/Immagini" ]; }; - Install = { - WantedBy = [ "graphical-session.target" ]; - }; + Install = { WantedBy = [ "graphical-session.target" ]; }; Service = { Type = "oneshot"; IOSchedulingClass = "idle"; diff --git a/hm_modules/webapp.nix b/hm_modules/webapp.nix index 26bc9f9..27a3054 100644 --- a/hm_modules/webapp.nix +++ b/hm_modules/webapp.nix @@ -4,17 +4,59 @@ let # cmd = link: "google-chrome-stable --app=${link}"; cmd = link: "firefox ${link}"; links = [ - { desktopName = "Google Calendar"; link = "https://google.com/calendar"; categories = [ "Office" ]; } - { desktopName = "Google Keep"; link = "https://keep.google.com"; categories = [ "Office" ]; } - { desktopName = "Monkeytype"; link = "https://monkeytype.com/"; } - { desktopName = "Netflix"; link = "https://www.netflix.com"; categories = [ "AudioVideo" ]; } - { desktopName = "Notion"; link = "https://notion.so"; categories = [ "Office" ]; } - { desktopName = "Prime Video"; link = "https://primevideo.com"; categories = [ "AudioVideo" ]; } - { desktopName = "Protonmail"; link = "https://mail.protonmail.com"; categories = [ "Office" ]; } - { desktopName = "Twitch"; link = "https://www.twitch.tv"; categories = [ "AudioVideo" ]; } - { desktopName = "WhatsApp"; link = "https://web.whatsapp.com/"; } - { desktopName = "YouTube"; link = "https://www.youtube.com"; categories = [ "AudioVideo" ]; } - { desktopName = "Plex"; link = "https://app.plex.tv"; categories = [ "AudioVideo" ]; } + { + desktopName = "Google Calendar"; + link = "https://google.com/calendar"; + categories = [ "Office" ]; + } + { + desktopName = "Google Keep"; + link = "https://keep.google.com"; + categories = [ "Office" ]; + } + { + desktopName = "Monkeytype"; + link = "https://monkeytype.com/"; + } + { + desktopName = "Netflix"; + link = "https://www.netflix.com"; + categories = [ "AudioVideo" ]; + } + { + desktopName = "Notion"; + link = "https://notion.so"; + categories = [ "Office" ]; + } + { + desktopName = "Prime Video"; + link = "https://primevideo.com"; + categories = [ "AudioVideo" ]; + } + { + desktopName = "Protonmail"; + link = "https://mail.protonmail.com"; + categories = [ "Office" ]; + } + { + desktopName = "Twitch"; + link = "https://www.twitch.tv"; + categories = [ "AudioVideo" ]; + } + { + desktopName = "WhatsApp"; + link = "https://web.whatsapp.com/"; + } + { + desktopName = "YouTube"; + link = "https://www.youtube.com"; + categories = [ "AudioVideo" ]; + } + { + desktopName = "Plex"; + link = "https://app.plex.tv"; + categories = [ "AudioVideo" ]; + } ]; webAppBuilder = { desktopName @@ -23,11 +65,10 @@ let , icon ? lib.toLower name , comment ? null , categories ? [ "Network" ] - }: pkgs.makeDesktopItem { + }: + pkgs.makeDesktopItem { inherit name icon desktopName comment categories; exec = cmd link; }; in -{ - home.packages = map webAppBuilder links; -} +{ home.packages = map webAppBuilder links; } diff --git a/hm_modules/xidlehook.nix b/hm_modules/xidlehook.nix index abcc501..f0b11c9 100644 --- a/hm_modules/xidlehook.nix +++ b/hm_modules/xidlehook.nix @@ -10,7 +10,8 @@ let lightLevel = 10; saveLightLevel = "${xbacklightCmd} -get > /run/user/$UID/xbacklight_v"; lowerLight = "${xbacklightCmd} -set ${toString lightLevel}"; - resetLight = "${xbacklightCmd} -set $(