Skip to content

Commit

Permalink
Move Hyprland config to its own dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
attilaolah committed Mar 4, 2024
1 parent 5251a0e commit fe267b1
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 30 deletions.
16 changes: 7 additions & 9 deletions hosts/home/boot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,18 @@
"usbhid"
"xhci_pci"
];
luks.devices = {
crypta = {
device = "/dev/nvme0n1"; # 2T
allowDiscards = true;
preLVM = true;
};
cryptb = {
# 2T NVMe SSD.
device = "/dev/nvme1n1"; # 2T
luks.devices = let
luksDev = ctrl: {
device = "/dev/nvme${toString ctrl}n1"; # 2T
allowDiscards = true;
preLVM = true;
};
in {
crypta = (luksDev 0); # 2T
cryptb = (luksDev 1); # 2T
};
services.lvm.enable = true;

# Start SSH during boot, to allow remote unlocking of LUKS volumes.
network.ssh = {
enable = true;
Expand Down
1 change: 1 addition & 0 deletions hosts/home/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
./networking.nix
./programs.nix
./services.nix
./services/xserver/xkb.nix
./systemd.nix
./users.nix
];
Expand Down
29 changes: 8 additions & 21 deletions hosts/home/services.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ let
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}
}
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}
${(builtins.readFile ../../hyprland/input.conf)}
${(builtins.readFile ../../hyprland/monitors.conf)}
${(builtins.readFile ../../hyprland/greet.conf)}
exec-once = ${regreet} -l debug; ${hyprland}/bin/hyprctl dispatch exit
''}";

Expand All @@ -35,19 +35,6 @@ in {
};
};

# Only used on the virtual console.
xserver.xkb = {
layout = "us";
variant = "dvp";
options = (lib.concatStringsSep "," [
"caps:escape"
"compose:ralt"
"keypad:atm"
"kpdl:semi"
"numpad:shift3"
]);
};

greetd = {
enable = true;
settings = {
Expand Down
18 changes: 18 additions & 0 deletions hosts/home/services/xserver/xkb.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{ lib, ... }:

let
kvJoin = attrs: (lib.concatStringsSep "," (lib.mapAttrsToList (k: v: "${k}:${v}") attrs));

in {
services.xserver.xkb = {
layout = "us";
variant = "dvp";
options = (kvJoin {
caps = "escape";
compose = "ralt";
keypad = "atm";
kpdl = "semi";
numpad = "shift3";
});
};
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit fe267b1

Please sign in to comment.