From ccc2cdab2093a2526695c977523c1e9b34fce68c Mon Sep 17 00:00:00 2001 From: Krosh Date: Tue, 18 Nov 2025 04:22:01 +0300 Subject: [PATCH] multiple updates --- home-manager/flake.nix | 26 ++--- home-manager/home.nix | 9 +- home-manager/modules/git.nix | 6 +- home-manager/modules/hypr/TODO | 1 - home-manager/modules/hypr/hypr.nix | 20 +++- home-manager/modules/kitty.nix | 11 +-- home-manager/modules/programs.nix | 148 ++--------------------------- home-manager/modules/zsh/zsh.nix | 6 +- nixos/custom.nix | 38 +------- remove-all-bckps.sh | 15 +++ 10 files changed, 68 insertions(+), 212 deletions(-) delete mode 100644 home-manager/modules/hypr/TODO create mode 100755 remove-all-bckps.sh diff --git a/home-manager/flake.nix b/home-manager/flake.nix index 64ccb7b..7010fdf 100644 --- a/home-manager/flake.nix +++ b/home-manager/flake.nix @@ -12,24 +12,18 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.home-manager.follows = "home-manager"; }; - - illogical-flake = { - url = "github:soymou/illogical-flake"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; - outputs = inputs@{ nixpkgs, home-manager, illogical-flake, ... }: - let system = "x86_64-linux"; + outputs = inputs@{ nixpkgs, home-manager, ... }: + let + system = "x86_64-linux"; + username = "krosh"; # TODO: make it universal in { - homeConfigurations.krosh = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.${system}; - modules = [ - ./home.nix - # illogical-flake.homeManagerModules.default - # { programs.illogical-impulse.enable = true; } - ]; - extraSpecialArgs = { inherit inputs; }; - }; + homeConfigurations.${username} = + home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.${system}; + modules = [ ./home.nix ]; + extraSpecialArgs = { inherit inputs; }; + }; }; } diff --git a/home-manager/home.nix b/home-manager/home.nix index 24ce56f..b9804b2 100755 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -10,7 +10,7 @@ ./modules/git.nix ./modules/programs.nix ./modules/custom/config.nix - ./modules/hypr/hypr.nix + ./modules/hypr/hypr.nix # TODO: make file with var for enable/disable hyprland ./modules/tmux.nix ]; @@ -31,9 +31,12 @@ ''; }; in getFrom - "https://github.com/ful1e5/fuchsia-cursor/releases/download/v2.0.0/Fuchsia-Pop.tar.gz" - "sha256-BvVE9qupMjw7JRqFUj1J0a4ys6kc9fOLBPx2bGaapTk=" "Fuchsia-Pop"; + "https://github.com/catppuccin/cursors/releases/download/v2.0.0/catppuccin-mocha-dark-cursors.zip" + "sha256-EbBzbSBalFx6oo85I7at/wYyoGZuJxIbOWBNrfqHey0=" "Catppuccin-Mocha-Dark"; + # "https://github.com/ful1e5/fuchsia-cursor/releases/download/v2.0.1/Fuchsia.tar.xz" + # "sha256-TuhU8UFo0hbVShqsWy9rTKnMV8/WHqsxmpqWg1d9f84=" "Fuchsia"; + # TODO: make it universal home.username = "krosh"; home.homeDirectory = "/home/krosh"; home.stateVersion = "25.05"; diff --git a/home-manager/modules/git.nix b/home-manager/modules/git.nix index 27cb772..46e7cb3 100644 --- a/home-manager/modules/git.nix +++ b/home-manager/modules/git.nix @@ -3,9 +3,9 @@ { programs.git = { enable = true; - - userEmail = "gudovdo@my.msu.ru"; - userName = "Krosh"; extraConfig.pull.rebase = true; + + userEmail = "your email"; + userName = "your name"; }; } diff --git a/home-manager/modules/hypr/TODO b/home-manager/modules/hypr/TODO deleted file mode 100644 index f87f5c1..0000000 --- a/home-manager/modules/hypr/TODO +++ /dev/null @@ -1 +0,0 @@ -# TODO \ No newline at end of file diff --git a/home-manager/modules/hypr/hypr.nix b/home-manager/modules/hypr/hypr.nix index dba92ec..03850c6 100644 --- a/home-manager/modules/hypr/hypr.nix +++ b/home-manager/modules/hypr/hypr.nix @@ -1,13 +1,31 @@ { config, pkgs, ... }: +# TODO: +# - make shortcuts for hyprctl commands +# - split into multiple files +# - configure comands like hyprpaper, waybar, etc. + { - home.packages = with pkgs; [ hyprland ]; + home.packages = with pkgs; [ + hyprland # already in nixos modules, but here for hyprctl + brightnessctl + ]; programs.hyprpanel = { enable = true; systemd.enable = true; }; programs.fuzzel.enable = true; + wayland.windowManager.hyprland.settings = { + exec-once = [ + # Fixes cursor themes in gnome apps under hyprland + "gsettings set org.gnome.desktop.interface cursor-theme '${config.home.pointerCursor.name}'" + "gsettings set org.gnome.desktop.interface cursor-size ${ + toString config.home.pointerCursor.size + }" + ]; + }; + # wayland.windowManager.hyprland = { # enable = true; diff --git a/home-manager/modules/kitty.nix b/home-manager/modules/kitty.nix index fd025a0..b31fa47 100644 --- a/home-manager/modules/kitty.nix +++ b/home-manager/modules/kitty.nix @@ -19,16 +19,15 @@ background_blur = 5; confirm_os_window_close = 0; - map = '' - ctrl+c copy_or_interrupt - ctrl+v paste_from_clipboard - ctrl+shift+v paste_from_clipboard - ''; shell = "${pkgs.zsh}/bin/zsh"; }; - keybindings = { "ctrl+shift+enter" = "new_window_with_cwd"; }; + keybindings = { + "ctrl+shift+enter" = "new_window_with_cwd"; + "ctrl+c" = "copy_or_interrupt"; + "ctrl+v" = "paste_from_clipboard"; + }; extraConfig = '' # --- Catppuccin Mocha (dark) theme --- diff --git a/home-manager/modules/programs.nix b/home-manager/modules/programs.nix index c851473..39f9cae 100644 --- a/home-manager/modules/programs.nix +++ b/home-manager/modules/programs.nix @@ -1,151 +1,15 @@ { inputs, config, lib, pkgs, ... }: -{ - home.packages = with pkgs; [ - telegram-desktop - vscode - spotify - brightnessctl - ]; +# TODO: split into multiple files +{ + home.packages = with pkgs; [ telegram-desktop vscode spotify ]; + + # do i really need it? programs.direnv.enable = true; programs.direnv.nix-direnv.enable = true; programs.direnv.enableZshIntegration = true; imports = [ inputs.zen-browser.homeModules.twilight ]; - programs.zen-browser = { - enable = true; - # any other options under `programs.firefox` are also supported here. - # see `man home-configuration.nix`. - }; - - programs.anyrun.enable = true; - programs.anyrun.config = { - x = { fraction = 0.5; }; - y = { absolute = 0; }; - width = { absolute = 800; }; - height = { absolute = 1; }; - - hideIcons = false; - ignoreExclusiveZones = false; - layer = "overlay"; - hidePluginInfo = false; - closeOnClick = false; - showResultsImmediately = false; - maxEntries = null; - - plugins = - [ "libapplications.so" "libsymbols.so" "libshell.so" "libtranslate.so" ]; - - # keybinds = [ - # { - # key = "Return"; - # action = "Select"; - # } - # { - # key = "Up"; - # action = "Up"; - # } - # { - # key = "Down"; - # action = "Down"; - # } - # { - # key = "ISO_Left_Tab"; - # action = "Up"; - # shift = true; - # } - # { - # key = "Tab"; - # action = "Down"; - # } - # { - # key = "Escape"; - # action = "Close"; - # } - # ]; - }; - - # programs.anyrun.extraConfigFiles."config.ron".text = '' - # Config( - # // Position/size fields use an enum for the value, it can be either: - # // Absolute(n): The absolute value in pixels - # // Fraction(n): A fraction of the width or height of the full screen (depends on exclusive zones and the settings related to them) window respectively - - # // The horizontal position, adjusted so that Relative(0.5) always centers the runner - # x: Fraction(0.5), - - # // The vertical position, works the same as `x` - # y: Absolute(0), - - # // The width of the runner - # width: Absolute(800), - - # // The minimum height of the runner, the runner will expand to fit all the entries - # // NOTE: If this is set to 0, the window will never shrink after being expanded - # height: Absolute(1), - - # // Hide match and plugin info icons - # hide_icons: false, - - # // ignore exclusive zones, f.e. Waybar - # ignore_exclusive_zones: false, - - # // Layer shell layer: Background, Bottom, Top, Overlay - # layer: Overlay, - - # // Hide the plugin info panel - # hide_plugin_info: false, - - # // Close window when a click outside the main box is received - # close_on_click: false, - - # // Show search results immediately when Anyrun starts - # show_results_immediately: false, - - # // Limit amount of entries shown in total - # max_entries: None, - - # // List of plugins to be loaded by default, can be specified with a relative path to be loaded from the - # // `/plugins` directory or with an absolute path to just load the file the path points to. - # // - # // The order of plugins here specifies the order in which they appear - # // in the results. As in it works as a priority for the plugins. - # plugins: [ - # "libapplications.so", - # "libsymbols.so", - # "libshell.so", - # "libtranslate.so", - # ], - - # keybinds: [ - # Keybind( - # key: "Return", - # action: Select, - # ), - # Keybind( - # key: "Up", - # action: Up, - # ), - # Keybind( - # key: "Down", - # action: Down, - # ), - # Keybind( - # key: "ISO_Left_Tab", - # action: Up, - # shift: true, - # ), - # Keybind( - # key: "Tab", - # action: Down, - # ), - # Keybind( - # key: "Escape", - # action: Close, - # ), - # ], - # ) - # ''; - + programs.zen-browser = { enable = true; }; } diff --git a/home-manager/modules/zsh/zsh.nix b/home-manager/modules/zsh/zsh.nix index d62263d..0dd052e 100644 --- a/home-manager/modules/zsh/zsh.nix +++ b/home-manager/modules/zsh/zsh.nix @@ -67,9 +67,9 @@ amnezia = '' (pgrep -x ".AmneziaVPN-ser" > /dev/null 2>&1 || sudo AmneziaVPN-service > /dev/null 2>&1 &) & AmneziaVPN > /dev/null 2>&1 & - ''; # i don't know any good ways for it. - mkenv = '' - echo "use nix" > .envrc && touch default.nix && direnv allow && echo "✓ env created"''; + ''; # TODO: start system with service + # mkenv = '' + # echo "use nix" > .envrc && touch default.nix && direnv allow && echo "✓ env created"''; }; diff --git a/nixos/custom.nix b/nixos/custom.nix index f096a1a..6f549d6 100644 --- a/nixos/custom.nix +++ b/nixos/custom.nix @@ -12,43 +12,7 @@ nixpkgs.config.allowUnfree = true; environment.systemPackages = with pkgs; [ kitty amnezia-vpn lenovo-legion ]; - # hardware.fancontrol.enable = true; - # hardware.fancontrol.config = '' - # INTERVAL=5 - # FCTEMPS=( /sys/class/hwmon/hwmon9/temp1_input ) - # FCFANS=( /sys/class/hwmon/hwmon9/pwm1 ) - # MINTEMP=25 - # MAXTEMP=90 - # MINPWM=50 - # MAXPWM=200 - # ''; - # hardware.fancontrol.config = '' - # INTERVAL=2 - - # FCTEMPS=hwmon9/device/pwm1=/sys/class/hwmon/hwmon0/temp1_input - # FCFANS=hwmon9/device/pwm1=/sys/class/hwmon/hwmon9/fan1_input - - # MINTEMP=hwmon9/device/pwm1=25 - # MAXTEMP=hwmon9/device/pwm1=80 - - # MINPWM=hwmon9/device/pwm1=0 - # MAXPWM=hwmon9/device/pwm1=220 - - # MINSTART=hwmon9/device/pwm1=25 - # MINSTOP=hwmon9/device/pwm1=0 - # ''; - - # services.thinkfan = { - # enable = true; - # levels = [ - # [ 0 0 25 ] # level, low temp, high temp - # [ 1 20 55 ] - # [ 2 50 65 ] - # [ 3 60 75 ] - # [ 4 70 85 ] - # [ 7 80 200 ] - # ]; - # }; + # TODO: Добавить настройку вентиляторов security.sudo.extraRules = [{ users = [ "ALL" ]; diff --git a/remove-all-bckps.sh b/remove-all-bckps.sh new file mode 100755 index 0000000..057b0b5 --- /dev/null +++ b/remove-all-bckps.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root (sudo)." 1>&2 + exit 1 +fi + +echo "Removing all backups in /etc/nixos..." +rm -rf /etc/nixos.bak.* + +echo "Removing all backups in $HOME/.config/home-manager..." +rm -rf $HOME/.config/home-manager.bak.* + +echo "Done!" \ No newline at end of file