mirror of
https://github.com/ItsDrike/nixdots
synced 2024-11-10 02:19:41 +00:00
Compare commits
5 commits
934230098e
...
b930b14cf2
Author | SHA1 | Date | |
---|---|---|---|
ItsDrike | b930b14cf2 | ||
ItsDrike | 6bbebb3cd2 | ||
ItsDrike | 70800ff0ab | ||
ItsDrike | a6eb7496f7 | ||
ItsDrike | 0403ff8fb4 |
|
@ -9,12 +9,12 @@ if [ -d "$HOME/.local/bin" ]; then
|
||||||
PATH+=":${$(find -L ~/.local/bin -type d | tr '\n' ':')%%:}"
|
PATH+=":${$(find -L ~/.local/bin -type d | tr '\n' ':')%%:}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# I'm using a greeter now, so the below is disabled.
|
||||||
# Start graphical session automatically on tty1 if Hyprland or startx is available
|
# Start graphical session automatically on tty1 if Hyprland or startx is available
|
||||||
if [ "$(tty)" = "/dev/tty1" ] && [ "$UID" != 0 ]; then
|
#if [ "$(tty)" = "/dev/tty1" ] && [ "$UID" != 0 ]; then
|
||||||
if command -v Hyprland >/dev/null; then
|
# if command -v Hyprland >/dev/null; then
|
||||||
! pidof -s Hyprland >/dev/null 2>&1 && Hyprland
|
# ! pidof -s Hyprland >/dev/null 2>&1 && Hyprland
|
||||||
elif command -v startx >/dev/null; then
|
# elif command -v startx >/dev/null; then
|
||||||
! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"
|
# ! pidof -s Xorg >/dev/null 2>&1 && exec startx "$XINITRC"
|
||||||
fi
|
# fi
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
|
|
|
@ -125,13 +125,13 @@ in
|
||||||
cursor = {
|
cursor = {
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "catppuccin-mocha-dark-cursors";
|
default = "BreezeX-RosePine-Linux";
|
||||||
description = "The name of the cursor inside the package";
|
description = "The name of the cursor inside the package";
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pkgs.catppuccin-cursors.mochaDark;
|
default = pkgs.rose-pine-cursor;
|
||||||
description = "The package providing the cursors";
|
description = "The package providing the cursors";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./login
|
||||||
./wayland
|
./wayland
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
6
system/roles/workstation/display/login/default.nix
Normal file
6
system/roles/workstation/display/login/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./greetd.nix
|
||||||
|
./pam.nix
|
||||||
|
];
|
||||||
|
}
|
58
system/roles/workstation/display/login/greetd.nix
Normal file
58
system/roles/workstation/display/login/greetd.nix
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) mkIf getExe;
|
||||||
|
inherit (lib.strings) concatStringsSep;
|
||||||
|
|
||||||
|
|
||||||
|
deviceType = config.myOptions.device.roles.type;
|
||||||
|
acceptedTypes = ["laptop" "desktop"];
|
||||||
|
|
||||||
|
sessionData = config.services.displayManager.sessionData.desktops;
|
||||||
|
sessionPaths = concatStringsSep ":" [
|
||||||
|
"${sessionData}/share/xsessions"
|
||||||
|
"${sessionData}/share/wayland-sessions"
|
||||||
|
];
|
||||||
|
|
||||||
|
defaultSession = {
|
||||||
|
user = "greeter";
|
||||||
|
command = concatStringsSep " " [
|
||||||
|
(getExe pkgs.greetd.tuigreet)
|
||||||
|
"--time"
|
||||||
|
"--remember"
|
||||||
|
"--remember-user-session"
|
||||||
|
"--asterisks"
|
||||||
|
"--sessions '${sessionPaths}'"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
config = mkIf (builtins.elem deviceType acceptedTypes) {
|
||||||
|
services.greetd = {
|
||||||
|
enable = true;
|
||||||
|
vt = 2;
|
||||||
|
|
||||||
|
# <https://man.sr.ht/~kennylevinsen/greetd/>
|
||||||
|
settings = {
|
||||||
|
# default session is what will be used if no session is selected
|
||||||
|
# in this case it'll be a TUI greeter
|
||||||
|
default_session = defaultSession;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Suppress error messages on tuigreet. They sometimes obscure the TUI
|
||||||
|
# boundaries of the greeter.
|
||||||
|
# See: https://github.com/apognu/tuigreet/issues/68#issuecomment-1586359960
|
||||||
|
systemd.services.greetd.serviceConfig = {
|
||||||
|
Type = "idle";
|
||||||
|
StandardInputs = "tty";
|
||||||
|
StandardOutput = "tty";
|
||||||
|
StandardError = "journal";
|
||||||
|
TTYReset = true;
|
||||||
|
TTYVHangup = true;
|
||||||
|
TTYVTDisallocate = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
31
system/roles/workstation/display/login/pam.nix
Normal file
31
system/roles/workstation/display/login/pam.nix
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{lib, config, ...}: let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
deviceType = config.myOptions.device.roles.type;
|
||||||
|
acceptedTypes = ["laptop" "desktop"];
|
||||||
|
in {
|
||||||
|
config = mkIf (builtins.elem deviceType acceptedTypes) {
|
||||||
|
# unlock GPG keyring on login
|
||||||
|
security.pam.services = let
|
||||||
|
gnupg = {
|
||||||
|
enable = true;
|
||||||
|
noAutostart = true;
|
||||||
|
storeOnly = true;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
login = {
|
||||||
|
enableGnomeKeyring = true;
|
||||||
|
inherit gnupg;
|
||||||
|
};
|
||||||
|
|
||||||
|
greetd = {
|
||||||
|
enableGnomeKeyring = true;
|
||||||
|
inherit gnupg;
|
||||||
|
};
|
||||||
|
|
||||||
|
tuigreet = {
|
||||||
|
enableGnomeKeyring = true;
|
||||||
|
inherit gnupg;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -4,6 +4,8 @@
|
||||||
./mount.nix
|
./mount.nix
|
||||||
./printing.nix
|
./printing.nix
|
||||||
./misc.nix
|
./misc.nix
|
||||||
|
./logind.nix
|
||||||
|
./gnome-keyring.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
20
system/roles/workstation/services/gnome-keyring.nix
Normal file
20
system/roles/workstation/services/gnome-keyring.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{pkgs, lib, config, ...}: let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
deviceType = config.myOptions.device.roles.type;
|
||||||
|
acceptedTypes = ["laptop" "desktop"];
|
||||||
|
in {
|
||||||
|
config = mkIf (builtins.elem deviceType acceptedTypes) {
|
||||||
|
services = {
|
||||||
|
udev.packages = with pkgs; [gnome.gnome-settings-daemon];
|
||||||
|
gnome.gnome-keyring.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# seahorse is an application for managing encryption keys
|
||||||
|
# and passwords in the gnome keyring
|
||||||
|
programs.seahorse.enable = true;
|
||||||
|
|
||||||
|
xdg.portal.config.common = {
|
||||||
|
"org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
18
system/roles/workstation/services/logind.nix
Normal file
18
system/roles/workstation/services/logind.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{lib, config, ...}: let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
deviceType = config.myOptions.device.roles.type;
|
||||||
|
acceptedTypes = ["laptop" "desktop"];
|
||||||
|
in {
|
||||||
|
config = mkIf (builtins.elem deviceType acceptedTypes) {
|
||||||
|
# despite being under logind, this has nothing to do with login
|
||||||
|
# it's about power management
|
||||||
|
services.logind = {
|
||||||
|
lidSwitch = "suspend-then-hibernate";
|
||||||
|
lidSwitchExternalPower = "lock";
|
||||||
|
extraConfig = ''
|
||||||
|
HandlePowerKey=suspend-then-hibernate
|
||||||
|
HibernateDelaySec=3600
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue