Skip to content

Commit

Permalink
Add Hyprlock, remove ReGreet & greetd. (#55)
Browse files Browse the repository at this point in the history
* Remove ReGreet & greetd.

* Add Hyprlock.
  • Loading branch information
attilaolah authored Jun 5, 2024
1 parent 3093a38 commit 044506c
Show file tree
Hide file tree
Showing 14 changed files with 202 additions and 115 deletions.
77 changes: 76 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprlock = {
url = "github:hyprwm/hyprlock";
inputs.nixpkgs.follows = "nixpkgs";
};

# https://lix.systems
lix = {
Expand All @@ -26,6 +30,7 @@
nixpkgs,
nixos-unstable,
home-manager,
hyprlock,
lix-module,
...
} @ inputs: let
Expand All @@ -45,7 +50,12 @@
home-manager = {
inherit useGlobalPkgs useUserPackages users;
backupFileExtension = "bkp";
extraSpecialArgs.desktop = true;
extraSpecialArgs =
inputs
// {
inherit system;
desktop = true;
};
};
}

Expand Down
1 change: 0 additions & 1 deletion home-manager/file.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ in {
# timeout = ${toString (60 * 20 + 20)}
# on-timeout = ${loginctl} lock-session
# }
#'';

".config/davfs.conf".text = ''
secrets ${config.home.homeDirectory}/.config/davfs.secrets
Expand Down
1 change: 1 addition & 0 deletions home-manager/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ in {
./gtk.nix
./qt.nix
./wayland/window_manager/hyprland.nix
./xdg/config_file.nix
];

home =
Expand Down
11 changes: 8 additions & 3 deletions home-manager/wayland/window_manager/hyprland.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
#
{
config,
hyprlock,
lib,
pkgs,
system,
...
}: let
input = import ../../../hosts/home/hyprland/input.nix {config = xkb;};
monitors = import ../../../hosts/home/hyprland/monitors.nix {inherit lib;};
monitors = import ../../../hosts/home/hyprland/monitors.nix;
xkb = import ../../../hosts/home/services/xserver/xkb.nix {inherit lib;};

workspaces = [1 2 3 4 5 6 7 8];
Expand All @@ -22,7 +24,8 @@
foot = lib.getExe pkgs.foot;
google-chrome = lib.getExe' pkgs.google-chrome "google-chrome-stable";
grim = lib.getExe pkgs.grim;
hypridle = lib.getExe pkgs.hypridle;
hidle = lib.getExe pkgs.hypridle;
hlock = lib.getExe hyprlock.packages.${system}.default;
mkdir = lib.getExe' pkgs.coreutils "mkdir";
slurp = lib.getExe pkgs.slurp;
swaync = lib.getExe' pkgs.swaynotificationcenter "swaync";
Expand All @@ -40,7 +43,7 @@ in {
inherit (monitors) "$M1" "$M2" "$M3" "monitor" "workspace";

exec-once = [
hypridle
hidle
monitors.exec-once
swaync
waybar
Expand Down Expand Up @@ -71,6 +74,7 @@ in {
"$NOTIF" =
"${swaync-client}"
+ " --toggle-panel";
"$LOCK" = hlock;

general = {
allow_tearing = false;
Expand Down Expand Up @@ -112,6 +116,7 @@ in {
"$MOD, B, exec, $BROWSER" # [b]rowser
"$MOD, D, pseudo," # [d]windle
"$MOD, F, fullscreen," # [f]ullscrean
"$MOD, L, exec, $LOCK" # [l]ock
"$MOD, N, exec, $NOTIF" # [n]otification centre
"$MOD, P, exec, $PRINT" # [p]rint screen
"$MOD, R, exec, $MENU" # [r]un
Expand Down
5 changes: 5 additions & 0 deletions home-manager/xdg/config_file.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
xdg.configFile = {
"hypr/hyprlock.conf".source = ./hypr/hyprlock.conf;
};
}
94 changes: 94 additions & 0 deletions home-manager/xdg/hypr/hyprlock.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
general {
disable_loading_bar = true
hide_cursor = true
}

background {
monitor =
color = rgb(17, 17, 27) # crust
}

input-field {
monitor =
size = 270, 270
outline_thickness = 8
hide_input = true
outer_color = rgba(0, 0, 0, 0)
inner_color = rgb(148, 226, 213) # teal
fade_on_empty = true
fade_timeout = 200
placeholder_text =
fail_text =
fail_color = rgb(243, 139, 168)
fail_transition = 50
rounding = -1
check_color = rgb(243, 139, 168) # red

position = 0, 0
halign = center
valign = center
zindex = 1
}

image {
monitor =
path = $HOME/photos/ao/avatar.1024.png
size = 256
rounding = -1 # circle
border_size = 4
border_color = rgb(148, 226, 213) # teal
reload_time = -1

position = 0, 0
halign = center
valign = center
zindex = 2
}

label {
monitor =
text = cmd[update:1000] uptime | awk '{ print "UP " $3 }' | sed s/,//
color = rgb(205, 214, 244) # text
font_size = 48
font_family = monospace

position = 48, 64
halign = left
valign = bottom
}

label {
monitor =
text = cmd[update:200] cat /proc/loadavg
color = rgb(186, 194, 222) # subtext 1
font_size = 24
font_family = monospace

position = 48, 24
halign = left
valign = bottom
}

label {
monitor =
text = cmd[update:1000] echo "$TIME"
color = rgb(205, 214, 244) # text
font_size = 48
font_family = monospace

position = -48, 64
halign = right
valign = bottom
}

label {
monitor =
text = cmd[update:1000] date +"%a %Y-%m-%d" | tr '[:lower:]' '[:upper:]'
color = rgb(186, 194, 222) # subtext 1
font_size = 24
font_family = monospace

position = -48, 24
halign = right
valign = bottom
}
1 change: 0 additions & 1 deletion hosts/home/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
./services/blueman.nix
./services/davfs2.nix
./services/dbus.nix
./services/greetd.nix
./services/gvfs.nix
./services/openssh.nix
./services/pipewire.nix
Expand Down
22 changes: 1 addition & 21 deletions hosts/home/hyprland/input.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{config, ...}: rec {
{config, ...}: {
input = {
# Keyboard:
kb_layout = config.services.xserver.xkb.layout;
Expand All @@ -11,24 +11,4 @@
touchpad.natural_scroll = false;
sensitivity = 0;
};

# RAW Hyprland config, for hyprland.greet.conf.
hyprconf = with input; ''
input {
# Keyboard:
kb_layout = ${kb_layout}
kb_variant = ${kb_variant}
kb_options = ${kb_options}
numlock_by_default = ${toString numlock_by_default}
# Mouse:
follow_mouse = ${toString follow_mouse}
touchpad:natural_scroll = ${
if touchpad.natural_scroll
then "yes"
else "no"
}
sensitivity = ${toString sensitivity}
}
'';
}
16 changes: 2 additions & 14 deletions hosts/home/hyprland/monitors.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{lib, ...}: let
let
# Monitor layout:
# ╔═══╗ ╔═══╗
# ║ D ║╔═══════╗║ L ║
Expand All @@ -8,7 +8,7 @@
M1 = "Dell Inc. DELL P2720DC 81WTK01K1SFS";
M2 = "Samsung Electric Company U32J59x HNMW200264";
M3 = "Lenovo Group Limited P27h-20 V906V9HY";
in rec {
in {
"$M1" = "desc:${M1}";
"$M2" = "desc:${M2}";
"$M3" = "desc:${M3}";
Expand All @@ -26,16 +26,4 @@ in rec {
];

exec-once = "hyprctl dispatch focusmonitor $M2";

# RAW Hyprland config, for hyprland.greet.conf.
hyprconf = lib.concatStringsSep "\n" (
[
"$M1 = desc:${M1}"
"$M2 = desc:${M2}"
"$M3 = desc:${M3}"
]
++ (map (x: "monitor = ${x}") monitor)
++ (map (x: "workspace = ${x}") workspace)
++ ["exec-once = ${exec-once}"]
);
}
19 changes: 3 additions & 16 deletions hosts/home/overlays.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
({pkgs, ...}: {
nixpkgs.overlays = [
(final: prev: {
regreet = prev.greetd.regreet.overrideAttrs (old: {
patches =
(old.patches or [])
++ [
(pkgs.fetchpatch {
url = "https://github.com/rharish101/ReGreet/commit/f148a62a33508cd70481fc23999dbbf9c51030a8.patch";
sha256 = "sha256-SkhchbCSL7P1vq+uEH1v19oy4LImKPY0AtnqhGW7dvc=";
})
];
});
})
];
})
{
nixpkgs.overlays = [];
}
Loading

0 comments on commit 044506c

Please sign in to comment.