initial configuration

This commit is contained in:
2024-03-09 17:18:36 +01:00
commit b51cdf718a
41 changed files with 1741 additions and 0 deletions

View File

@@ -0,0 +1,145 @@
{ pkgs, ... }:
{
imports = [
./waybar.nix
./hyprpaper.nix
./hyprlock.nix
./hypridle.nix
./fixes.nix
];
home.packages = with pkgs; [
rofi
kitty
wev
brightnessctl
playerctl
wl-clipboard
grimblast
nwg-bar
powertop
];
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.unstable.hyprland;
settings = {
monitor = ",preferred,auto,1.566667";
exec-once = [
"waybar"
"hyprpaper"
];
"$mod" = "SUPER";
input = {
follow_mouse = 2;
touchpad = {
natural_scroll = true;
clickfinger_behavior = true;
};
};
general = {
gaps_in = "5";
gaps_out = "10";
border_size = "2";
"col.active_border" = "rgba(00bfffee) rgba(36b7e2ee) 45deg";
"col.inactive_border" = "rgba(0a3543aa)";
layout = "dwindle";
};
decoration = {
rounding = "5";
drop_shadow = "false";
blur.enabled = "false";
shadow_render_power = "3";
"col.shadow" = "rgba(1a1a1aee)";
};
gestures = {
workspace_swipe = "on";
workspace_swipe_distance = "200";
};
misc = {
vfr = "true";
};
bind = [
"$mod, Q, exec, kitty"
"$mod, SPACE, exec, rofi -show drun"
",Print, exec, grimblast copy area"
"$mod,ESCAPE, exec, nwg-bar"
"$mod, C, killactive"
"$mod, V, togglefloating"
"$mod, F, fullscreen, 0"
"$mod, M, fullscreen, 1"
"$mod, L, exec, hyprlock"
"$mod, h, movefocus, l"
"$mod, l, movefocus, r"
"$mod, k, movefocus, u"
"$mod, j, movefocus, d"
"$mod SHIFT, h, movewindow, l"
"$mod SHIFT, l, movewindow, r"
"$mod SHIFT, k, movewindow, u"
"$mod SHIFT, j, movewindow, d"
"$mod ALT, h, resizeactive, -20 0"
"$mod ALT, l, resizeactive, 20 0"
"$mod ALT, k, resizeactive, 0 -20"
"$mod ALT, j, resizeactive, 0 20"
"$mod, 1, workspace, 1"
"$mod, 2, workspace, 2"
"$mod, 3, workspace, 3"
"$mod, 4, workspace, 4"
"$mod, 5, workspace, 5"
"$mod, 6, workspace, 6"
"$mod, 7, workspace, 7"
"$mod, 8, workspace, 8"
"$mod SHIFT, 1, movetoworkspace, 1"
"$mod SHIFT, 2, movetoworkspace, 2"
"$mod SHIFT, 3, movetoworkspace, 3"
"$mod SHIFT, 4, movetoworkspace, 4"
"$mod SHIFT, 5, movetoworkspace, 5"
"$mod SHIFT, 6, movetoworkspace, 6"
"$mod SHIFT, 7, movetoworkspace, 7"
"$mod SHIFT, 8, movetoworkspace, 8"
];
bindle = [
# Volume control
",XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"
",XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"
# Brightness control
",XF86MonBrightnessUp, exec, brightnessctl set 5%+"
",XF86MonBrightnessDown, exec, brightnessctl set 5%-"
];
bindl= [
# Toggle audio mute
",XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
# Media control
",XF86AudioPlay, exec, playerctl play-pause"
",XF86AudioNext, exec, playerctl next"
",XF86AudioPrev, exec, playerctl previous"
];
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
};
};
}

View File

@@ -0,0 +1,22 @@
{ ... }:
{
home.file.".config/electron-flags.conf" = {
enable = true;
executable = false;
text =''
--enable-features=UseOzonePlatform --ozone-platform=wayland
'';
};
home.sessionVariables = {
NIXOS_OZONE_WL = "1";
};
programs.bash = {
enable = true;
#sessionVariables = {
# NIXOS_OZONE_WL = "1";
#};
};
}

View File

@@ -0,0 +1,35 @@
{ inputs, pkgs, ... }:
{
imports = [
inputs.hypridle.homeManagerModules.default
];
services.hypridle = {
enable = true;
lockCmd = "pidof ${inputs.hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock || ${inputs.hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock"; # avoid starting multiple hyprlock instances.
beforeSleepCmd = "${inputs.hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock"; # lock before suspend.
afterSleepCmd = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on"; # to avoid having to press a key twice to turn on the display.
listeners = [
{
timeout = 120; # 2.5min.
onTimeout = "${pkgs.brightnessctl}/bin/brightnessctl -s set 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor.
onResume = "${pkgs.brightnessctl}/bin/brightnessctl -r";
}
{
timeout = 300; # 5min
onTimeout = "${inputs.hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock";
}
{
timeout = 380; # 5.5min
onTimeout = "${pkgs.hyprland}/bin/hyprctl dispatch dpms off"; # screen off when timeout has passed
onResume = "${pkgs.hyprland}/bin/hyprctl dispatch dpms on";
}
{
timeout = 600; # 30min
onTimeout = "systemctl suspend"; # suspend pc
}
];
};
}

