refactor: further progress
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
metaLib = config.meta.lib;
|
||||
metaRepo = metaLib.repo;
|
||||
repo = config.repo;
|
||||
repoHelpers = repo.helpers;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.niri =
|
||||
@@ -31,11 +31,15 @@ in
|
||||
...
|
||||
}:
|
||||
let
|
||||
repoTheme = metaRepo.theme.kanagawa;
|
||||
browserCommand = metaRepo.desktop.browser.command;
|
||||
fileManagerPackage = metaLib.resolvePackagePath {
|
||||
repoTheme = repo.theme.kanagawa;
|
||||
browserCommand = repo.desktop.browser.command;
|
||||
fileManagerPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = metaRepo.desktop.fileManager.packagePath;
|
||||
path = repo.desktop.fileManager.packagePath;
|
||||
};
|
||||
terminalPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.terminal.packagePath;
|
||||
};
|
||||
outputs = lib.mapAttrs (
|
||||
_: display:
|
||||
@@ -51,19 +55,24 @@ in
|
||||
// lib.optionalAttrs (display.scale != null) {
|
||||
inherit (display) scale;
|
||||
}
|
||||
// lib.optionalAttrs (display.mode != null) {
|
||||
inherit (display) mode;
|
||||
// lib.optionalAttrs (display.width != null && display.height != null && display.refresh != null) {
|
||||
mode = {
|
||||
inherit (display)
|
||||
width
|
||||
height
|
||||
refresh
|
||||
;
|
||||
};
|
||||
}
|
||||
) config.meta.host.displays;
|
||||
inputProfiles = metaLib.mkInputProfiles config.meta.host.input;
|
||||
terminal = metaLib.resolveRepoTerminal {
|
||||
inherit pkgs;
|
||||
};
|
||||
) config.meta.machine.displays;
|
||||
in
|
||||
{
|
||||
assertions = metaLib.mkTerminalAssertions {
|
||||
inherit terminal;
|
||||
};
|
||||
assertions = [
|
||||
{
|
||||
assertion = fileManagerPackage != null;
|
||||
message = "Unknown file manager package `${lib.showAttrPath repo.desktop.fileManager.packagePath}`.";
|
||||
}
|
||||
];
|
||||
|
||||
home.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
@@ -138,27 +147,22 @@ in
|
||||
|
||||
input = {
|
||||
focus-follows-mouse.enable = true;
|
||||
mouse."accel-speed" = 0.4;
|
||||
keyboard = {
|
||||
repeat-delay = 300;
|
||||
repeat-rate = 50;
|
||||
xkb.options = "caps:escape";
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs (inputProfiles.niri.mouse != { }) {
|
||||
mouse = inputProfiles.niri.mouse;
|
||||
}
|
||||
// lib.optionalAttrs (inputProfiles.niri.touchpad != { }) {
|
||||
touchpad = inputProfiles.niri.touchpad;
|
||||
};
|
||||
|
||||
binds =
|
||||
if terminal.hasPackage then
|
||||
if terminalPackage != null then
|
||||
import ./_bindings.nix {
|
||||
inherit
|
||||
browserCommand
|
||||
lib
|
||||
;
|
||||
terminalPackage = terminal.package;
|
||||
terminalPackage = terminalPackage;
|
||||
}
|
||||
else
|
||||
{ };
|
||||
|
||||
Reference in New Issue
Block a user