Merge branch 'master' of github.com:Kropatz/dotfiles

This commit is contained in:
Kopatz
2023-12-01 18:37:40 +01:00
18 changed files with 625 additions and 260 deletions

7
modules/anki.nix Normal file
View File

@@ -0,0 +1,7 @@
{
services.ankisyncd = {
enable = true;
port = 27701;
openFirewall = true;
};
}

View File

@@ -0,0 +1,347 @@
{ config, pkgs, lib, inputs, vars, ... }:
let
patchedWaybar = pkgs.waybar.overrideAttrs (oldAttrs: {
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
});
patchedHyprland = pkgs.hyprland.overrideAttrs (oldAttrs: {
version = "0.28.0";
});
in
{
services.xserver = {
layout = vars.layout;
xkbVariant = vars.variant;
enable = true;
displayManager = lib.mkIf (!config.services.xserver.displayManager.gdm.enable) {
sddm.enable = true;
};
};
environment.sessionVariables = {
# If your cursor becomes invisible
#WLR_NO_HARDWARE_CURSORS = "1";
# Hint electron apps to use wayland
NIXOS_OZONE_WL = "1";
WLR_NO_HARDWARE_CURSORS="1";
WLR_DRM_DEVICES = "/dev/dri/card0";
};
hardware = {
# Opengl
opengl.enable = true;
# Most wayland compositors need this
nvidia.modesetting.enable = true;
};
programs.hyprland = {
enable = true;
enableNvidiaPatches = true;
xwayland.enable = true;
package = patchedHyprland;
};
home-manager.users.kopatz = {
#systemd.user.services.waybar.Service.ExecStart = lib.mkForce "${pkgs.waybar}/bin/waybar -b 0";
wayland.windowManager.hyprland = {
enable = true;
package = patchedHyprland;
settings = {
#
# Please note not all available settings / options are set here.
# For a full list, see the wiki
#
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor = [
"HDMI-A-1,1920x1080@60,0x0,1"
"DP-1,2560x1440@144,1920x0,1"
",preferred,auto,auto"
];
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
# Execute your favorite apps at launch
# exec-once = waybar & hyprpaper & firefox
# Source a file (multi-file configs)
# source = ~/.config/hypr/myColors.conf
# Some default env vars.
env = "XCURSOR_SIZE,24";
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input = {
kb_layout = vars.layout;
kb_variant = vars.variant;
kb_model = "";
kb_options = "";
kb_rules = "";
follow_mouse = 1;
touchpad = {
natural_scroll = true;
};
sensitivity = 0; # -1.0 - 1.0, 0 means no modification.
};
general = {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
gaps_in = 5;
gaps_out = 20;
border_size = 2;
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
"col.inactive_border" = "rgba(595959aa)";
layout = "dwindle";
};
decoration = {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
rounding = 10;
#blur = yes
#blur_size = 3
#blur_passes = 1
#blur_new_optimizations = on
drop_shadow = true;
shadow_range = 4;
shadow_render_power = 3;
"col.shadow" = "rgba(1a1a1aee)";
};
animations = {
enabled = false;
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
#bezier = myBezier, 0.05, 0.9, 0.1, 1.05
#animation = windows, 1, 7, myBezier
#animation = windowsOut, 1, 7, default, popin 80%
#animation = border, 1, 10, default
#animation = borderangle, 1, 8, default
#animation = fade, 1, 7, default
#animation = workspaces, 1, 6, default
};
dwindle = {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = true; # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = true; # you probably want this
};
master = {
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
new_is_master = true;
};
gestures = {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = true;
};
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
#"device:epic-mouse-v1" = {
# sensitivity = -0.5;
#};
# Example windowrule v1
# windowrule = float, ^(kitty)$
# Example windowrule v2
# float,class:^(kitty)$,title:^(kitty)$
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
"$mainMod" = "SUPER";
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = let
rofi = "${pkgs.rofi-wayland}/bin/rofi";
kitty = "${pkgs.kitty}/bin/kitty";
thunar = "${pkgs.xfce.thunar}/bin/thunar";
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
grim = "${pkgs.grim}/bin/grim";
slurp = "${pkgs.slurp}/bin/slurp";
in [
"$mainMod, Q, exec, ${kitty}"
"$mainMod, C, killactive"
"$mainMod, M, exit,"
"$mainMod, E, exec, ${thunar}"
"$mainMod, V, togglefloating"
"$mainMod, S, exec, ${rofi} -show drun -show-icons"
" , Print, exec, ${grim} -g \"$(${slurp} -d)\" - | ${wl-copy}"
"ALT, SPACE, exec, ${rofi} -show combi"
"$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"
# 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, movetoworkspace, 1"
"$mainMod SHIFT, 2, movetoworkspace, 2"
"$mainMod SHIFT, 3, movetoworkspace, 3"
"$mainMod SHIFT, 4, movetoworkspace, 4"
"$mainMod SHIFT, 5, movetoworkspace, 5"
"$mainMod SHIFT, 6, movetoworkspace, 6"
"$mainMod SHIFT, 7, movetoworkspace, 7"
"$mainMod SHIFT, 8, movetoworkspace, 8"
"$mainMod SHIFT, 9, movetoworkspace, 9"
"$mainMod SHIFT, 0, movetoworkspace, 10"
# Scroll through existing workspaces with mainMod + scroll
"$mainMod, mouse_down, workspace, e+1"
"$mainMod, mouse_up, workspace, e-1"
"ALT, Tab, cyclenext,"
"ALT, Tab, bringactivetotop,"
];
bindm = [
# Move/resize windows with mainMod + LMB/RMB and dragging
"$mainMod, mouse:272, movewindow"
"$mainMod, mouse:273, resizewindow"
];
windowrulev2 = [
# -- Fix odd behaviors in IntelliJ IDEs --
#! Fix focus issues when dialogs are opened or closed
"windowdance,class:^(jetbrains-.*)$,floating:1"
#! Fix splash screen showing in weird places and prevent annoying focus takeovers
"center,class:^(jetbrains-.*)$,title:^(splash)$,floating:1"
"nofocus,class:^(jetbrains-.*)$,title:^(splash)$,floating:1"
"noborder,class:^(jetbrains-.*)$,title:^(splash)$,floating:1"
#! Center popups/find windows
"center,class:^(jetbrains-.*)$,title:^( )$,floating:1"
"stayfocused,class:^(jetbrains-.*)$,title:^( )$,floating:1"
"noborder,class:^(jetbrains-.*)$,title:^( )$,floating:1"
#! Disable window flicker when autocomplete or tooltips appear
"nofocus,class:^(jetbrains-.*)$,title:^(win.*)$,floating:1"
];
exec-once = [
"${pkgs.swww}/bin/swww init; sleep 1;"
"${pkgs.networkmanagerapplet}/bin/nm-applet --indicator &"
"${pkgs.waybar}/bin/waybar &"
"${pkgs.dunst}/bin/dunst &"
];
};
};
programs.waybar = {
enable = true;
#systemd.enable = true;
#systemd.target = "sway-session.target";
settings.main = {
layer = "top";
position = "bottom";
#output = lib.mapAttrsToList (n: v: v.monitor) outputs;
height = 25;
spacing = 4;
modules-left = [
"hyprland/workspaces"
];
modules-center = [];
modules-right = [
"network"
"cpu"
"memory"
"temperature"
"backlight"
"pulseaudio"
"battery"
"clock"
"tray"
];
"network".format-wifi = "{essid} ({signalStrength}%) ";
"network".format-ethernet = "{ifname}: {ipaddr}/{cidr} ";
"network".format-disconnected = "Disconnected ";
"network".interval = 7;
"cpu".format = "CPU: {usage}% ";
"memory".format = "MEM: {}% ";
"temperature".critical-threshold = 80;
"temperature".format = "{temperatureC}°C ";
"backlight".format = "{percent}% {icon}";
"backlight".states = [0 50];
"backlight".format-icons = ["" ""];
"pulseaudio".format = "{volume}% {icon}";
"pulseaudio".format-bluetooth = ": {volume}% {icon}";
"pulseaudio".format-muted = "";
"pulseaudio".format-icons.headphones = "";
"pulseaudio".format-icons.handsfree = "";
"pulseaudio".format-icons.headset = "";
"pulseaudio".format-icons.phone = "";
"pulseaudio".format-icons.portable = "";
"pulseaudio".format-icons.car = "";
"pulseaudio".format-icons.default = ["" ""];
"pulseaudio".on-click = "${pkgs.pavucontrol}/bin/pavucontrol";
"battery".states.good = 95;
"battery".states.warning = 30;
"battery".states.critical = 15;
"battery".format = "{capacity}% / {power:.2}W {icon}";
"battery".format-icons = ["" "" "" "" ""];
"clock".format = "{:%F %H:%M}";
"tray".icon-size = 21;
"tray".spacing = 10;
"hyprland/workspaces" = {
"disable-scroll" = true;
"all-outputs" = true;
"active-only" = false;
"on-click" = "activate";
};
};
};
};
# XDG portal
xdg.portal.enable = true;
xdg.portal.extraPortals = lib.mkDefault [ pkgs.xdg-desktop-portal-gtk ];
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# hyprland stuff
patchedWaybar
dunst
swww
kitty
rofi-wayland
libnotify
networkmanagerapplet
wayland
#qt5.qtwayland
#qt6.qmake
#qt6.qtwayland
#waybar
#xdg-desktop-portal-hyprland
#xdg-desktop-portal-gtk
#xdg-utils
#xwayland
];
}