View File

@@ -0,0 +1,42 @@
{ inputs, config, ... }:
{
imports = [
inputs.hyprlock.homeManagerModules.default
];
programs.hyprlock = {
enable = true;
backgrounds = [
{
monitor = "";
path = "$HOME/Pictures/wallpaper-2.png";
blur_passes = 1;
}
];
input-fields = [{
monitor = "";
size = {
width = 400;
};
fade_on_empty = false;
dots_size = 0.3;
dots_center = true;
outline_thickness = -1;
outer_color = "0xff${config.colorScheme.palette.base05}";
inner_color = "0xff${config.colorScheme.palette.base00}";
font_color = "0xff${config.colorScheme.palette.base05}";
placeholder_text = "<i>Press enter for fingerprint</i>";
position.x = 0;
position.y = -50;
}];
labels = [{
font_size = 80;
color = "0xff${config.colorScheme.palette.base06}";
position.x = 0;
position.y = 250;
font_family = "DejaVuSansM Nerd Font Mono";
text = "$TIME";
}];
};
}

View File

@@ -0,0 +1,20 @@
{ pkgs, ... }:
{
home.packages = with pkgs; [
hyprpaper
];
home.file.".config/hypr/hyprpaper.conf" = {
enable = true;
executable = false;
text =''
preload = ~/Pictures/wallpaper.png
preload = ~/Pictures/wallpaper-1.png
preload = ~/Pictures/wallpaper-2.png
wallpaper = eDP-1,~/Pictures/wallpaper-2.png
ipc = off
'';
};
}

View File

@@ -0,0 +1,142 @@
{ ... }:
{
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
position = "top";
height = 32;
modules-left = [
"hyprland/workspaces"
"hyprland/window"
];
modules-center = [
"clock"
];
modules-right = [
"tray"
"pulseaudio"
"battery"
];
# Modules left
"hyprland/workspaces" = {
"format" = "{icon}";
"on-scroll-up" = "hyprctl dispatch workspace e+1";
"on-scroll-down" = "hyprctl dispatch workspace e-1";
"on-click" = "activate";
"persistent-workspaces" = {
"1" = [];
"2" = [];
"3" = [];
"4" = [];
"5" = [];
"6" = [];
"7" = [];
"8" = [];
};
"format-icons" = {
"default" = "";
"empty" = "";
"active" = "";
};
};
"hyprland/window" = {
"max-length" = 200;
"seperate-outputs" = true;
};
# Modules middle
"clock" = {
"interval" = 1;
"format" = "{:%a %d %b | %H:%M:%S}";
};
# Modules right
"tray" = {
"spacing" = 10;
"icon-size" = 21;
};
"battery" = {
"bat" = "BAT1";
"interval" = 60;
"states" = {
"warning" = 30;
"critical" = 15;
};
"format" = "{icon} {capacity}%";
"format-icons" = [ "" "" "" "" "" ];
};
"pulseaudio" = {
"format" = "{icon} {volume}%";
"format-bluetooth" = "{volume}% {icon}";
"format-muted" = "󰝟";
"format-icons" = {
"headphone" = "";
"hands-free" = "";
"headset" = "";
"phone" = "";
"portable" = "";
"car" = "";
"default" = ["" ""];
};
"scroll-step" = 1;
"on-click" = "pavucontrol";
"ignored-sinks" = ["Easy Effects Sink"];
};
};
};
style = ''
* {
/* `otf-font-awesome` is required to be installed for icons */
font-family: DejaVuSansM Nerd Font;
}
#workspaces,#window,#clock,#battery,#tray,#pulseaudio {
background-color: @theme_bg_color;
border-radius: 50px;
padding: 0px 15px;
margin: 5px 3px 0px 3px;
}
#workspaces {
margin-left: 10px;
padding: 0px 5px;
font-size: 15px;
}
window#waybar.empty #window {
background-color: transparent;
}
window#waybar {
background-color: transparent;
font-size: 12px;
}
#workspaces button.active {
color: @theme_text_color;
}
#workspaces button {
color: shade(@theme_text_color, 0.5);
padding: 2px 5px;
}
#battery {
margin-right: 10px;
}
#battery.warning {
background-color: #ff8000;
}
#battery.critical {
background-color: #f00;
}
'';
};
}