diff --git a/home-manager/home.nix b/home-manager/home.nix index 18fd1d2..22fab0b 100755 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -4,7 +4,7 @@ { imports = [ ./modules/zsh/zsh.nix - /.modules/openai.nix + ./modules/openai.nix ./modules/kitty.nix ./modules/git.nix ./modules/programs.nix diff --git a/home-manager/modules/hypr/hypr.nix b/home-manager/modules/hypr/hypr.nix index 8ebf0e4..85272f8 100644 --- a/home-manager/modules/hypr/hypr.nix +++ b/home-manager/modules/hypr/hypr.nix @@ -74,7 +74,7 @@ exec-once = [ "caelestia shell &" - "caelestia shell lock lock; until [ $? -eq 0 ]; do sleep 0.1; caelestia shell lock lock; done" + #"caelestia shell lock lock; until [ $? -eq 0 ]; do sleep 0.1; caelestia shell lock lock; done" "AmneziaVPN & disown" # "hyprlock --immediate-render --no-fade-in &" "wal -R &" diff --git a/home-manager/modules/hypr/scripts/wallpaper/wallpaper.py b/home-manager/modules/hypr/scripts/wallpaper/wallpaper.py index ea19eec..50c89ce 100755 --- a/home-manager/modules/hypr/scripts/wallpaper/wallpaper.py +++ b/home-manager/modules/hypr/scripts/wallpaper/wallpaper.py @@ -42,8 +42,8 @@ def check_setup() -> None: for prog in ["swww", "hyprpanel", "wal"]: try: subprocess.run([prog, "--version"], capture_output=True) - except FileNotFoundError: - print(f"Note: Optional program '{prog}' not found in PATH.") + except Exception as e: + print(f"{e}") wallpaper_dir = pathlib.Path(WALLPAPERS_DIR) if not wallpaper_dir.is_dir(): @@ -324,11 +324,12 @@ def next_wallpaper( except FileNotFoundError: pass try: - subprocess.run(["hyprpanel", "-q"], check=False) + # subprocess.run(["hyprpanel", "-q"], check=False) # restart in background - subprocess.Popen( - ["hyprpanel"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL - ) + # subprocess.Popen( + # ["hyprpanel"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL + # ) + pass except FileNotFoundError: pass try: diff --git a/home-manager/modules/kitty.nix b/home-manager/modules/kitty.nix index 5d32959..02e421d 100644 --- a/home-manager/modules/kitty.nix +++ b/home-manager/modules/kitty.nix @@ -15,9 +15,17 @@ scrollback_lines = 5000; mouse_hide_wait = 3.0; - background_opacity = "0.6"; + background_opacity = "0.3"; + #background_opacity = 0; dynamic_background_opacity = "yes"; + #backgroud_image = "/home/krosh/Pictures/kitty.jpg"; + #backgroud_image = "kitty.jpg"; + #backgroud_image = "/home/krosh/Pictures/wallpaper.png"; background_blur = 5; + #background_image_layout = "cscaled"; + #background_image_linear = "yes"; + background_tint = 0.8; + #background_tint_gaps = 0.5; confirm_os_window_close = 0; @@ -26,7 +34,7 @@ keybindings = { "ctrl+shift+enter" = "new_window_with_cwd"; - "ctrl+c" = "copy_or_interrupt"; + "ctrl+c" = "copy_and_clear_or_interrupt"; "ctrl+v" = "paste_from_clipboard"; }; diff --git a/home-manager/modules/openai.nix b/home-manager/modules/openai.nix index 39c96b7..6df6bdd 100644 --- a/home-manager/modules/openai.nix +++ b/home-manager/modules/openai.nix @@ -6,5 +6,12 @@ f() { llm "$@" | tee >(cat) | glow --style=dark --width=100; unset -f f; }; f''; }; - home.packages = with pkgs; [ python312Packages.llm glow ]; + home.packages = with pkgs; [ + # python312Packages.llm + glow + + (llm.withPlugins { llm-openai-plugin = true; }) + + ]; + } diff --git a/home-manager/modules/programs.nix b/home-manager/modules/programs.nix index ffb63cc..ba024d1 100644 --- a/home-manager/modules/programs.nix +++ b/home-manager/modules/programs.nix @@ -27,6 +27,9 @@ vlc # yubikey-manager-qt # paprefs + + zed-editor + ollama ]; services.syncthing = { enable = true; }; @@ -40,13 +43,13 @@ imports = [ inputs.zen-browser.homeModules.default ]; programs.zen-browser = { enable = true; }; - xdg.mimeApps = let - value = let - system = pkgs.stdenv.hostPlatform.system; - zen-browser = inputs.zen-browser.packages.${system}.default; - in zen-browser.meta.desktopFileName; + xdg.mimeApps = + let + value = "zen-beta.desktop"; - associations = builtins.listToAttrs (map (name: { inherit name value; }) [ + associations = builtins.listToAttrs (map (name: { + inherit name value; + }) [ "application/x-extension-shtml" "application/x-extension-xhtml" "application/x-extension-html" diff --git a/home-manager/modules/ssh.nix b/home-manager/modules/ssh.nix index c5e7bbc..b068a44 100644 --- a/home-manager/modules/ssh.nix +++ b/home-manager/modules/ssh.nix @@ -7,6 +7,7 @@ matchBlocks = { "kr0sh.ru" = { host = "kr0sh.ru"; + port = 2006; user = "krosh"; identityFile = [ "~/.ssh/id" ]; }; diff --git a/home-manager/modules/zsh/zsh.nix b/home-manager/modules/zsh/zsh.nix index 80e9181..36a8e00 100644 --- a/home-manager/modules/zsh/zsh.nix +++ b/home-manager/modules/zsh/zsh.nix @@ -80,6 +80,8 @@ ]; }; + sessionVariables = { EDITOR = "nvim"; }; + shellAliases = { ll = "ls -lh"; la = "ls -la"; @@ -177,6 +179,7 @@ printf "--- Hi, %s! ---\n" "$USER" printf "Battery: %s%%\n" "$(cat /sys/class/power_supply/BAT0/capacity 2>/dev/null || echo "N/A")" + printf "Time: %s\n" "$(date +"%H:%M:%S")" printf "Time you live: %s years :)\n" "$(python3 -c "from datetime import datetime; age_years = (datetime.now() - datetime(2006, 6, 16)).total_seconds() / (365.25 * 24 * 3600); print(f'{age_years:.10f}')")" diff --git a/hosts/loki-nixos/configuration.nix b/hosts/loki-nixos/configuration.nix index ff030a3..ed4e877 100644 --- a/hosts/loki-nixos/configuration.nix +++ b/hosts/loki-nixos/configuration.nix @@ -8,16 +8,32 @@ swapDevices = [{ device = "/swapfile"; size = 16 * 1024; - randomEncryption.enable = true; + randomEncryption.enable = false; }]; - boot.resumeDevice = "/dev/nvme0n1p2"; + boot.kernel.sysctl."vm.swappiness" = 120; + # systemd.oomd.enable = true; + systemd.oomd = { + enable = true; + enableSystemSlice = true; + enableUserSlices = true; + }; + zramSwap.enable = true; # more ram in + zramSwap.memoryPercent = 150; + # boot.resumeDevice = "/dev/nvme0n1p2"; # -- tmp -- services.xserver.enable = false; services.displayManager.gdm.enable = false; - services.getty.autologinUser = "krosh"; - services.getty.autologinOnce = true; + #services.getty.autologinUser = "krosh"; + #services.getty.autologinOnce = true; + services.getty = { + autologinUser = "krosh"; + autologinOnce = true; + greetingLine = ""; + helpLine = ""; + extraArgs = [ "--noissue" "--nohostname" "--nonewline" "--nohints" ]; + }; programs.zsh.enable = true; programs.zsh.loginShellInit = '' diff --git a/hosts/loki-nixos/hardware-configuration.nix b/hosts/loki-nixos/hardware-configuration.nix index 5229ffb..fc75d1a 100644 --- a/hosts/loki-nixos/hardware-configuration.nix +++ b/hosts/loki-nixos/hardware-configuration.nix @@ -10,11 +10,24 @@ boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ]; boot.initrd.kernelModules = [ ]; + boot.initrd.systemd.enable = true; + boot.initrd.luks.fido2Support = false; + boot.initrd.luks.devices.cryptnixos.device = "/dev/disk/by-uuid/5a9c3975-0dad-4cb6-9998-3d443d81eae5"; + boot.initrd.luks.devices.cryptnixos.crypttabExtraOpts = [ "fido2-device=auto" ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; + boot.kernelParams = [ + "quiet" + "udev.log_level=3" + "systemd.show_status=0" + ]; + boot.consoleLogLevel = 0; + boot.initrd.verbose = false; + #boot.initrd.stage1Greeting = ""; + #boot.stage2Greeting = ""; fileSystems."/" = - { device = "/dev/disk/by-uuid/57528dff-a344-4f53-83e9-2959547fc44b"; + { device = "/dev/mapper/cryptnixos"; fsType = "btrfs"; options = [ "subvol=@" ]; }; diff --git a/nixos/modules/boot.nix b/nixos/modules/boot.nix index a0d7117..fe9638f 100644 --- a/nixos/modules/boot.nix +++ b/nixos/modules/boot.nix @@ -13,7 +13,7 @@ ]; }; - consoleLogLevel = 3; + consoleLogLevel = lib.mkDefault 3; initrd.verbose = false; kernelPackages = pkgs.linuxPackages_latest; kernelParams = [ @@ -25,9 +25,19 @@ "kvm.enable_virt_at_load=0" ]; loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - timeout = 0; + grub = { + enable = true; + useOSProber = true; + device = "nodev"; + timeoutStyle = "menu"; + efiSupport = true; + }; + # systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; + timeout = 5; }; }; } diff --git a/nixos/modules/memory.nix b/nixos/modules/memory.nix index a0c07ed..512f93b 100644 --- a/nixos/modules/memory.nix +++ b/nixos/modules/memory.nix @@ -1,7 +1,6 @@ { config, pkgs, lib, ... }: { - # zramSwap.enable = true; services.btrfs.autoScrub.enable = true; # i can use not only btrfs services.btrfs.autoScrub.interval = "weekly"; } diff --git a/nixos/modules/networking.nix b/nixos/modules/networking.nix index c2e86c7..00e812f 100644 --- a/nixos/modules/networking.nix +++ b/nixos/modules/networking.nix @@ -6,5 +6,12 @@ networking.networkmanager.enable = true; networking.nameservers = [ "8.8.8.8" "1.1.1.1" ]; networking.networkmanager.insertNameservers = [ "1.1.1.1" "8.8.8.8" ]; - networking.firewall.enable = lib.mkDefault false; # ! 🤡 + networking.firewall.enable = lib.mkDefault true; + networking.firewall.allowedTCPPorts = [ + 22000 # syncthing + ]; + networking.firewall.allowedUDPPorts = [ + 22000 # syncthing + ]; + networking.enableIPv6 = true; } diff --git a/nixos/modules/unsorted.nix b/nixos/modules/unsorted.nix index 09ac1ff..7fc6edf 100644 --- a/nixos/modules/unsorted.nix +++ b/nixos/modules/unsorted.nix @@ -3,6 +3,19 @@ # ! KROSH mention { + services.tailscale = { + enable = true; + # Enable tailscale at startup + + # If you would like to use a preauthorized key + #authKeyFile = "/run/secrets/tailscale_key"; + + }; + networking.firewall = { + trustedInterfaces = [ "tailscale0" ]; + allowedUDPPorts = [ config.services.tailscale.port ]; + }; + system.stateVersion = "25.11"; nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.gc = { @@ -36,6 +49,16 @@ # adwaita-icon-theme hicolor-icon-theme # lomiri.suru-icon-theme + + stdenv.cc.cc.lib + + python312Packages.ipykernel + python312Packages.jupyterlab + python312Packages.numpy + python312Packages.pycodestyle + + fuse + fuse3 ]; programs.nix-ld.enable = true;