From 4851e04bfafe541ab50c5def3ca159c5876564cd Mon Sep 17 00:00:00 2001 From: Buliway Date: Thu, 8 Aug 2024 09:06:32 +0300 Subject: [PATCH] ready2 --- README.md | 7 ++++- .../file-managers/ranger/ranger.nix | 15 +++++++--- .../file-managers/thunar/thunar.nix | 2 +- modules/home-manager/imv/imv.nix | 2 +- modules/home-manager/mangohud.nix | 3 +- modules/home-manager/symlinks.nix | 6 +++- modules/home-manager/terminal/kitty.nix | 10 ++++--- modules/home-manager/terminal/starship.nix | 2 +- modules/home-manager/wm/bspwm/bspwm.nix | 2 +- modules/home-manager/wm/dunst.nix | 28 ++++++++++--------- modules/home-manager/wm/rofi/rofi.nix | 4 +-- modules/nixos/stylix.nix | 7 +++-- modules/nixos/xserver.nix | 6 ++-- nixos/configuration.nix | 7 +++-- nixos/packages.nix | 7 +++-- 15 files changed, 69 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 4e26610..ad76045 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,12 @@ Чтоб узнать sha256 для гитхаб репы, пишем в терминал эту команду: ```sh -nix-prefetch-git link-to-git-repo +nix-prefetch-git link +``` + +Если хочется поменять цвета или шрифты в конфиге какой-то программы, но при ребилде получается конфликт, то дело в Stylix, который управляет системной темой и сам везде ставит шрифты и цвета. Если хочется заменить, не трогая stylix, то надо добавить `lib.mkForce` перед значением. Например так: +```nix +font = lib.mkForce "JetBrainsMono Nerd Font 11"; ``` ## Бинды diff --git a/modules/home-manager/file-managers/ranger/ranger.nix b/modules/home-manager/file-managers/ranger/ranger.nix index 4bba285..d3c0c02 100644 --- a/modules/home-manager/file-managers/ranger/ranger.nix +++ b/modules/home-manager/file-managers/ranger/ranger.nix @@ -71,9 +71,16 @@ ]; }; - home.file = { - ".config/ranger/rc.conf" = ./rc.conf; - ".config/ranger/rifle.conf" = ./rifle.conf; - ".config/ranger/scope.sh" = ./scope.sh; + # Не работает, ошибка будет, надо юзать другую команду + # home.file = { + # ".config/ranger/rc.conf".source = "./rc.conf"; + # ".config/ranger/rifle.conf".source = "./rifle.conf"; + # ".config/ranger/scope.sh".source = "./scope.sh"; + # }; + + xdg.configFile = { + "ranger/rc.conf".source = "./rc.conf"; + "ranger/rifle.conf".source = "./rifle.conf"; + "ranger/scope.sh".source = "./scope.sh"; }; } \ No newline at end of file diff --git a/modules/home-manager/file-managers/thunar/thunar.nix b/modules/home-manager/file-managers/thunar/thunar.nix index c344dca..c0fff3e 100644 --- a/modules/home-manager/file-managers/thunar/thunar.nix +++ b/modules/home-manager/file-managers/thunar/thunar.nix @@ -1,3 +1,3 @@ { # Thunar file manager settings - home.file.".config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml".source = ./thunar.xml; + xdg.configFile."xfce4/xfconf/xfce-perchannel-xml/thunar.xml".source = ./thunar.xml; } \ No newline at end of file diff --git a/modules/home-manager/imv/imv.nix b/modules/home-manager/imv/imv.nix index 24a68c7..78e0b08 100644 --- a/modules/home-manager/imv/imv.nix +++ b/modules/home-manager/imv/imv.nix @@ -1,5 +1,5 @@ { programs.imv.enable = true; - home.file.".config/imv/config".source = ./config; + xdg.configFile."imv/config".source = ./config; } \ No newline at end of file diff --git a/modules/home-manager/mangohud.nix b/modules/home-manager/mangohud.nix index dcda649..8144958 100644 --- a/modules/home-manager/mangohud.nix +++ b/modules/home-manager/mangohud.nix @@ -18,7 +18,8 @@ # enableSessionWide = true; # Sets environment variables so that MangoHud is started on any application that supports it. }; - home.file.".config/MangoHud/MangoHud.conf".text = '' + # home.file.".config/MangoHud/MangoHud.conf".text = '' + xdg.configFile."MangoHud/MangoHud.conf".text = '' ### pre defined presets # -1 = default # 0 = no display diff --git a/modules/home-manager/symlinks.nix b/modules/home-manager/symlinks.nix index 3e7814b..6c4f3f2 100644 --- a/modules/home-manager/symlinks.nix +++ b/modules/home-manager/symlinks.nix @@ -1,7 +1,7 @@ let dir = "backups"; # Имя каталога для бекапов. Мб захочу поменять in { - home.file = { + home.file = { # В .config этим нельзя кидать # "${dir}".source = "/mnt/${dir}"; # Чтоб остальные симлинки были от ~/backups # Secrets @@ -18,4 +18,8 @@ in { # Не знаю на счёт strawberry, obs, chatbox, planify, calibre, discord и браузеров }; + + xdg.configFile = { # Это для каталога .config + + }; } \ No newline at end of file diff --git a/modules/home-manager/terminal/kitty.nix b/modules/home-manager/terminal/kitty.nix index 5475ae0..4765b91 100644 --- a/modules/home-manager/terminal/kitty.nix +++ b/modules/home-manager/terminal/kitty.nix @@ -1,4 +1,4 @@ -{ +{ pkgs, ... }: { programs.kitty = { # Быстрое отображение медиа, но кривой SSH enable = true; @@ -8,8 +8,10 @@ enableZshIntegration = true; }; - font = { - name = "JetBrainsMono Nerd Font"; - }; + # font = { # Stylix сам укажет mono шрифт + # name = "JetBrainsMono Nerd Font"; + # package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}; + # size = 9; + # }; }; } \ No newline at end of file diff --git a/modules/home-manager/terminal/starship.nix b/modules/home-manager/terminal/starship.nix index 506ac7e..1e3eb26 100644 --- a/modules/home-manager/terminal/starship.nix +++ b/modules/home-manager/terminal/starship.nix @@ -10,5 +10,5 @@ enableTransience = true; # Fish Shell only. Отображает пустую строку при нажатии enter? }; - home.file.".config/starship.toml".source = ./starship.toml; + xdg.configFile."starship.toml".source = ./starship.toml; } \ No newline at end of file diff --git a/modules/home-manager/wm/bspwm/bspwm.nix b/modules/home-manager/wm/bspwm/bspwm.nix index 3d69de8..9d0fc01 100644 --- a/modules/home-manager/wm/bspwm/bspwm.nix +++ b/modules/home-manager/wm/bspwm/bspwm.nix @@ -3,5 +3,5 @@ enable = true; }; - home.file.".config/bspwm/bspwmrc".source = "./bspwmrc"; + xdg.configFile."bspwm/bspwmrc".source = "./bspwmrc"; } diff --git a/modules/home-manager/wm/dunst.nix b/modules/home-manager/wm/dunst.nix index d09b0cc..61c32ee 100644 --- a/modules/home-manager/wm/dunst.nix +++ b/modules/home-manager/wm/dunst.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: { +{ pkgs, lib, ... }: { # Оповещения. Бинды можно делать через "dunstctl" # https://wiki.archlinux.org/title/Dunst # https://dunst-project.org/documentation/ @@ -48,7 +48,7 @@ horizontal_padding = 6; # Horizontal padding. text_icon_padding = 0; # Padding between text and icon. frame_width = 3; # Defines width in pixels of frame around the notification window. Set to 0 to disable. - frame_color = "#8EC07C"; # Defines color of the frame around the notification window. + # frame_color = "#8EC07C"; # Defines color of the frame around the notification window. sort = "no"; # Sort messages by urgency. # Don't remove messages, if the user is idle (no mouse or keyboard input) for longer than idle_threshold seconds. @@ -63,13 +63,13 @@ # * foreground: use the same color as the foreground; # * frame: use the same color as the frame; # * anything else will be interpreted as a X color. - separator_color = "frame"; + # separator_color = "frame"; ############ ### Text ### ############ - font = "JetBrainsMono Nerd Font 11"; + font = lib.mkForce "JetBrainsMono Nerd Font 11"; # Перезаписать шрифт от stylix # The spacing between lines. # If the height is smaller than the font height, it will get raised to the font height. @@ -126,6 +126,8 @@ ############# enable_recursive_icon_lookup = true; # Чтоб не надо было указывать icon_path + # icon_theme = "Gruvbox-Plus-Dark"; + icon_path = "/usr/share/icons/Gruvbox-Plus-Dark/"; # Один хуй требуют указать icon_position = "off"; # Align icons left/right/off # Не знаю надо ли, когда я указал размер иконок в начале файла @@ -211,9 +213,9 @@ urgency_low = { # IMPORTANT: colors have to be defined in quotation marks. # Otherwise the "#" and following would be interpreted as a comment. - frame_color = "#3B7C87"; - foreground = "#3B7C87"; - background = "#191311"; + # frame_color = "#3B7C87"; + # foreground = "#3B7C87"; + # background = "#191311"; #background = "#2B313C"; timeout = 4; # Icon for notifications with low urgency, uncomment to enable @@ -221,9 +223,9 @@ }; urgency_normal = { - frame_color = "#5B8234"; - foreground = "#5B8234"; - background = "#191311"; + # frame_color = "#5B8234"; + # foreground = "#5B8234"; + # background = "#191311"; #background = "#2B313C"; timeout = 6; # Icon for notifications with normal urgency, uncomment to enable @@ -231,9 +233,9 @@ }; urgency_critical = { - frame_color = "#B7472A"; - foreground = "#B7472A"; - background = "#191311"; + # frame_color = "#B7472A"; + # foreground = "#B7472A"; + # background = "#191311"; #background = "#2B313C"; timeout = 8; # Icon for notifications with critical urgency, uncomment to enable diff --git a/modules/home-manager/wm/rofi/rofi.nix b/modules/home-manager/wm/rofi/rofi.nix index ccd10e6..6213462 100644 --- a/modules/home-manager/wm/rofi/rofi.nix +++ b/modules/home-manager/wm/rofi/rofi.nix @@ -40,7 +40,7 @@ launcher = "rofi"; }; - # home.file = { - # ".config/rofi".source = "config.rasi"; + # xdg.configFile = { + # "rofi/pidor.rasi".source = "config.rasi"; # }; } diff --git a/modules/nixos/stylix.nix b/modules/nixos/stylix.nix index 492f5f7..3d3c5c1 100644 --- a/modules/nixos/stylix.nix +++ b/modules/nixos/stylix.nix @@ -28,6 +28,7 @@ liberation_ttf ]; + # Ширина символов одинаковая monospace = { # default = DejaVu Sans Mono package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}; name = "JetBrainsMono Nerd Font Mono"; @@ -38,11 +39,13 @@ name = "Noto Color Emoji"; }; + # Без засечек sansSerif = { # default = DejaVu Sans - package = pkgs.dejavu_fonts; - name = "DejaVu Sans"; + package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];}; + name = "JetBrainsMono Nerd Font"; }; + # С засечками serif = { # default = DejaVu Serif package = pkgs.dejavu_fonts; name = "DejaVu Serif"; diff --git a/modules/nixos/xserver.nix b/modules/nixos/xserver.nix index 12cfe4e..d0f477d 100644 --- a/modules/nixos/xserver.nix +++ b/modules/nixos/xserver.nix @@ -4,6 +4,10 @@ { pkgs, ... }: { + services.displayManager = { + defaultSession = "none+bspwm"; # only effective for GDM, LightDM and SDDM + }; + services.xserver = { enable = true; windowManager.bspwm.enable = true; @@ -50,8 +54,6 @@ # }; }; }; - - defaultSession = "none+bspwm"; # only effective for GDM, LightDM and SDDM }; xkb = { diff --git a/nixos/configuration.nix b/nixos/configuration.nix index b182999..9a9c857 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -7,6 +7,8 @@ let username = "buliway"; in { + nixpkgs.config.allowUnfree = true; + imports = [ /etc/nixos/hardware-configuration.nix inputs.home-manager.nixosModules.default @@ -38,14 +40,15 @@ in { home-manager = { # also pass inputs to home-manager modules + useGlobalPkgs = true; extraSpecialArgs = { inherit inputs; }; users.${username} = import ./home.nix; }; security.polkit = { # Всплывающее меню для ввода пароля enable = true; - package = pkgs.polkit_gnome; # Legacy polkit authentication agent for GNOME - # package = pkgs.lxde.lxsession; # Lightweight X11 gtk2 session manager + # package = pkgs.polkit_gnome; # Legacy polkit authentication agent for GNOME + package = pkgs.lxde.lxsession; # Lightweight X11 gtk2 session manager }; xdg.portal = { diff --git a/nixos/packages.nix b/nixos/packages.nix index 561d85b..abcabfc 100644 --- a/nixos/packages.nix +++ b/nixos/packages.nix @@ -1,7 +1,5 @@ { pkgs, ... }: { - nixpkgs.config.allowUnfree = true; - services = { gvfs.enable = true; # Mount, trash, and other functionalities for Thunar file manager tumbler.enable = true; # Thumbnail support for Thunar file manager @@ -14,6 +12,7 @@ }; programs = { + zsh.enable = true; mtr.enable = true; # Объединяет функции утилит traceroute и ping gnupg.agent = { enable = true; @@ -291,7 +290,9 @@ qmk # Прошивка для моих раздельных клавиатур vial # GUI для qmk, если клавиатура поддерживает - + fontconfig + zlib + google-fonts ]; } \ No newline at end of file