Skip to content

Commit

Permalink
feat: hypridle, hyprlock
Browse files Browse the repository at this point in the history
chore: flake update
chore: format cleanup
  • Loading branch information
erictossell committed Jul 5, 2024
1 parent e385886 commit 14fd3a3
Show file tree
Hide file tree
Showing 12 changed files with 322 additions and 228 deletions.
334 changes: 158 additions & 176 deletions flake.lock

Large diffs are not rendered by default.

39 changes: 21 additions & 18 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
in
nixpkgs.lib.nixosSystem {
specialArgs = {
DE = "hyprland";
username = "eriim";
hostName = "arkhitekton";
hyprlandConfig = "desktop";
Expand All @@ -68,7 +69,25 @@
./modules/steam
./modules/virt
];
}; # principium
}; # arkhitekton

terminus =
let
system = "x86_64-linux";
in
nixpkgs.lib.nixosSystem {
specialArgs = {
username = "eriim";
hostName = "terminus";
hyprlandConfig = "laptop";
DE = "hyprland";
inherit system;
} // attrs;
modules = [
./.
./modules/virt/podman.nix
];
}; # terminus

live-image =
let
Expand Down Expand Up @@ -97,7 +116,7 @@
inherit system;
} // attrs;
modules = [ ./wsl.nix ];
}; # winix-wsl
}; # winix

vm-temp =
let
Expand All @@ -113,22 +132,6 @@
modules = [ ./minimal.nix ];
}; # virtualis

terminus =
let
system = "x86_64-linux";
in
nixpkgs.lib.nixosSystem {
specialArgs = {
username = "eriim";
hostName = "terminus";
hyprlandConfig = "laptop";
inherit system;
} // attrs;
modules = [
./.
./modules/virt/podman.nix
];
}; # terminus
}; # configurations

devShells = forAllSystems (
Expand Down
1 change: 0 additions & 1 deletion hosts/arkhitekton/hardware-configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
Expand Down
11 changes: 7 additions & 4 deletions modules/core/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
];
};

