164 lines
4.3 KiB
Nix
164 lines
4.3 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
inputs,
|
|
outputs,
|
|
pkgs,
|
|
timeZone,
|
|
system,
|
|
...
|
|
}:
|
|
let
|
|
supportedDesktops = [ "niri" ];
|
|
supportedDesktopsStr = lib.strings.concatStringsSep ", " supportedDesktops;
|
|
deskCfg = config.deskCfg;
|
|
in
|
|
{
|
|
options.deskCfg = {
|
|
de = lib.mkOption {
|
|
default = "niri";
|
|
type = lib.types.str;
|
|
description = "Desktop Environment";
|
|
};
|
|
userName = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = "Main username for system";
|
|
};
|
|
hostName = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = "Hostname for system";
|
|
};
|
|
installGaming = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = true;
|
|
description = "Whether to install gaming software or not";
|
|
};
|
|
};
|
|
|
|
imports = [
|
|
modules/user/main_user.nix
|
|
modules/niri/niri_conf.nix
|
|
../shared/modules/system/power_manager.nix
|
|
../shared/modules/system/noctalia-system.nix
|
|
];
|
|
|
|
config = {
|
|
assertions = [
|
|
{
|
|
assertion = builtins.elem deskCfg.de supportedDesktops;
|
|
message = "Unsupported desktop environment: ${deskCfg.de}\nSupported DE's: ${supportedDesktopsStr}";
|
|
}
|
|
];
|
|
|
|
nixpkgs.overlays = [
|
|
inputs.nur.overlays.default
|
|
];
|
|
|
|
# Intel graphics acceleration (Framework 12)
|
|
hardware.graphics.enable = true;
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
# Enable flakes feature
|
|
nix.settings.experimental-features = [
|
|
"nix-command"
|
|
"flakes"
|
|
];
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
boot = {
|
|
plymouth = {
|
|
enable = true;
|
|
theme = "kiki-pixel"; # Options: "kiki" (waifu2x upscaled) or "kiki-pixel" (pixel art)
|
|
themePackages = [
|
|
(pkgs.runCommand "plymouth-kiki-theme" { } ''
|
|
mkdir -p $out/share/plymouth/themes/kiki
|
|
cp -r ${./kiki-plymouth-theme/kiki}/* $out/share/plymouth/themes/kiki/
|
|
substituteInPlace $out/share/plymouth/themes/kiki/kiki.plymouth \
|
|
--replace-fail "@IMAGEDIR@" "$out/share/plymouth/themes/kiki"
|
|
'')
|
|
(pkgs.runCommand "plymouth-kiki-pixel-theme" { } ''
|
|
mkdir -p $out/share/plymouth/themes/kiki-pixel
|
|
cp -r ${./kiki-plymouth-theme/kiki-pixel}/* $out/share/plymouth/themes/kiki-pixel/
|
|
substituteInPlace $out/share/plymouth/themes/kiki-pixel/kiki-pixel.plymouth \
|
|
--replace-fail "@IMAGEDIR@" "$out/share/plymouth/themes/kiki-pixel"
|
|
'')
|
|
];
|
|
};
|
|
|
|
# Enable systemd in initrd for better LUKS unlocking with Plymouth
|
|
initrd.systemd.enable = true;
|
|
|
|
# Enable "Silent Boot"
|
|
consoleLogLevel = 0;
|
|
initrd.verbose = false;
|
|
kernelParams = [
|
|
"quiet"
|
|
"splash"
|
|
"boot.shell_on_fail"
|
|
"loglevel=3"
|
|
"rd.systemd.show_status=false"
|
|
"rd.udev.log_level=3"
|
|
"udev.log_priority=3"
|
|
];
|
|
# Hide the OS choice for bootloaders.
|
|
loader.timeout = 0;
|
|
# Use the systemd-boot EFI boot loader.
|
|
loader.systemd-boot.enable = true;
|
|
loader.efi.canTouchEfiVariables = true;
|
|
# Use latest kernel packages
|
|
kernelPackages = pkgs.linuxPackages_latest;
|
|
};
|
|
|
|
networking.hostName = deskCfg.hostName;
|
|
networking.networkmanager.enable = true;
|
|
networking.wireless.iwd.enable = true;
|
|
|
|
time.timeZone = timeZone;
|
|
|
|
main_user = {
|
|
enable = true;
|
|
userName = deskCfg.userName;
|
|
isDesktopUser = true;
|
|
};
|
|
|
|
power_manager = {
|
|
enable = true;
|
|
backend = "power-profiles-daemon"; # Required for Noctalia power profile widget
|
|
};
|
|
|
|
# Enable Noctalia shell system services
|
|
noctaliaSystem.enable = true;
|
|
|
|
niriwm = {
|
|
enable = true;
|
|
useNonFree = true;
|
|
user = deskCfg.userName;
|
|
installGaming = deskCfg.installGaming;
|
|
systemPackages = with pkgs; [
|
|
libreoffice
|
|
];
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
cryptsetup
|
|
];
|
|
|
|
programs.niri.enable = true;
|
|
# For electron apps in wayland
|
|
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
|
|
|
services.greetd = {
|
|
enable = true;
|
|
settings = rec {
|
|
initial_session = {
|
|
command = "${pkgs.niri}/bin/niri-session";
|
|
user = deskCfg.userName;
|
|
};
|
|
default_session = initial_session;
|
|
};
|
|
};
|
|
|
|
system.stateVersion = "23.11";
|
|
};
|
|
}
|