added stuff
This commit is contained in:
parent
937f28770d
commit
236b8c2a6b
907 changed files with 70990 additions and 0 deletions
7
nyx/modules/core/roles/graphical/default.nix
Normal file
7
nyx/modules/core/roles/graphical/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
imports = [
|
||||
./system
|
||||
];
|
||||
|
||||
system.nixos.tags = ["graphical"];
|
||||
}
|
8
nyx/modules/core/roles/graphical/system/default.nix
Normal file
8
nyx/modules/core/roles/graphical/system/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
imports = [
|
||||
./security
|
||||
./services
|
||||
|
||||
./environment.nix
|
||||
];
|
||||
}
|
6
nyx/modules/core/roles/graphical/system/environment.nix
Normal file
6
nyx/modules/core/roles/graphical/system/environment.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
environment.variables = {
|
||||
# open links with the default browser
|
||||
BROWSER = "firefox";
|
||||
};
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
imports = [
|
||||
./polkit.nix
|
||||
];
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
# enable polkit for privilege escalation
|
||||
security.polkit.enable = true;
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
imports = [
|
||||
./login
|
||||
|
||||
./xserver.nix
|
||||
];
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
imports = [
|
||||
./greetd.nix
|
||||
./logind.nix
|
||||
./pam.nix
|
||||
./session.nix
|
||||
];
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.strings) concatStringsSep;
|
||||
inherit (lib.meta) getExe;
|
||||
|
||||
env = config.modules.usrEnv;
|
||||
sys = config.modules.system;
|
||||
|
||||
# make desktop session paths available to greetd
|
||||
sessionData = config.services.xserver.displayManager.sessionData.desktops;
|
||||
sessionPaths = concatStringsSep ":" [
|
||||
"${sessionData}/share/xsessions"
|
||||
"${sessionData}/share/wayland-sessions"
|
||||
];
|
||||
|
||||
initialSession = {
|
||||
user = "${sys.mainUser}";
|
||||
command = "${env.desktop}";
|
||||
};
|
||||
|
||||
defaultSession = {
|
||||
user = "greeter";
|
||||
command = concatStringsSep " " [
|
||||
(getExe pkgs.greetd.tuigreet)
|
||||
"--time"
|
||||
"--remember"
|
||||
"--remember-user-session"
|
||||
"--asterisks"
|
||||
"--sessions '${sessionPaths}'"
|
||||
];
|
||||
};
|
||||
in {
|
||||
services.greetd = {
|
||||
enable = true;
|
||||
vt = 2;
|
||||
restart = !sys.autoLogin;
|
||||
|
||||
# <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;
|
||||
|
||||
# initial session
|
||||
initial_session = mkIf sys.autoLogin initialSession;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
# 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
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
# 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;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
|
||||
env = config.modules.usrEnv;
|
||||
in {
|
||||
# adding dessktop items to the environment is generally handled by the programs' respective
|
||||
# nixos modules, however, to unify the desktop interface I prefer handling them manually
|
||||
# and ignoring the nixos modules entirely.
|
||||
services.xserver.displayManager = {
|
||||
startx.enable = true;
|
||||
session = [
|
||||
(mkIf env.desktops.i3.enable {
|
||||
name = "i3wm";
|
||||
manage = "desktop";
|
||||
start = ''
|
||||
${pkgs.xorg.xinit}/bin/startx ${pkgs.i3-rounded}/bin/i3 -- vt2 &
|
||||
waitPID=$!
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
config = {
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager.gdm.enable = false;
|
||||
displayManager.lightdm.enable = false;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue