add lockscreen

This commit is contained in:
2025-05-06 22:54:36 +02:00
parent 11358663fc
commit 23010ee036
13 changed files with 129 additions and 21 deletions

View File

@@ -119,8 +119,8 @@
virtualisation.virtualbox.host.enableKvm = true;
virtualisation.virtualbox.host.addNetworkInterface = false;
# Betterlockscreen
security.pam.services.i3lock.enable = true;
# Hyprlock
security.pam.services.hyprlock = {};
# Enabling the Keyring.
security.pam.services.lightdm.enableGnomeKeyring = true;

View File

@@ -36,6 +36,7 @@
users.elias = import ./home/default-laptop.nix;
};
nixpkgs.overlays = [
# (import ./overlays/river-status.nix)
inputs.nur.overlays.default
];
}

View File

@@ -31,6 +31,19 @@
stateVersion = "23.11";
};
systemd.user.services = {
idle-inhibitor = {
Unit = {
Description = "Presentation Mode";
};
Service = {
Type = "simple";
ExecStart = "systemd-inhibit --what=idle --who=Caffeine --why=Caffeine --mode=block sleep inf";
};
};
};
programs = { home-manager.enable = true; };
nixpkgs.config = {

View File

@@ -1,5 +1,6 @@
{
imports = [
./hyprlock.nix
./river
./alacritty
./anki

View File

@@ -254,6 +254,13 @@
:class "text separator"
:text "|"))
(defwidget idle_inhibitor []
(box :class "idle_inhibitor"
:space-evenly false
(button :class "icon"
:onclick "systemctl --user is-active idle-inhibitor.service && systemctl --user stop idle-inhibitor.service || systemctl --user start idle-inhibitor.service"
(label :text "${idle_inhibitor == 'start' ? '󰈈' : '󰛐' }"))))
;; /-- Bar -->
(defwindow bar []
:geometry (geometry
@@ -266,6 +273,8 @@
:reserve (struts
:distance "25px"
:side "top")
:exclusive true
:layer "top"
:windowtype "dock"
(box
:orientation "horizontal"
@@ -277,6 +286,7 @@
(widgetLogSeperator)
(widgetWindows)
(box :hexpand true)
(idle_inhibitor)
(widgetSpeaker)
(widgetSeperator)
(widgetBacklight)

View File

@@ -0,0 +1,6 @@
socat - UNIX-CONNECT:"$XDG_RUNTIME_DIR"/river/status | while read -r line; do
workspace=$(echo "$line" | jq -r '.workspace')
layout=$(echo "$line" | jq -r '.layout')
title=$(echo "$line" | jq -r '.title')
echo "WS: $workspace | Layout: $layout | $title"
done

View File

@@ -0,0 +1,33 @@
{ ... }:
{
programs.hyprlock = {
enable = true;
settings = {
general = {
disable_loading_bar = true;
grace = 300;
hide_cursor = true;
no_fade_in = false;
};
background = [{
path = "screenshot";
blur_passes = 3;
blur_size = 8;
}];
input-field = [{
size = "200, 50";
position = "0, -80";
monitor = "";
dots_center = true;
fade_on_empty = false;
font_color = "rgb(202, 211, 245)";
inner_color = "rgb(91, 96, 120)";
outer_color = "rgb(24, 25, 38)";
outline_thickness = 5;
placeholder_text = ''<span foreground="##cad3f5">Password...</span>'';
shadow_passes = 2;
}];
};
};
}

View File

@@ -1,13 +1,13 @@
{ pkgs, lib, ... }:
{
home.packages = with pkgs; [
wlr-randr
yad slurp
grim
wl-clipboard
rivercarro
# river-status
];
xdg.configFile."helperscripts" = {
recursive = true;
@@ -33,13 +33,12 @@
systemd = { enable = true; };
xwayland.enable = true;
extraConfig = ''
rivertile -view-padding 0 -outer-padding 25 &
rivertile -view-padding 0 -outer-padding 0 &
'';
settings = {
spawn = [
"nextcloud --background"
"~/.config/helperscriptsstartEww.sh"
"trayer --edge top --align left --widthtype request --height 25 --transparent true --alpha 0 --expand true --SetDockType true --SetPartialStrut true"
"/home/elias/.config/helperscripts/startEww.sh"
];
spawn-tagmask = "${all_but_scratch_tag}";
keyboard-layout = "de";

View File

@@ -1,5 +1,5 @@
{ pkgs, ... }:
{
imports = [ ./ssh-agent ./gpg-agent ];
imports = [ ./ssh-agent ./gpg-agent ./hypridle.nix ];
}

View File

@@ -0,0 +1,23 @@
{ pkgs, ... }: {
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd =
"/run/current-system/sw/bin/pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock";
before_sleep_cmd = "/run/current-system/sw/bin/loginctl lock-session";
};
listener = [
{
timeout = 300;
on-timeout = "${pkgs.hyprlock}/bin/hyprlock";
}
{
timeout = 600;
on-timeout = "${pkgs.systemd}/bin/systemctl suspend";
}
];
};
};
}

View File

@@ -1,14 +0,0 @@
final: prev: {
obsidian = prev.obsidian.overrideAttrs (old: {
src = prev.fetchurl {
url = old.src.url;
<<<<<<< HEAD
hash = "sha256-bvmvzVyHrjh1Yj3JxEfry521CMX3E2GENmXddEeLwiE=";
=======
hash = "sha256-XVq0nQiyT2HvKQpzJIvhghsGgg4ye7uqZcyA1nH4O/o=";
>>>>>>> test
};
});
}

31
overlays/river-status.nix Normal file
View File

@@ -0,0 +1,31 @@
self: super:
{
river-status = super.rustPlatform.buildRustPackage rec {
pname = "river-status";
version = "0.1.0"; # Replace with the actual version if known
src = super.fetchFromGitHub {
owner = "grvn";
repo = "river-status";
rev = "main"; # Replace with a specific commit hash or tag if needed
sha256 = "sha256-QTHn3+8CRpm5CoTwuhoMjBG16CYcOb79cOXgcgzimkc="; # Placeholder
};
cargoHash = "sha256-DPsQE71sEpfVnyI6V/da5n9V9pbItPZMuu/EM/30Jyo="; # Placeholder
nativeBuildInputs = [
super.pkg-config # If you're dealing with C libraries or dependencies
];
buildInputs = [
super.wayland-utils # Add this or other dependencies if they are required for building
];
meta = with super.lib; {
description = "A client for fetching status information from the River Wayland compositor";
homepage = "https://github.com/grvn/river-status";
license = licenses.mit;
maintainers = with maintainers; [ "Elias Schröter" ];
};
};
}

5
overlays/shell.nix Normal file
View File

@@ -0,0 +1,5 @@
{ pkgs ? import <nixpkgs> { overlays = [ (import ./river-status.nix) ]; } }:
pkgs.mkShell {
buildInputs = [ pkgs.river-status ];
}