feat: add new wayland compositor - niri

This commit is contained in:
Ryan Yin
2025-08-18 21:44:18 +08:00
parent 09fbea3f77
commit 69eee64e7e
52 changed files with 333 additions and 89 deletions

View File

@@ -14,17 +14,26 @@ let
# Shoukei (祥瓊, Shōkei)
name = "shoukei";
base-modules = {
nixos-modules = map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/desktop.nix"
# host specific
"hosts/12kingdoms-${name}"
# nixos hardening
# "hardening/profiles/default.nix"
"hardening/nixpaks"
"hardening/bwraps"
];
nixos-modules =
(map mylib.relativeToRoot [
# common
"secrets/nixos.nix"
"modules/nixos/desktop.nix"
# host specific
"hosts/12kingdoms-${name}"
# nixos hardening
# "hardening/profiles/default.nix"
"hardening/nixpaks"
"hardening/bwraps"
])
++ [
{
modules.desktop.fonts.enable = true;
modules.desktop.wayland.enable = true;
modules.secrets.desktop.enable = true;
modules.secrets.preservation.enable = true;
}
];
home-modules = map mylib.relativeToRoot [
# common
"home/linux/gui.nix"
@@ -35,14 +44,6 @@ let
modules-hyprland = {
nixos-modules = [
{
modules.desktop.wayland.enable = true;
modules.secrets.desktop.enable = true;
modules.secrets.preservation.enable = true;
# TODO: remove this option
nixpkgs.config.allowUnsupportedSstem = true;
}
]
++ base-modules.nixos-modules;
home-modules = [
@@ -50,15 +51,29 @@ let
]
++ base-modules.home-modules;
};
modules-niri = {
nixos-modules = [
inputs.niri.nixosModules.niri
{ programs.niri.enable = true; }
]
++ base-modules.nixos-modules;
home-modules = [
{ modules.desktop.niri.enable = true; }
]
++ base-modules.home-modules;
};
in
{
nixosConfigurations = {
# host with hyprland compositor
"${name}-hyprland" = mylib.nixosSystem (modules-hyprland // args);
"${name}-niri" = mylib.nixosSystem (modules-niri // args);
};
# generate iso image for hosts with desktop environment
packages = {
"${name}-hyprland" = inputs.self.nixosConfigurations."${name}-hyprland".config.formats.iso;
"${name}-niri" = inputs.self.nixosConfigurations."${name}-niri".config.formats.iso;
};
}