Skip to content

Commit

Permalink
Enable ReGreet & Plymouth.
Browse files Browse the repository at this point in the history
  • Loading branch information
attilaolah committed Mar 4, 2024
1 parent f96767a commit 5251a0e
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 16 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ Other notable repos:

- [nixinator/nothing]
- [sjcobb2022/nixos-config]
- [n3oney/nixus]
- [khaneliman/khanelinix]
- [stephenreynolds/nix-config]

[nixinator/nothing]: https://github.com/nixinator/nothing
[sjcobb2022/nixos-config]: https://github.com/sjcobb2022/nixos-config
[n3oney/nixus]: https://github.com/n3oney/nixus
[khaneliman/khanelinix]: https://github.com/khaneliman/khanelinix
[stephenreynolds/nix-config]: https://github.com/stephenreynolds/nix-config

See also [this comment][2], on how to use the config, or how to build it, even
for remote targets. Mind. Blown. 🤯
Expand Down
1 change: 1 addition & 0 deletions hosts/home/boot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

{
boot = {
plymouth.enable = true;
kernelModules = [ "kvm-intel" ];
kernelParams = [ "ip=192.168.0.2::192.168.0.1:255.255.255.0:home::none" ];
blacklistedKernelModules = [ "radeon" ];
Expand Down
1 change: 1 addition & 0 deletions hosts/home/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
imports = [
./boot.nix
./file_systems.nix
./fonts.nix
./hardware.nix
./networking.nix
./programs.nix
Expand Down
30 changes: 30 additions & 0 deletions hosts/home/fonts.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{ config, lib, pkgs, ... }:

{
fonts = {
enableDefaultPackages = false;

fontconfig = {
enable = true;
defaultFonts = {
sansSerif = ["Inter"];
serif = ["Roboto Serif"];
monospace = ["TwilioSansM Nerd Font"];
emoji = ["JoyPixels"];
};
};

packages = with pkgs; [
hack-font
inter
joypixels
nerdfonts
noto-fonts
noto-fonts-cjk
roboto
roboto-serif
];
};

nixpkgs.config.joypixels.acceptLicense = true;
}
20 changes: 20 additions & 0 deletions hosts/home/hyprland/greet.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# GREET Hyprland config.
# Used when showing the login screen.

animations:enabled = false
general:cursor_inactive_timeout = 10

decoration {
blur:enabled = false
drop_shadow = false
rounding = 0
}

misc {
disable_autoreload = true
disable_splash_rendering = true
force_default_wallpaper = 0
background_color = 0x000000
mouse_move_enables_dpms = true
key_press_enables_dpms = true
}
12 changes: 12 additions & 0 deletions hosts/home/hyprland/input.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Input confg.

input {
# Keyboard:
numlock_by_default = true
# Others are included directly in the .nix config.

# Mouse:
follow_mouse = 1
touchpad:natural_scroll = no
sensitivity = 0
}
19 changes: 19 additions & 0 deletions hosts/home/hyprland/monitors.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Monitor layout:
# ╔═══╗ ╔═══╗
# ║ L ║╔═══════╗║ D ║
# ║ E ║║ S A M ║║ E ║
# ║ N ║╚═══════╝║ L ║
# ╚═══╝ ╚═══╝
$mon_r = desc:Dell Inc. DELL P2720DC 81WTK01K1SFS
$mon_l = desc:Lenovo Group Limited P27h-20 V906V9HY
$mon_c = desc:Samsung Electric Company U32J59x HNMW200264

monitor = $mon_l, 2560x1440@60, 0x0, 1, transform, 1
monitor = $mon_r, 2560x1440@60, 5280x0, 1, transform, 3
monitor = $mon_c, 3840x2160@60, 1440x200, 1

workspace = 1, monitor:$mon_l, default:true
workspace = 3, monitor:$mon_r, default:true
workspace = 2, monitor:$mon_c, default:true

exec = hyprctl dispatch focusmonitor $mon_c
3 changes: 2 additions & 1 deletion hosts/home/programs.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
programs = {
fish.enable = true;
hyprland.enable = true;
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
regreet.enable = true;
hyprland.enable = true;
};
}
34 changes: 29 additions & 5 deletions hosts/home/services.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
{ inputs, pkgs, ... }:
{ config, inputs, lib, pkgs, ... }:

let
tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet";
hyprland-session = "${inputs.hyprland.packages.${pkgs.system}.hyprland}/share/wayland-sessions";
regreet = lib.getExe config.programs.regreet.package;
hyprland = inputs.hyprland.packages.${pkgs.system}.hyprland;
hyprland-keyboard = ''
input {
kb_layout = ${config.services.xserver.xkb.layout}
kb_variant = ${config.services.xserver.xkb.variant}
kb_options = ${config.services.xserver.xkb.options}
}
'';

# 1st Hyperland only runs "command" (regreet) and exits.
# ReGreet itself will then run a second session with the user's config.
hyprland-greet = "${hyprland}/bin/Hyprland --config ${pkgs.writeText "hyprland.greet.conf" ''
${(builtins.readFile ./hyprland/greet.conf)}
${(builtins.readFile ./hyprland/input.conf)}
${(builtins.readFile ./hyprland/monitors.conf)}
${hyprland-keyboard}
exec-once = ${regreet} -l debug; ${hyprland}/bin/hyprctl dispatch exit
''}";

in {
services = {
blueman.enable = true;
Expand All @@ -21,14 +39,20 @@ in {
xserver.xkb = {
layout = "us";
variant = "dvp";
options = "caps:escape,compose:ralt,keypad:atm,kpdl:semi,numpad:shift3";
options = (lib.concatStringsSep "," [
"caps:escape"
"compose:ralt"
"keypad:atm"
"kpdl:semi"
"numpad:shift3"
]);
};

greetd = {
enable = true;
settings = {
default_session = {
command = "${tuigreet} --time --remember --remember-session --sessions ${hyprland-session}";
command = hyprland-greet;
user = "greeter";
};
};
Expand Down
14 changes: 4 additions & 10 deletions users/ao/src/_.config/hypr/hyprland.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,24 @@ workspace = 2, monitor:$mon_c, default:true

exec = hyprctl dispatch focusmonitor $mon_c

# Execute at launch
exec-once = waybar

# Set programs that you use
$menu = wofi --show run
$terminal = foot
$browser = google-chrome-stable --enable-unsafe-webgpu

# Some default env vars.
env = XCURSOR_SIZE,24

# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
input {
kb_layout = us
kb_variant = dvp
kb_options = caps:escape,compose:ralt,keypad:atm,kpdl:semi,numpad:shift3
kb_model =
kb_rules =
numlock_by_default = true

follow_mouse = 1
# Focus follow gets annoying with three displays,
# especially when the middle one is the one I used the most.
follow_mouse = 0

touchpad {
natural_scroll = no
natural_scroll = no
}
sensitivity = 0
}
Expand Down

0 comments on commit 5251a0e

Please sign in to comment.