home-manager.users.${username} = {
# The home.stateVersion option does not have a default and must be set
home.stateVersion = "23.05";
nixpkgs.config.allowUnfree = true;
home-manager = {
backupFileExtension = "backup";
users.${username} = {
# The home.stateVersion option does not have a default and must be set
home.stateVersion = "23.05";
nixpkgs.config.allowUnfree = true;
};
};

# Allow unfree packages
Expand Down
3 changes: 2 additions & 1 deletion modules/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{ DE, ... }:
{
imports = [
./agenix
./apps
./core
./eriixpkgs
./hardware
./hyprland
./${DE}
./tailscale
];
}
1 change: 0 additions & 1 deletion modules/hyprland/config/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
pkgs,
hyprlandConfig,
home-manager,
username,
Expand Down
4 changes: 2 additions & 2 deletions modules/hyprland/config/desktop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
monitor=DP-1,preferred,0x0,1,transform,3
monitor=,preferred,auto,auto
exec-once = swww-daemon & swww img ~/.config/backgrounds/porthole.jpg & mako & lxqt-policykit-agent & dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
exec-once = swww-daemon & swww img ~/.config/backgrounds/porthole.jpg & mako & lxqt-policykit-agent & hypridle & dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
# some default env vars.
env=BROWSER,firefox
Expand Down Expand Up @@ -53,7 +53,7 @@
bind = $mainMod, r, exec, wofi --show drun
bind = $mainMod, p, pseudo, # dwindle
bind = $mainMod, j, togglesplit, # dwindle
bind = $mainMod, l, exec, swaylock
bind = $mainMod, l, exec, loginctl lock-session
bind = $mainMod, o, exec, bash -i ~/.config/hypr/toggle_waybar.sh
bind = $mainMod, s, exec, grim -g "$(slurp)" ~/Pictures/Screenshots/$(date +'%Y%m%d_%H%M%S').png
Expand Down
2 changes: 1 addition & 1 deletion modules/hyprland/config/laptop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
bind = $mainMod, r, exec, wofi --show drun
bind = $mainMod, p, pseudo, # dwindle
bind = $mainMod, j, togglesplit, # dwindle
bind = $mainMod, l, exec, swaylock
bind = $mainMod, l, exec, loginctl lock-session
bind = $mainMod, o, exec, bash -i ~/.config/hypr/toggle_waybar.sh
bind = $mainMod, s, exec, grim -g "$(slurp)" ~/Pictures/Screenshots/$(date +'%Y%m%d_%H%M%S').png
Expand Down
19 changes: 10 additions & 9 deletions modules/hyprland/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,29 @@
hyprpicker,
pkgs,
username,
home-manager,
system,
...
}:
{
imports = [
hyprland.nixosModules.default
./config
#./hyprlock
./hypridle
./hyprlock
./mako
./swaylock
#./swaylock
./waybar
./wofi
];

home-manager.users.${username} = _: {
gtk.enable = true;
gtk.cursorTheme.name = "Adwaita";
gtk.cursorTheme.package = pkgs.gnome.adwaita-icon-theme;
gtk.theme.name = "adw-gtk3-dark";
gtk.theme.package = pkgs.adw-gtk3;
gtk = {
enable = true;
cursorTheme.name = "Adwaita";
cursorTheme.package = pkgs.adwaita-icon-theme;
theme.name = "adw-gtk3-dark";
theme.package = pkgs.adw-gtk3;
};
};

environment = {
Expand All @@ -45,7 +47,6 @@
};

programs.hyprland.enable = true;

programs.dconf.enable = true;

services.gnome = {
Expand Down
35 changes: 35 additions & 0 deletions modules/hyprland/hypridle/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ username, ... }:
{

services.hypridle.enable = true;

home-manager.users.${username} = _: {
home.file = {

".config/hypr/hypridle.conf".text = ''
general {
lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances.
before_sleep_cmd = loginctl lock-session # lock before suspend.
after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
}
listener {
timeout = 150 # 2.5min.
on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor.
on-resume = brightnessctl -r # monitor backlight restore.
}
listener {
timeout = 300 # 5min
on-timeout = loginctl lock-session # lock screen when timeout has passed
}
listener {
timeout = 330 # 5.5min
on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed
on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired.
}
'';
};
};
}
91 changes: 83 additions & 8 deletions modules/hyprland/hyprlock/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,85 @@
{ username, ... }:
{
home-manager,
hyprlock,
pkgs,
username,
...
}:
{
imports = [ hyprlock.homeManagerModules.hyprlock ];
programs.hyprlock.enable = true;
home-manager.users.${username} = _: {
home.file = {
".config/hypr/hyprlock.conf".text = ''
background {
monitor =
path = /home/${username}/.config/backgrounds/nyc-macro.png # supports png, jpg, webp (no animations, though)
color = rgba(25, 20, 20, 1.0)
# all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations
blur_passes = 0 # 0 disables blurring
blur_size = 7
noise = 0.0117
contrast = 0.8916
brightness = 0.8172
vibrancy = 0.1696
vibrancy_darkness = 0.0
}
shape {
monitor =
size = 360, 60
color = rgba(17, 17, 17, 1.0)
rounding = -1
border_size = 8
border_color = rgba(0, 207, 230, 1.0)
rotate = 0
xray = false # if true, make a "hole" in the background (rectangle of specified size, no rotation)
position = 0, 80
halign = center
valign = center
}
input-field {
monitor =
size = 200, 50
outline_thickness = 3
dots_size = 0.33 # Scale of input-field height, 0.2 - 0.8
dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0
dots_center = false
dots_rounding = -1 # -1 default circle, -2 follow input-field rounding
outer_color = rgb(151515)
inner_color = rgb(200, 200, 200)
font_color = rgb(10, 10, 10)
fade_on_empty = true
fade_timeout = 1000 # Milliseconds before fade_on_empty is triggered.
placeholder_text = <i>Input Password...</i> # Text rendered in the input box when it's empty.
hide_input = false
rounding = -1 # -1 means complete rounding (circle/oval)
check_color = rgb(204, 136, 34)
fail_color = rgb(204, 34, 34) # if authentication failed, changes outer_color and fail message color
fail_text = <i>$FAIL <b>($ATTEMPTS)</b></i> # can be set to empty
fail_transition = 300 # transition time in ms between normal outer_color and fail_color
capslock_color = -1
numlock_color = -1
bothlock_color = -1 # when both locks are active. -1 means don't change outer color (same for above)
invert_numlock = false # change color if numlock is off
swap_font_color = false # see below
position = 0, -20
halign = center
valign = center
}
label {
monitor =
text = Hi there, $USER
text_align = center # center/right or any value for default left. multi-line text alignment inside label container
color = rgba(0, 128, 0, 1)
font_size = 20
font_family = Monaspace Neon
rotate = 0 # degrees, counter-clockwise
position = 0, 80
halign = center
valign = center
}
'';

};
};
}
10 changes: 3 additions & 7 deletions modules/plasma/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
services.xserver = {
enable = true;
displayManager = {
sddm.enable = true;
defaultSession = "plasmawayland";
};
desktopManager.plasma5.enable = true;
services = {
displayManager.sddm.wayland.enable = true;
desktopManager.plasma6.enable = true;
};
qt = {
enable = true;
Expand Down

0 comments on commit 14fd3a3

Please sign in to comment.