refactor: restructure config files
This commit is contained in:
@@ -0,0 +1,168 @@
|
||||
{
|
||||
inputs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
repo = config.repo;
|
||||
repoHelpers = repo.helpers;
|
||||
in
|
||||
{
|
||||
flake.modules.nixos.niri =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [ inputs.niri.nixosModules.niri ];
|
||||
nixpkgs.overlays = [ inputs.niri.overlays.niri ];
|
||||
|
||||
programs.niri.enable = true;
|
||||
programs.niri.package = pkgs.niri-unstable;
|
||||
programs.dconf.enable = true;
|
||||
|
||||
services.gvfs.enable = true;
|
||||
services.udisks2.enable = true;
|
||||
xdg.portal.enable = true;
|
||||
};
|
||||
|
||||
flake.modules.homeManager.niri =
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
osConfig,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
repoTheme = repo.theme.kanagawa;
|
||||
browserCommand = repo.desktop.browser.command;
|
||||
fileManagerPackage = repoHelpers.resolvePackagePath {
|
||||
inherit pkgs;
|
||||
path = repo.desktop.fileManager.packagePath;
|
||||
};
|
||||
terminalCommand = config.repo.terminal.primary.command;
|
||||
outputs = lib.mapAttrs (
|
||||
_: display:
|
||||
{
|
||||
position = {
|
||||
x = display.x;
|
||||
y = display.y;
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs (display.primary or false) {
|
||||
"focus-at-startup" = true;
|
||||
}
|
||||
// lib.optionalAttrs (display.scale != null) {
|
||||
inherit (display) scale;
|
||||
}
|
||||
// lib.optionalAttrs (display.width != null && display.height != null && display.refresh != null) {
|
||||
mode = {
|
||||
inherit (display)
|
||||
width
|
||||
height
|
||||
refresh
|
||||
;
|
||||
};
|
||||
}
|
||||
) osConfig.meta.machine.displays;
|
||||
in
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion = fileManagerPackage != null;
|
||||
message = "Unknown file manager package `${lib.showAttrPath repo.desktop.fileManager.packagePath}`.";
|
||||
}
|
||||
];
|
||||
|
||||
home.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
dconf.settings = {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = "prefer-dark";
|
||||
};
|
||||
};
|
||||
|
||||
home.packages =
|
||||
with pkgs;
|
||||
[
|
||||
playerctl
|
||||
brightnessctl
|
||||
xwayland-satellite
|
||||
]
|
||||
++ [ fileManagerPackage ];
|
||||
|
||||
programs.niri.settings = {
|
||||
inherit outputs;
|
||||
environment.DISPLAY = ":0";
|
||||
spawn-at-startup = [
|
||||
{ command = [ "xwayland-satellite" ]; }
|
||||
{ command = [ "noctalia-shell" ]; }
|
||||
];
|
||||
prefer-no-csd = true;
|
||||
hotkey-overlay.skip-at-startup = true;
|
||||
screenshot-path = "${config.xdg.userDirs.pictures}/screenshots/%Y-%m-%dT%H:%M:%S.png";
|
||||
|
||||
animations.slowdown = 0.6;
|
||||
|
||||
cursor = with config.home.pointerCursor; {
|
||||
size = size;
|
||||
theme = name;
|
||||
hide-after-inactive-ms = 3000;
|
||||
hide-when-typing = true;
|
||||
};
|
||||
|
||||
layout = {
|
||||
always-center-single-column = true;
|
||||
gaps = 14;
|
||||
focus-ring.enable = false;
|
||||
|
||||
default-column-width.proportion = 1. / 2.;
|
||||
|
||||
border = {
|
||||
enable = true;
|
||||
width = 3;
|
||||
active.color = repoTheme.palette.niri.border.active;
|
||||
inactive.color = repoTheme.palette.niri.border.inactive;
|
||||
urgent.color = repoTheme.palette.niri.border.urgent;
|
||||
};
|
||||
};
|
||||
|
||||
window-rules = [
|
||||
{
|
||||
geometry-corner-radius =
|
||||
let
|
||||
radius = 10.0;
|
||||
in
|
||||
{
|
||||
bottom-left = radius;
|
||||
bottom-right = radius;
|
||||
top-left = radius;
|
||||
top-right = radius;
|
||||
};
|
||||
clip-to-geometry = true;
|
||||
}
|
||||
];
|
||||
|
||||
debug.honor-xdg-activation-with-invalid-serial = true;
|
||||
|
||||
input = {
|
||||
focus-follows-mouse.enable = true;
|
||||
mouse."accel-speed" = 0.4;
|
||||
keyboard = {
|
||||
repeat-delay = 300;
|
||||
repeat-rate = 50;
|
||||
xkb.options = "caps:escape";
|
||||
};
|
||||
|
||||
touchpad = {
|
||||
dwt = true;
|
||||
};
|
||||
};
|
||||
|
||||
binds = import ./_bindings.nix {
|
||||
inherit
|
||||
browserCommand
|
||||
terminalCommand
|
||||
;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user