View File

@@ -20,12 +20,12 @@ in
programs.kdeconnect.enable = true;
fonts.fontDir.enable = true;
fonts.fonts = with pkgs; [
fonts.packages = with pkgs; [
nerdfonts
];
networking.firewall = {
enable = true;
enable = false;
allowedTCPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
];
@@ -36,7 +36,6 @@ in
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# List packages installed in system profile. To search, run:
# $ nix search wget
@@ -49,17 +48,13 @@ in
keepassWithPlugins
jetbrains.idea-ultimate
jetbrains.rider
dotnet-sdk_7
dotnet-runtime_7
neovim
htop
btop
git
xfce.thunar
killall
xclip
usbutils
bun
inputs.agenix.packages."x86_64-linux".default
insomnia
remmina
@@ -81,11 +76,12 @@ in
screenshot
glxinfo
vulkan-tools
anki
];
environment.sessionVariables = {
DOTNET_ROOT = "${pkgs.dotnet-sdk_7}";
};
#environment.sessionVariables = {
# DOTNET_ROOT = "${pkgs.dotnet-sdk_7}";
#};
### docker
virtualisation.docker.enable = true;

View File

@@ -0,0 +1,33 @@
{config, pkgs, ...}:
{
# Enable OpenGL
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.production;
};
}

4
modules/kernel.nix Normal file
View File

@@ -0,0 +1,4 @@
{pkgs, ...}:
{
boot.kernelPackages = pkgs.linuxPackages_latest;
}