commit 8e38fa6ca4e02d13bc6ad33340f7cbf3de820f7e Author: Kirill Date: Thu Oct 31 18:52:25 2024 +0300 first commit diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..13d0bfd --- /dev/null +++ b/flake.lock @@ -0,0 +1,385 @@ +{ + "nodes": { + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1708890466, + "narHash": "sha256-LlrC09LoPi8OPYOGPXegD72v+//VapgAqhbOFS3i8sc=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "665b3c6748534eb766c777298721cece9453fdae", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1725860795, + "narHash": "sha256-Z2o8VBPW3I+KKTSfe25kskz0EUj7MpUh8u355Z1nVsU=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "7f795bf75d38e0eea9fed287264067ca187b88a9", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1716150083, + "narHash": "sha256-ZMhnNmw34ogE5rJZrjRv5MtG3WaqKd60ds2VXvT6hEc=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "6e955d704d046b0dc3e5c2d68a2a6eeffd2b5d3d", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": [ + "stylix", + "systems" + ] + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1689549921, + "narHash": "sha256-iX0pk/uB019TdBGlaJEWvBCfydT6sRq+eDcGPifVsCM=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "11fbbbfb32e3289d3c631e0134a23854e7865c84", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1713702291, + "narHash": "sha256-zYP1ehjtcV8fo+c+JFfkAqktZ384Y+y779fzmR9lQAU=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "0d0aadf013f78a7f7f1dc984d0d812971864b934", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "46.1", + "repo": "gnome-shell", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729864948, + "narHash": "sha256-CeGSqbN6S8JmzYJX/HqZjr7dMGlvHLLnJJarwB45lPs=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "0c0268a3c80d30b989d0aadbd65f38d4fa27a9a0", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1724435763, + "narHash": "sha256-UNky3lJNGQtUEXT2OY8gMxejakSWPTfWKvpFkpFlAfM=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "c2cd2a52e02f1dfa1c88f95abeb89298d46023be", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1729665710, + "narHash": "sha256-AlcmCXJZPIlO5dmFzV3V2XF6x/OpNWUV8Y/FMPGd8Z4=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2768c7d042a37de65bb1b5b3268fc987e534c49d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1729691686, + "narHash": "sha256-BAuPWW+9fa1moZTU+jFh+1cUtmsuF8asgzFwejM4wac=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "32e940c7c420600ef0d1ef396dc63b04ee9cad37", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1729357638, + "narHash": "sha256-66RHecx+zohbZwJVEPF7uuwHeqf8rykZTMCTqIrOew4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "bb8c2cf7ea0dd2e18a52746b2c3a5b0c73b93c22", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1729265718, + "narHash": "sha256-4HQI+6LsO3kpWTYuVGIzhJs1cetFcwT7quWCk/6rqeo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ccc0c2126893dd20963580b6478d1a10a4512185", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1725194671, + "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable", + "sops-nix": "sops-nix", + "stylix": "stylix" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": "nixpkgs_2", + "nixpkgs-stable": "nixpkgs-stable_2" + }, + "locked": { + "lastModified": 1729775275, + "narHash": "sha256-J2vtHq9sw1wWm0aTMXpEEAzsVCUMZDTEe5kiBYccpLE=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "78a0e634fc8981d6b564f08b6715c69a755c4c7d", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "gnome-shell": "gnome-shell", + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs_3", + "systems": "systems", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-tmux": "tinted-tmux" + }, + "locked": { + "lastModified": 1729380793, + "narHash": "sha256-TV6NYBUqTHI9t5fqNu4Qyr4BZUD2yGxAn3E+d5/mqaI=", + "owner": "danth", + "repo": "stylix", + "rev": "fb9399b7e2c855f42dae76a363bab28d4f24aa8d", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "stylix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tinted-foot": { + "flake": false, + "locked": { + "lastModified": 1696725948, + "narHash": "sha256-65bz2bUL/yzZ1c8/GQASnoiGwaF8DczlxJtzik1c0AU=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "eedbcfa30de0a4baa03e99f5e3ceb5535c2755ce", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1716423189, + "narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "eb39e141db14baef052893285df9f266df041ff8", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1696725902, + "narHash": "sha256-wDPg5elZPcQpu7Df0lI5O8Jv4A3T6jUQIVg63KDU+3Q=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "c02050bebb60dbb20cb433cd4d8ce668ecc11ba7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..f45b878 --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +{ + description = "My system configuration"; + + inputs = { + + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05"; + sops-nix.url = "github:Mic92/sops-nix"; + stylix.url = "github:danth/stylix"; + + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, nixpkgs, nixpkgs-stable, home-manager, ... }@inputs: + + let + system = "x86_64-linux"; + in { + + nixosConfigurations.usconfig = nixpkgs.lib.nixosSystem { + specialArgs = { + pkgs-stable = import nixpkgs-stable { + inherit system; + config.allowUnfree = true; + }; + inherit inputs system; + }; + modules = [ + ./nixos/hosts/usconfig/configuration.nix + ]; + }; + + homeConfigurations.kirill = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.${system}; + modules = [ + ./home-manager/home.nix + inputs.sops-nix.homeManagerModules.sops + inputs.stylix.homeManagerModules.stylix + ]; + }; + }; +} diff --git a/home-manager/data/git.nix b/home-manager/data/git.nix new file mode 100644 index 0000000..1a3aeb1 --- /dev/null +++ b/home-manager/data/git.nix @@ -0,0 +1,7 @@ +{ + programs.git = { + enable = true; + userName = "Kirill"; + userEmail = "kremizov3@gmail.com"; + }; +} diff --git a/home-manager/data/hyprland.nix b/home-manager/data/hyprland.nix new file mode 100644 index 0000000..c015d0a --- /dev/null +++ b/home-manager/data/hyprland.nix @@ -0,0 +1,242 @@ +{ pkgs, lib, config, ... }: { + wayland.windowManager.hyprland = + let + colors = config.lib.stylix.colors; + + wallpaper_changer = pkgs.writers.writePython3Bin "wallpaper_changer" { + flakeIgnore = [ "E501" "E111" "E701" "E241" "E731" ]; + } /*py*/ '' + from random import choice + from os import system, listdir + + folder = "/home/kirill/wallpapers" + filename = choice(listdir(folder)) + system(f"swww img {folder}/{filename} --transition-type center") + ''; + in { + enable = true; + xwayland.enable = true; + + settings = { + "$mainMod" = "SUPER"; + + monitor = ",preferred,auto,1"; + + env = [ + "LIBVA_DRIVER_NAME,nvidia" + "XDG_SESSION_TYPE,wayland" + "GBM_BACKEND,nvidia" + "__GLX_VENDOR_LIBRARY_NAME,nvidia" + "WLR_NO_HARDWARE_CURSORS,1" + "XDG_CURRENT_DESKTOP,Hyprland" + "XDG_SESSION_TYPE,wayland" + "XDG_SESSION_DESKTOP,Hyprland" + "XCURSOR_SIZE,36" + "QT_QPA_PLATFORM,wayland" + "XDG_SCREENSHOTS_DIR,~/screens" + ]; + + debug = { + disable_logs = false; + enable_stdout_logs = true; + }; + + input = { + kb_layout = "us,ru"; + kb_variant = "lang"; + kb_options = "grp:caps_toggle"; + + follow_mouse = 1; + + touchpad = { + natural_scroll = false; + }; + + sensitivity = 0; # -1.0 - 1.0, 0 means no modification. + }; + + general = { + gaps_in = 5; + gaps_out = 20; + border_size = 3; + "col.active_border" = "rgba(${colors.base0C}ee) rgba(${colors.base0B}ee) 45deg"; + "col.inactive_border" = "rgba(${colors.base05}aa)"; + + layout = "dwindle"; + }; + + decoration = { + rounding = 10; + + blur = { + enabled = true; + size = 16; + passes = 2; + new_optimizations = true; + }; + + drop_shadow = true; + shadow_range = 4; + shadow_render_power = 3; + "col.shadow" = "rgba(1a1a1aee)"; + }; + + animations = { + enabled = true; + + bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; + # bezier = "myBezier, 0.33, 0.82, 0.9, -0.08"; + + animation = [ + "windows, 1, 7, myBezier" + "windowsOut, 1, 7, default, popin 80%" + "border, 1, 10, default" + "borderangle, 1, 8, default" + "fade, 1, 7, default" + "workspaces, 1, 6, default" + ]; + }; + + dwindle = { + pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + smart_split = true; + }; + + master = { + new_status = "master"; + }; + + gestures = { + workspace_swipe = true; + workspace_swipe_fingers = 3; + workspace_swipe_invert = true; + workspace_swipe_distance = 200; + workspace_swipe_forever = true; + }; + + misc = { + animate_manual_resizes = true; + animate_mouse_windowdragging = true; + enable_swallow = true; + render_ahead_of_time = false; + disable_hyprland_logo = false; + }; + + windowrule = [ + "float, ^(imv)$" + "float, ^(feh)$" + "float, ^(mpv)$" + "float, ^(nmtui)$" + "float, title:^(Список друзей)" + ]; + + exec-once = [ + "systemctl --user start plasma-polkit-agent" + "swww init" + "python3 ${lib.getExe wallpaper_changer}" + "waybar" + "wl-paste --type text --watch cliphist store" + "wl-paste --type image --watch cliphist store" + ]; + + bind = [ + "$mainMod, V, exec, cliphist list | wofi --dmenu | cliphist decode | wl-copy" + + "$mainMod, Return, exec, alacritty" + "$mainMod, Q, killactive," + "$mainMod, M, exit," + "$mainMod, E, exec, alacritty -e sh -c yazi" + "$mainMod, F, togglefloating," + "$mainMod, D, exec, wofi --show drun" + "$mainMod, P, pseudo, # dwindle" + "$mainMod, J, togglesplit, # dwindle" + + # Move focus with mainMod + arrow keys + "$mainMod, left, movefocus, l" + "$mainMod, right, movefocus, r" + "$mainMod, up, movefocus, u" + "$mainMod, down, movefocus, d" + + # Moving windows + "$mainMod SHIFT, left, swapwindow, l" + "$mainMod SHIFT, right, swapwindow, r" + "$mainMod SHIFT, up, swapwindow, u" + "$mainMod SHIFT, down, swapwindow, d" + + # Window resizing X Y + "$mainMod CTRL, left, resizeactive, -60 0" + "$mainMod CTRL, right, resizeactive, 60 0" + "$mainMod CTRL, up, resizeactive, 0 -60" + "$mainMod CTRL, down, resizeactive, 0 60" + + # Switch workspaces with mainMod + [0-9] + "$mainMod, 1, workspace, 1" + "$mainMod, 2, workspace, 2" + "$mainMod, 3, workspace, 3" + "$mainMod, 4, workspace, 4" + "$mainMod, 5, workspace, 5" + "$mainMod, 6, workspace, 6" + "$mainMod, 7, workspace, 7" + "$mainMod, 8, workspace, 8" + "$mainMod, 9, workspace, 9" + "$mainMod, 0, workspace, 10" + + # Move active window to a workspace with mainMod + SHIFT + [0-9] + "$mainMod SHIFT, 1, movetoworkspacesilent, 1" + "$mainMod SHIFT, 2, movetoworkspacesilent, 2" + "$mainMod SHIFT, 3, movetoworkspacesilent, 3" + "$mainMod SHIFT, 4, movetoworkspacesilent, 4" + "$mainMod SHIFT, 5, movetoworkspacesilent, 5" + "$mainMod SHIFT, 6, movetoworkspacesilent, 6" + "$mainMod SHIFT, 7, movetoworkspacesilent, 7" + "$mainMod SHIFT, 8, movetoworkspacesilent, 8" + "$mainMod SHIFT, 9, movetoworkspacesilent, 9" + "$mainMod SHIFT, 0, movetoworkspacesilent, 10" + + "$mainMod SHIFT, F, fullscreen" + # Scroll through existing workspaces with mainMod + scroll + "$mainMod, mouse_down, workspace, e+1" + "$mainMod, mouse_up, workspace, e-1" + + # Keyboard backlight + "$mainMod, F3, exec, brightnessctl -d *::kbd_backlight set +33%" + "$mainMod, F2, exec, brightnessctl -d *::kbd_backlight set 33%-" + + # Volume and Media Control + ", XF86AudioRaiseVolume, exec, pamixer -i 5 " + ", XF86AudioLowerVolume, exec, pamixer -d 5 " + ", XF86AudioMute, exec, pamixer -t" + ", XF86AudioMicMute, exec, pamixer --default-source -m" + + # Brightness control + ", XF86MonBrightnessDown, exec, brightnessctl set 5%- " + ", XF86MonBrightnessUp, exec, brightnessctl set +5% " + + # Configuration files + ''$mainMod ALT, N, exec, alacritty -e sh -c "rb"'' + ''$mainMod ALT, C, exec, alacritty -e sh -c "conf"'' + ''$mainMod ALT, H, exec, alacritty -e sh -c "$EDITOR ~/nix/home-manager/modules/wms/hyprland.nix"'' + ''$mainMod ALT, W, exec, alacritty -e sh -c "$EDITOR ~/nix/home-manager/modules/wms/waybar.nix"'' + '', Print, exec, grim -g "$(slurp)" - | swappy -f -'' + + # Waybar + "$mainMod, B, exec, pkill -SIGUSR1 waybar" + #"$mainMod, W, exec, pkill -SIGUSR2 waybar" + + "$mainMod, W, exec, python3 ${lib.getExe wallpaper_changer}" + + # Disable all effects + "$mainMod Shift, G, exec, ~/.config/hypr/gamemode.sh " + # Skreens + ''$mainMod CTRL, P, exec, alacritty -e sh -c "screenshot"'' + + ]; + + # Move/resize windows with mainMod + LMB/RMB and dragging + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + ]; + }; + }; +} diff --git a/home-manager/data/mako.nix b/home-manager/data/mako.nix new file mode 100644 index 0000000..b010503 --- /dev/null +++ b/home-manager/data/mako.nix @@ -0,0 +1,12 @@ +{ + xdg.configFile."mako/config".text = '' + background-color=#303446 + text-color=#c6d0f5 + border-color=#8caaee + progress-color=over #414559 + default-timeout=5000 + + [urgency=high] + border-color=#ef9f76 + ''; +} diff --git a/home-manager/data/pkgs.nix b/home-manager/data/pkgs.nix new file mode 100644 index 0000000..3bf2e97 --- /dev/null +++ b/home-manager/data/pkgs.nix @@ -0,0 +1,10 @@ +{config, pkgs, ...}: { + imports = [ + ./hyprland.nix + ./waybar.nix + ./style.nix + ./git.nix + ./mako.nix + ./yazi.nix + ]; +} diff --git a/home-manager/data/style.nix b/home-manager/data/style.nix new file mode 100644 index 0000000..c885908 --- /dev/null +++ b/home-manager/data/style.nix @@ -0,0 +1,33 @@ +{ pkgs, config, lib, ... }: { + stylix = { + enable = true; + targets = { + hyprland.enable = false; + waybar.enable = false; + }; + + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml"; + polarity = "dark"; + + image = /home/kirill/wallpapers/tanjiro-kamado-3840x2160-18414.jpeg; + + fonts = { + monospace = { + name = "JetBrains Mono"; + package = pkgs.jetbrains-mono; + }; + + sizes = { + applications = 13; + desktop = 12; + }; + }; + + opacity = { + popups = .8; + terminal = .5; + }; + }; + + xdg.configFile."helix/config.toml".text = ''theme = "catppuccin_mocha"''; +} diff --git a/home-manager/data/waybar.nix b/home-manager/data/waybar.nix new file mode 100644 index 0000000..67c4187 --- /dev/null +++ b/home-manager/data/waybar.nix @@ -0,0 +1,413 @@ +{ pkgs, config, ...}: { +home.packages = [ pkgs.pulsemixer ]; + wayland.windowManager.hyprland.settings.windowrule = [ + "float, ^(pulsemixer)" + "float, ^(nmtui)" + ]; + + programs.waybar = + let + colors = config.lib.stylix.colors; + in { + enable = true; + + settings = { + mainBar = { + layer = "top"; + position = "top"; + margin = "9 13 -10 18"; + + modules-left = ["hyprland/workspaces" "hyprland/language" "keyboard-state" "hyprland/submap"]; + modules-center = ["mpris" "wlr/taskbar"]; + modules-right = ["group/system" "battery" "pulseaudio" "clock" "tray"]; + + "hyprland/workspaces" = { + disable-scroll = true; + }; + + "wlr/taskbar" = { + on-click = "activate"; + on-click-middle = "close"; + on-click-right = "minimize"; + }; + + "group/system" = { + orientation = "inherit"; + drawer = { + transition-duration = 500; + transition-left-to-right = false; + }; + modules = [ + "network" + "custom/mem" + "cpu" + "temperature" + "backlight" + ]; + }; + + + "hyprland/language" = { + format-en = "US"; + format-ru = "RU"; + min-length = 5; + tooltip = false; + }; + + "keyboard-state" = { + capslock = true; + format = "{icon}"; + format-icons = { + locked = "CUPS"; + unlocked = ""; + }; + }; + + "clock" = { + tooltip = false; + format = "{:%a, %d %b %R}"; + }; + + "custom/weather" = { + format = "{}"; + tooltip = true; + interval = 1800; + exec = "python3 $HOME/.config/waybar/scripts/wttr.py"; + return-type = "json"; + }; + + "pulseaudio" = { + # scroll-step = 1; # %, can be a float + reverse-scrolling = 1; + format = "{volume}% {icon} {format_source}"; + format-bluetooth = "{volume}% {icon} {format_source}"; + format-bluetooth-muted = " {icon} {format_source}"; + format-muted = " {format_source}"; + format-source = "{volume}% "; + format-source-muted = ""; + format-icons = { + headphone = ""; + hands-free = ""; + headset = ""; + phone = ""; + portable = ""; + car = ""; + default = ["" "" ""]; + }; + on-click = "alacritty --class pulsemixer -e pulsemixer"; + min-length = 13; + }; + + "custom/mem" = { + format = "{} "; + interval = 3; + exec = "free -h | awk '/Mem:/{printf $3}'"; + tooltip = false; + }; + + "cpu" = { + interval = 2; + format = "{usage}% "; + min-length = 6; + }; + + "temperature" = { + # thermal-zone = 2; + # hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input"; + critical-threshold = 80; + # format-critical = "{temperatureC}°C {icon}"; + format = "{temperatureC}°C {icon}"; + format-icons = ["" "" "" "" ""]; + tooltip = false; + }; + + "network" = { + format = "{ifname}"; + format-wifi = "{essid} ({signalStrength}%) "; + format-ethernet = "{ifname} "; + format-disconnected = ""; + tooltip-format = "{ifname}"; + tooltip-format-wifi = "{essid} ({signalStrength}%) "; + tooltip-format-ethernet = "{ifname} "; + tooltip-format-disconnected = "Disconnected"; + max-length = 50; + on-click = "alacritty --class nmtui -e sh -c nmtui"; + }; + + "backlight" = { + device = "intel_backlight"; + format = "{percent}% {icon}"; + format-icons = [""]; + min-length = 7; + }; + + battery = { + states = { + warning = 30; + critical = 15; + }; + format = "{capacity}%"; + format-charging = "{capacity}% {time}"; + format-plugged = "{capacity}%"; + format-alt = "{time}"; + format-time = "{H}:{m}"; + }; + + mpris = { + format = "{title}"; + format-len = "20"; + }; + + tray = { + icon-size = 16; + spacing = 0; + }; + + }; + }; + + style = /*css*/ + '' +* { + border: none; + border-radius: 0; + /* `otf-font-awesome` is required to be installed for icons */ + font-family: JetBrains Mono; + font-weight: bold; + min-height: 20px; +} +window#waybar { + background: transparent; +} +window#waybar.hidden { + opacity: 0.2; +} +#workspaces { + margin-right: 8px; + border-radius: 10px; + transition: none; + background: #${colors.base00}; +} +#workspaces button { + transition: none; + color: #${colors.base04}; + background: transparent; + padding: 5px; + font-size: 18px; +} +#workspaces button.persistent { + font-size: 12px; +} +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +#workspaces button:hover { + transition: none; + box-shadow: inherit; + text-shadow: inherit; + border-radius: inherit; + color: #${colors.base05}; +} +#workspaces button.active { + background: #${colors.base02}; + color: #${colors.base05}; + border-radius: inherit; +} +#taskbar { + border-radius: 10px; + color: #${colors.base05}; + background: #${colors.base00}; +} +#taskbar button { + transition: none; + background: transparent; + border-radius: 10px; + padding: 8px; + margin: 0px; +} +#taskbar button:hover { + transition: none; + box-shadow: inherit; + text-shadow: inherit; + border-radius: inherit; + background: #${colors.base02}; +} +#taskbar button.active { + background: #${colors.base0B}; +} +#language { + padding: 8px 0px 8px 8px; + border-radius: 10px 0px 0px 10px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#keyboard-state { + margin-right: 8px; + padding: 8px 8px 8px 0px; + border-radius: 0px 10px 10px 0px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#custom-pacman { + padding-left: 16px; + padding-right: 8px; + border-radius: 10px 0px 0px 10px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#custom-mail { + margin-right: 8px; + padding-right: 16px; + border-radius: 0px 10px 10px 0px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#submap { + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#clock { + margin-right: 8px; + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#network { + margin-right: 8px; + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#network.disconnected { + color: #${colors.base00}; + background-color: #${colors.base08}; +} +#custom-weather { + padding-right: 16px; + border-radius: 0px 10px 10px 0px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#pulseaudio { + margin-right: 8px; + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#pulseaudio.muted { + background-color: #${colors.base08}; + color: #${colors.base01}; +} +#custom-mem { + margin-right: 8px; + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#cpu { + margin-right: 8px; + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#temperature { + margin-right: 8px; + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#temperature.critical { + background-color: #${colors.base08}; +} +#backlight { + margin-right: 8px; + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#battery { + margin-right: 8px; + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#battery.charging { + color: #${colors.base00}; + background-color: #${colors.base0B}; +} +#battery.warning:not(.charging) { + background-color: #${colors.base09}; + color: black; +} +#battery.critical:not(.charging) { + background-color: #${colors.base08}; + color: #${colors.base05}; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} +#tray { + padding-left: 16px; + padding-right: 16px; + border-radius: 10px; + transition: none; + color: #${colors.base05}; + background: #${colors.base00}; +} +#mpris{ + background: #${colors.base00}; + border-radius: 10px; + color: #${colors.base05}; + padding: 0px 8px; + margin: 0px 8px; +} +#mpris.playing { + background-color: #${colors.base0B}; + color: #${colors.base01}; +} +#mpris.paused { + background-color: #${colors.base0A}; + color: #${colors.base01}; +} +@keyframes blink { + to { + background-color: #${colors.base05}; + color: #${colors.base00}; + } +} + ''; + }; +} diff --git a/home-manager/data/yazi.nix b/home-manager/data/yazi.nix new file mode 100644 index 0000000..4fa2e2d --- /dev/null +++ b/home-manager/data/yazi.nix @@ -0,0 +1,67 @@ +{ pkgs, lib, ... }: +let yazi-plugins = pkgs.fetchFromGitHub { + owner = "yazi-rs"; + repo = "plugins"; + rev = "c5785059611624e20a37ba573620f30acc28a26a"; + hash = "sha256-wlSBtabIsEUJhuHmXwgpSnwZp9WaVQFBg6s1XXjubrE="; + }; +in { + programs.yazi = { + enable = true; + enableZshIntegration = true; + shellWrapperName = "y"; + + settings = { + manager = { + show_hidden = true; + }; + preview = { + image_filter = "lanczos3"; + image_quality = 90; + tab_size = 1; + max_width = 600; + max_height = 900; + cache_dir = ""; + ueberzug_scale = 1; + ueberzug_offset = [ + 0 + 0 + 0 + 0 + ]; + }; + }; + + plugins = { + chmod = "${yazi-plugins}/chmod.yazi"; + full-border = "${yazi-plugins}/full-border.yazi"; + max-preview = "${yazi-plugins}/max-preview.yazi"; + starship = pkgs.fetchFromGitHub { + owner = "Rolv-Apneseth"; + repo = "starship.yazi"; + rev = "77a65f5a367f833ad5e6687261494044006de9c3"; + sha256 = "sha256-sAB0958lLNqqwkpucRsUqLHFV/PJYoJL2lHFtfHDZF8="; + }; + }; + + initLua = '' + require("full-border"):setup() + require("starship"):setup() + ''; + + keymap = { + manager.prepend_keymap = [ + { + on = "T"; + run = "plugin --sync max-preview"; + desc = "Maximize or restore the preview pane"; + } + { + on = ["c" "m"]; + run = "plugin chmod"; + desc = "Chmod on selected files"; + } + ]; + }; + }; +} diff --git a/home-manager/home.nix b/home-manager/home.nix new file mode 100644 index 0000000..078db95 --- /dev/null +++ b/home-manager/home.nix @@ -0,0 +1,30 @@ +{config, pkgs, ...}: { + imports = [ + ./zsh.nix + ./data/pkgs.nix + ]; + + home = { + username = "kirill"; + homeDirectory = "/home/kirill"; + stateVersion = "23.11"; + }; + programs.bash = { + enable = true; + shellAliases = { + rebuild = "sudo nixos-rebuild switch --flake ~/.config/f#usconfig"; + deleteGenerations = "sudo nix-collect-garbage -d"; + openHome = "vim .config/f/home-manager/home.nix"; + rebuildHome = "home-manager switch --flake ~/.config/f"; + openConfiguration = "sudo nano ~/.config/f/nixos/hosts/usconfig/configuration.nix"; + openHyprland = "vim .config/f/home-manager/data/hyprland.nix"; + openZSH = "vim .config/f/home-manager/zsh.nix"; + openWayBar = "vim .config/home-manager/f/data/waybar.nix"; + rebuildFlake = "sudo nixos-rebuild switch --flake /home/kirill/.config/f --impure"; + openFlake = "vim /home/kirill/.config/f/flake.nix"; + swichWalls = "python3 /nix/store/6czqsnf0gbvvm472lipndyg34qhnfpis-wallpaper_changer/bin/wallpaper_changer"; + screenshot_f="grimblast save screen ~/screenshot_$(date +\%Y-\%m-\%d_\%H-\%M-\%S).png"; + screenshot="grimblast save area ~/screenshot_$(date +\%Y-\%m-\%d_\%H-\%M-\%S).png"; + }; + }; +} diff --git a/home-manager/zsh.nix b/home-manager/zsh.nix new file mode 100644 index 0000000..78cd598 --- /dev/null +++ b/home-manager/zsh.nix @@ -0,0 +1,60 @@ +{ config, ... }: { + programs.zoxide.enable = true; + programs.zsh = { + enable = true; + enableCompletion = true; + # enableAutosuggestions = true; + syntaxHighlighting.enable = true; + + shellAliases = + let + flakeDir = "~/nix"; + in { + rb = "sudo nixos-rebuild switch --flake ${flakeDir}"; + upd = "nix flake update ${flakeDir}"; + upg = "sudo nixos-rebuild switch --upgrade --flake ${flakeDir}"; + + hms = "home-manager switch --flake ${flakeDir}"; + + conf = "$EDITOR ${flakeDir}/nixos/hosts/$(hostname)/configuration.nix"; + pkgs = "$EDITOR ${flakeDir}/nixos/packages.nix"; + + ll = "ls -l"; + se = "sudoedit"; + ff = "fastfetch"; + cat = "bat"; + cd = "z"; + + rebuild = "sudo nixos-rebuild switch --flake ~/.config/f#usconfig"; + deleteGenerations = "sudo nix-collect-garbage -d"; + openHome = "vim .config/f/home-manager/home.nix"; + rebuildHome = "home-manager switch --flake ~/.config/f"; + rebuildHomeImpure = "home-manager switch --flake ~/.config/f --impure"; + openConfiguration = "sudo nano ~/.config/f/nixos/hosts/usconfig/configuration.nix"; + openHyprland = "vim .config/f/home-manager/data/hyprland.nix"; + openZSH = "vim .config/f/home-manager/zsh.nix"; + openWayBar = "vim .config/f/home-manager/data/waybar.nix"; + rebuildFlake = "sudo nixos-rebuild switch --flake /home/kirill/.config/f --impure"; + openFlake = "vim /home/kirill/.config/f/flake.nix"; + swichWalls = "python3 /nix/store/6czqsnf0gbvvm472lipndyg34qhnfpis-wallpaper_changer/bin/wallpaper_changer"; + screenshot_f="grimblast save screen ~/screenshot_$(date +\%Y-\%m-\%d_\%H-\%M-\%S).png"; + screenshot="grimblast save area ~/screenshot_$(date +\%Y-\%m-\%d_\%H-\%M-\%S).png"; + }; + + initExtra = '' + if [ -z "''${WAYLAND_DISPLAY}" ] && [ "''${XDG_VTNR}" -eq 1 ]; then + dbus-run-session Hyprland + fi + eval "$(zoxide init zsh)" + ''; + + history.size = 10000; + history.path = "${config.xdg.dataHome}/zsh/history"; + + oh-my-zsh = { + enable = true; + plugins = [ "git" "sudo" ]; + theme = "agnoster"; # blinks is also really nice + }; + }; +} diff --git a/nixos/hosts/usconfig/configuration.nix b/nixos/hosts/usconfig/configuration.nix new file mode 100644 index 0000000..98be4a1 --- /dev/null +++ b/nixos/hosts/usconfig/configuration.nix @@ -0,0 +1,131 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{ config, pkgs,libs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./pockets.nix + ./hardware-configuration.nix + ./models/bluetooth.nix + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "usconfig"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "Europe/Moscow"; + + # Select internationalisation properties. + i18n.defaultLocale = "ru_RU.UTF-8"; + + programs.hyprland.enable = true; + programs.zsh.enable = true; + #services.xserver = { enable = true; }; + + + # Enable the X11 windowing system. + + #services.xserver.displayManager.lightdm.enable = true; + #services.xserver.desktopManager.deepin.enable = true; + + # Enable the Deepin Desktop Environment. + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "ru"; + variant = ""; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users = { + defaultUserShell = pkgs.zsh; + + users.kirill = { + isNormalUser = true; + description = "Kirill"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ + # thunderbird + ]; + }; + }; + + # Enable automatic login for the user. + services.xserver.displayManager.autoLogin.enable = true; + services.xserver.displayManager.autoLogin.user = "kirill"; + + hardware.bluetooth.enable = true; # enables support for Bluetooth + hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot + + # Install firefox. + programs.firefox.enable = true; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + + # List packages installed in system profile. To search, run: + # $ nix search wget + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.05"; # Did you read the comment? +} diff --git a/nixos/hosts/usconfig/hardware-configuration.nix b/nixos/hosts/usconfig/hardware-configuration.nix new file mode 100644 index 0000000..0ffd68d --- /dev/null +++ b/nixos/hosts/usconfig/hardware-configuration.nix @@ -0,0 +1,38 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/4c9e1a11-d5c3-4308-8517-d300ce705bb0"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/C2A0-25B9"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/hosts/usconfig/models/bluetooth.nix b/nixos/hosts/usconfig/models/bluetooth.nix new file mode 100644 index 0000000..2aed505 --- /dev/null +++ b/nixos/hosts/usconfig/models/bluetooth.nix @@ -0,0 +1,14 @@ +{ + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + settings = { + General = { + Enable = "Source,Sink,Media,Socket"; + Experimental = true; + }; + }; + }; + + services.blueman.enable = true; +} diff --git a/nixos/hosts/usconfig/pockets.nix b/nixos/hosts/usconfig/pockets.nix new file mode 100644 index 0000000..98cc7df --- /dev/null +++ b/nixos/hosts/usconfig/pockets.nix @@ -0,0 +1,97 @@ +{ pkgs, ... }: { + nixpkgs.config = { + allowUnfree = true; + permittedInsecurePackages = ["python-2.7.18.8" "electron-25.9.0" "freeimage-unstable-2021-11-01" "obsidian-1.5.12"]; + }; + + environment.systemPackages = with pkgs; [ + vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + wget + home-manager + pkgs.opera + pkgs.git + pkgs.telegram-desktop + pkgs.vpnc + pkgs.alacritty + pkgs.wofi + pkgs.google-chrome + pkgs.yazi + nerdfonts + pkgs.waybar + grimblast + tree + slurp + brightnessctl + neofetch + mako + file + btop + nix-index + unzip + scrot + ffmpeg + light + zram-generator + zip + ntfs3g + yt-dlp + brightnessctl + openssl + httpie + ncdu + hexyl + jq + tldr + bat + xdg-utils + helix + playerctl + duf + v2raya + + swww + gnumake + + python + (python3.withPackages (ps: with ps; [ requests bpython ])) + python311Packages.pip + + #IDES + jetbrains.idea-community + + #languages + vscode + nodejs + gcc + cmake + jdk + maven + + #Bluetoth + bluez + bluez-tools + + #Sounds + pipewire + pulseaudio + pamixer + + #obs-studio + obs-studio + + #GameManager + ]; + +fonts.packages = with pkgs; [ + jetbrains-mono + noto-fonts + noto-fonts-emoji + twemoji-color-font + font-awesome + powerline-fonts + powerline-symbols + ubuntu_font_family + unifont + (nerdfonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; }) + ]; +}