From 4714b31176476be0864ace3dcac676122f87f61c Mon Sep 17 00:00:00 2001 From: Varris Date: Wed, 5 Apr 2023 11:36:45 +0200 Subject: [PATCH] update. Added zellij config --- flake.nix | 5 + system/configuration.nix | 250 ++++++++++++++---------------- user/configs/mpd/default.nix | 1 + user/configs/neovim/default.nix | 29 ++-- user/configs/wayland/hyprland.nix | 21 +-- user/configs/wayland/waybar.nix | 2 +- user/configs/zellij/default.nix | 4 + user/home.nix | 180 +++++++++++---------- 8 files changed, 254 insertions(+), 238 deletions(-) create mode 100644 user/configs/zellij/default.nix diff --git a/flake.nix b/flake.nix index 5ec3c8f..72db5f5 100755 --- a/flake.nix +++ b/flake.nix @@ -40,6 +40,11 @@ flake = false; }; + ncmpcpp-git = { + url = "github:ncmpcpp/ncmpcpp"; + flake = false; + }; + grub2-themes = { url = "github:vinceliuice/grub2-themes"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/system/configuration.nix b/system/configuration.nix index 46e2a97..6a4c7fd 100755 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -4,9 +4,9 @@ { config, pkgs, lib, inputs, ... }: { imports = [ - # Include the results of the hardware scan. +# Include the results of the hardware scan. ./hardware-configuration.nix - inputs.hyprland.nixosModules.default + inputs.hyprland.nixosModules.default ]; nixpkgs.config.allowUnfree = true; @@ -16,10 +16,16 @@ boot = { kernelParams = [ - "amdgpu.ppfeaturemask=0xffffffff" + "amdgpu.ppfeaturemask=0xffffffff" "drm.edid_firmware=DP-1:edid/edid-EX2780Q.bin" + "net.ifnames=0" ]; + extraModprobeConfig = '' + options iwlmvm power_scheme=1 + options iwlwifi power_save=0 + ''; + loader = { efi = { canTouchEfiVariables = true; @@ -40,7 +46,7 @@ }; }; - # initrd.availableKernelModules=sd [ "amdgpu" ]; +# initrd.availableKernelModules=sd [ "amdgpu" ]; kernelPackages = pkgs.linuxPackages_zen; kernelModules = [ "i2c-dev" "i2c-piix4" ]; }; @@ -49,15 +55,18 @@ networking = { hostName = "terra"; # Define your hostname. - enableIPv6 = false; + enableIPv6 = false; - networkmanager = { + wireless = { enable = true; - wifi = { - powersave = false; + #FORMAT: + #PSK_HOME = password + environmentFile = "/etc/nixos/wifi_secrets.conf"; + + networks."TP-Link_EDB8" = { + psk = "@PSK_HOME@"; }; }; - firewall.checkReversePath = false; firewall.enable = false; extraHosts = '' @@ -66,10 +75,10 @@ }; - # Set your time zone. +# Set your time zone. time.timeZone = "Europe/Vienna"; - # Select internationalisation properties. +# Select internationalisation properties. i18n = { defaultLocale = "en_US.UTF-8"; extraLocaleSettings = { @@ -104,51 +113,23 @@ extraBackends = [ pkgs.sane-airscan ]; }; - # Enable sound. +# Enable sound. sound.enable = true; - security.rtkit.enable = true; - security.audit.enable = false; - security.auditd.enable = false; - - security.pam.loginLimits = [{ - domain = "*"; - type = "soft"; - item = "nofile"; - value = "262144"; - }]; - - - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - - services.blueman.enable = true; - - services.gvfs.enable = true; - - services.flatpak.enable = true; - - services.locate = { - enable = true; - locate = pkgs.plocate; - localuser = null; - prunePaths = lib.mkOptionDefault [ ]; - interval = "hourly"; - }; - - services.fstrim = { - enable = true; - interval = "weekly"; - }; - - services.udisks2.enable = true; - security = { + audit.enable = false; + auditd.enable = false; + polkit.enable = true; + rtkit.enable = true; sudo.enable = false; + + pam.loginLimits = [{ + domain = "*"; + type = "soft"; + item = "nofile"; + value = "262144"; + }]; + doas = { enable = true; extraRules = [{ @@ -157,130 +138,125 @@ persist = true; }]; }; - polkit.enable = true; }; - programs.fish.enable = true; - - programs.ccache = { - enable = true; - packageNames = [ - ]; - }; - - programs.hyprland.enable = true; - - # Define a user account. Don't forget to set a password with ‘passwd’. +# Define a user account. Don't forget to set a password with ‘passwd’. users.users.manuel = { isNormalUser = true; - extraGroups = [ - "audio" - "games" - "geoclue" - "input" - "networkmanager" - "nm-openvpn" - "scanner" - "lp" - "users" - "video" - "wheel" - ]; + extraGroups = [ "audio" "games" "input" "scanner" "lp" "users" "video" "wheel" ]; shell = pkgs.fish; }; - # List packages installed in system profile. To search, run: - # $ nix search wget +# List packages installed in system profile. To search, run: +# $ nix search wget environment = { systemPackages = [ pkgs.git - pkgs.links2 - pkgs.ripgrep - pkgs.file - pkgs.fd - pkgs.htop - pkgs.openrgb - pkgs.unzip - pkgs.unrar - pkgs.p7zip + pkgs.links2 + pkgs.ripgrep + pkgs.file + pkgs.fd + pkgs.htop + pkgs.openrgb + pkgs.unzip + pkgs.unrar + pkgs.p7zip ]; binsh = "${pkgs.dash}/bin/dash"; }; - # List services that you want to enable: - services.udev.packages = [ pkgs.openrgb ]; - - programs.dconf.enable = true; - - programs.kdeconnect.enable = true; - - services.geoclue2 = { - enable = true; - appConfig."gammastep" = { - isAllowed = true; - isSystem = false; - }; +# List services that you want to enable: + programs = { + dconf.enable = true; + fish.enable = true; + hyprland.enable = true; + kdeconnect.enable = true; + ssh.startAgent = true; }; - services.gnome.gnome-keyring.enable = true; + services = { + blueman.enable = true; + flatpak.enable = true; + fwupd.enable = true; + gnome.gnome-keyring.enable = true; + gvfs.enable = true; + openssh.enable = true; + udev.packages = [ pkgs.openrgb ]; + udisks2.enable = true; + + printing = { + enable = true; + drivers = [ pkgs.cnijfilter2 ]; + }; + + avahi = { + enable = true; + nssmdns = true; + }; + + mullvad-vpn = { + enable = true; + package = pkgs.mullvad-vpn; + }; + + + transmission = { + enable = true; + user = "manuel"; + openFirewall = true; + }; + + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + + locate = { + enable = true; + locate = pkgs.plocate; + localuser = null; + prunePaths = lib.mkOptionDefault [ ]; + interval = "hourly"; + }; + + fstrim = { + enable = true; + interval = "weekly"; + }; + }; xdg.portal = { enable = true; xdgOpenUsePortal = true; wlr.enable = false; #conflict with XDPH if enabled - extraPortals = [ + extraPortals = [ pkgs.xdg-desktop-portal-gtk - ]; + ]; }; - programs.ssh = { - startAgent = true; - }; - - services.openssh = { - enable = true; - }; - - services.printing = { - enable = true; - drivers = [ pkgs.cnijfilter2 ]; - }; - - services.avahi = { - enable = true; - nssmdns = true; - }; - - services.transmission = { - enable = true; - user = "manuel"; - openFirewall = true; - }; - - services.fwupd.enable = true; - - #: services.getty.autologinUser = " manuel "; - systemd.extraConfig = '' DefaultTimeoutStopSec=10s - ''; + ''; systemd.user.extraConfig = '' - # needed for xdg-open to find the default browser +# needed for xdg-open to find the default browser DefaultEnvironment="PATH=/etc/profiles/per-user/manuel/bin:/run/current/system/sw/bin" DefaultTimeoutStopSec=10s - ''; + ''; nix = { extraOptions = '' experimental-features = nix-command flakes warn-dirty = false - ''; + ''; gc = { persistent = true; automatic = true; dates = "weekly"; - options = "--delete-older-than 14d"; + options = "--delete-older-than 7d"; }; settings.auto-optimise-store = true; }; diff --git a/user/configs/mpd/default.nix b/user/configs/mpd/default.nix index 97a9a4b..565e16a 100755 --- a/user/configs/mpd/default.nix +++ b/user/configs/mpd/default.nix @@ -50,6 +50,7 @@ programs.ncmpcpp = { enable = true; + settings = { visualizer_data_source = "/tmp/mpd.fifo"; visualizer_output_name = "my_fifo"; diff --git a/user/configs/neovim/default.nix b/user/configs/neovim/default.nix index e48ffdf..ea95c95 100644 --- a/user/configs/neovim/default.nix +++ b/user/configs/neovim/default.nix @@ -11,7 +11,7 @@ in enable = true; globals = { - mapleader = " "; #Space key + mapleader = ","; }; colorschemes.gruvbox = { @@ -25,10 +25,21 @@ in pattern = [ "*" ]; command = "hi! Normal ctermbg=NONE guibg=NONE"; } + { + event = [ "BufWinLeave" ] ; + pattern = [ "*" ]; + command = "silent! mkview"; + } + { + event = [ "BufWinEnter" ] ; + pattern = [ "*" ]; + command = "silent! loadview"; + } ]; options = { number = true; + relativenumber = true; ignorecase = true; smartcase = true; tabstop = 2; @@ -143,18 +154,6 @@ in indent = true; }; - bufferline = { - enable = true; - separatorStyle = "slant"; - numbers = "buffer_id"; - - highlights = { - fill = { - guibg = "#3C3836"; - }; - }; - - }; }; maps = { @@ -162,6 +161,10 @@ in silent = true; action = "NeoTreeFocusToggle"; }; + normal."" = { + silent = true; + action = "nohlsearch"; + }; }; }; diff --git a/user/configs/wayland/hyprland.nix b/user/configs/wayland/hyprland.nix index f498c89..f0b3af3 100644 --- a/user/configs/wayland/hyprland.nix +++ b/user/configs/wayland/hyprland.nix @@ -41,10 +41,13 @@ let ''; xwaylandSetPrimary = pkgs.writeShellScriptBin "xwayland-setprimary.sh" '' - DSP=$(${pkgs.xorg.xrandr}/bin/xrandr | awk '/2560x1440/ {print $1}' | head -n 1) - - ${pkgs.xorg.xrandr}/bin/xrandr --output "$DSP" --primary - echo "Xwayland: $DSP - Primary monitor set" + while true; do + DSP=$(${pkgs.xorg.xrandr}/bin/xrandr | awk '/2560x1440/ {print $1}' | head -n 1) + if [[ ! -z DSP ]]; then + ${pkgs.xorg.xrandr}/bin/xrandr --output "$DSP" --primary + fi + sleep 10 + done ''; killprocess = pkgs.writeShellScriptBin "killprocess.sh" '' @@ -116,9 +119,6 @@ in col.shadow = rgba(${colors.base00}99) } - blurls = waybar - blurls = notifications - animations { enabled = yes @@ -133,8 +133,8 @@ in exec-once = ${pkgs.swaybg}/bin/swaybg -i ${wallpaper} -m fill exec-once = ${pkgs.openrgb}/bin/openrgb --startminimized --profile autorun.orp - exec-once = ${pkgs.networkmanagerapplet}/bin/nm-applet --indicator exec-once = ${pkgs.blueman}/bin/blueman-applet + exec-once = ${pkgs.mullvad-vpn}/bin/mullvad-gui exec = ${wob-voldaemon}/bin/wob-volumeindicator.sh; exec = ${xwaylandSetPrimary}/bin/xwayland-setprimary.sh @@ -198,10 +198,13 @@ in bind = ${modKey} SHIFT, C, exec, hyprctl reload + layerrule = blur, waybar + layerrule = blur, notifications + windowrulev2 = fullscreen, class:^(hl2_linux)$ ''; }; - home.packages = [ pkgs.wl-clipboard pkgs.wl-clipboard-x11 ]; + home.packages = [ pkgs.wl-clipboard pkgs.wl-clipboard-x11 pkgs.hyprpicker pkgs.hyprpaper ]; } diff --git a/user/configs/wayland/waybar.nix b/user/configs/wayland/waybar.nix index c53c0a4..3595ed4 100755 --- a/user/configs/wayland/waybar.nix +++ b/user/configs/wayland/waybar.nix @@ -24,7 +24,7 @@ let else echo "{\"class\":\"not_connected\",\"text\":\"\"}" fi - sleep 1 + sleep 60 done ''; in diff --git a/user/configs/zellij/default.nix b/user/configs/zellij/default.nix new file mode 100644 index 0000000..4a7d17f --- /dev/null +++ b/user/configs/zellij/default.nix @@ -0,0 +1,4 @@ +{ pkgs, lib, ... }: +{ + +} diff --git a/user/home.nix b/user/home.nix index e6f9b59..9d742c7 100755 --- a/user/home.nix +++ b/user/home.nix @@ -1,64 +1,67 @@ { config, pkgs, inputs, nix-colors, ... }: +let +colors = config.colorScheme.colors; +in { imports = [ nix-colors.homeManagerModule - ./configs/beets - ./configs/cava - ./configs/wayland/hyprland.nix - #./configs/wayland/sway.nix - ./configs/fish - ./configs/mpd - ./configs/mpv - ./configs/neovim - ./configs/firefox - ./configs/dircolors.nix - ./configs/xdg-mime.nix + ./configs/beets + ./configs/cava + ./configs/wayland/hyprland.nix + #./configs/wayland/sway.nix + ./configs/fish + ./configs/mpd + ./configs/mpv + ./configs/neovim + ./configs/firefox + ./configs/dircolors.nix + ./configs/xdg-mime.nix ]; - # Home Manager needs a bit of information about you and the - # paths it should manage. +# Home Manager needs a bit of information about you and the +# paths it should manage. home.username = "manuel"; home.homeDirectory = "/home/manuel"; home.packages = with pkgs; [ appimage-run - bottom - calcurse - fastfetch - gamescope - gimp - gnome.file-roller - gnome.seahorse - gnome.simple-scan - gnome.gvfs - hyprpaper - hyprpicker - lutris - mesa-demos - mesa-demos - nerdfonts - noto-fonts-cjk-sans - noto-fonts-cjk-serif - obs-studio - pavucontrol - protontricks - sc-im - signal-desktop - sshfs - steam - steam-run - steamtinkerlaunch - sxiv - thunderbird - twemoji-color-font - vimv - vulkan-tools - vulkan-validation-layers - webcord - wineWowPackages.stagingFull - wxedid - xdg-utils - xivlauncher - ]; + qt5ct + bc + bottom + calcurse + fastfetch + gamescope + gimp + gnome.file-roller + gnome.gvfs + gnome.seahorse + gnome.simple-scan + lutris + mesa-demos + nerdfonts + noto-fonts-cjk-sans + noto-fonts-cjk-serif + obs-studio + pavucontrol + protontricks + sc-im + signal-desktop + sshfs + steam + steam-run + steamtinkerlaunch + sxiv + thunderbird + tldr + twemoji-color-font + vimv + vulkan-tools + vulkan-validation-layers + webcord + wineWowPackages.stagingFull + wxedid + xdg-utils + xivlauncher + ]; home.sessionVariables = { EDITOR = "nvim"; @@ -78,7 +81,7 @@ enableFishIntegration = true; }; - services.gpg-agent = { enable = true; }; + services.gpg-agent.enable = true; services.udiskie.enable = true; @@ -116,34 +119,55 @@ }; }; + programs = { + aria2.enable = true; + password-store.enable = true; + command-not-found.enable = false; - programs.git = { - enable = true; - lfs.enable = true; - userName = "Varris"; - userEmail = "varris@posteo.net"; - }; + fzf = { + enable = true; + enableFishIntegration = true; + }; - programs.fzf = { - enable = true; - enableFishIntegration = true; - }; + git = { + enable = true; + lfs.enable = true; + userName = "Varris"; + userEmail = "varris@posteo.net"; + }; - programs.command-not-found.enable = false; - programs.nix-index = { - enable = true; - enableFishIntegration = true; + nix-index = { + enable = true; + enableFishIntegration = true; + }; + + zellij = { + enable = true; + settings = { + theme = "gruvbox-dark"; + themes.gruvbox-dark = { + fg = "#${colors.base05}"; + bg = "#${colors.base00}"; + black = "#${colors.base01}"; + red = "#${colors.base08}"; + green = "#${colors.base0B}"; + yellow = "#${colors.base0A}"; + blue = "#${colors.base0D}"; + magenta = "#${colors.base0E}"; + cyan = "#${colors.base0C}"; + white = "#${colors.base07}"; + orange = "#${colors.base0F}"; + }; + }; + }; }; services.gnome-keyring.enable = true; services.easyeffects = { - enable = true; + enable = false; preset = "custom"; }; - programs.aria2.enable = true; - - programs.password-store.enable = true; xdg.userDirs = { enable = true; @@ -152,14 +176,14 @@ music = "/mnt/hdd/Music"; download = "/mnt/hdd/Downloads"; }; - # This value determines the Home Manager release that your - # configuration is compatible with. This helps avoid breakage - # when a new Home Manager release introduces backwards - # incompatible changes. - # - # You can update Home Manager without changing this value. See - # the Home Manager release notes for a list of state version - # changes in each release. +# This value determines the Home Manager release that your +# configuration is compatible with. This helps avoid breakage +# when a new Home Manager release introduces backwards +# incompatible changes. +# +# You can update Home Manager without changing this value. See +# the Home Manager release notes for a list of state version +# changes in each release. home.stateVersion = "22.05"; }