Skip to content

Commit

Permalink
dump cage, use river instead
Browse files Browse the repository at this point in the history
  • Loading branch information
0x5a4 committed Nov 26, 2024
1 parent 63ad70b commit 4080343
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 12 deletions.
1 change: 1 addition & 0 deletions host/fword/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
enable = true;
command = "wayfire";
defaultUser = "makrele";
output = "eDP-1";
};

programs.steam.enable = true;
Expand Down
1 change: 1 addition & 0 deletions host/yesmachine/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
enable = true;
defaultUser = "makrele";
command = "Hyprland";
output = "HDMI-A-1";
};

programs.steam.enable = true;
Expand Down
44 changes: 32 additions & 12 deletions mod/nixos/services/greetd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@
t = lib.types;
in
{
enable = lib.mkEnableOption "enable avahi/mdns service";
enable = lib.mkEnableOption "enable greetd";
defaultUser = lib.mkOption {
description = "user to log in as";
type = t.str;
type = t.nonEmptyStr;
};
command = lib.mkOption {
description = "command to run on login";
type = t.str;
type = t.nonEmptyStr;
};
output = lib.mkOption {
description = "output to show the greeter on";
type = t.nullOr t.nonEmptyStr;
default = null;
};
};

Expand All @@ -34,22 +39,37 @@
url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/97444e18b7fe97705e8caedd29ae05e62cb5d4b7/wallpapers/nixos-wallpaper-catppuccin-macchiato.png";
hash = "sha256-SkXrLbHvBOItJ7+8vW+6iXV+2g0f8bUJf9KcCXYOZF0=";
};
greeterCommand = pkgs.writeScriptBin "greeter.sh" ''
export XKB_DEFAULT_LAYOUT=de
export XKB_DEFAULT_VARIANT=nodeadkeys
export XKB_DEFAULT_OPTION=caps:escape
riverConfig = pkgs.writeScriptBin "greeter.river.init.sh" ''
riverctl="${lib.getExe' pkgs.river "riverctl"}"
$riverctl keyboard-layout \
-variant nodeadkeys \
-options caps:escape \
de
$riverctl rule-add fullscreen
${lib.optionalString (opts.output != null) ''
$riverctl rule-add output "${opts.output}"
''}
$riverctl hide-cursor timeout 1
$riverctl hide-cursor when-typing enabled
${pkgs.cage}/bin/cage -s -m last -- \
${pkgs.greetd-mini-wl-greeter}/bin/greetd-mini-wl-greeter \
$riverctl default-layout rivertile
${lib.getExe' pkgs.river "rivertile"} &
${lib.getExe pkgs.swaybg} -mfill -i ${backgroundImage} &
${lib.getExe pkgs.greetd-mini-wl-greeter} \
--user ${opts.defaultUser} \
--command ${opts.command} \
--background-image ${backgroundImage}
$riverctl exit
'';
in
{
default_session = {
command = "${greeterCommand}/bin/greeter.sh";
};
default_session.command = "${lib.getExe' pkgs.river "river"} -c ${lib.getExe riverConfig}";
};
};
};
Expand Down
1 change: 1 addition & 0 deletions pkgs/greetd-mini-wl-greeter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ stdenv.mkDerivation (finalAttrs: {
description = "Extremely minimal raw Wayland greeter for greetd";
homepage = "https://github.com/philj56/greetd-mini-wl-greeter";
license = lib.licenses.mit;
mainProgram = "greetd-mini-wl-greeter";
};
})

0 comments on commit 4080343

Please sign in to comment.