221 lines
5.6 KiB
Nix
221 lines
5.6 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 = "";
|
|
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";
|
|
};
|
|
fullName = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "User";
|
|
description = "Full display name for the user";
|
|
};
|
|
};
|
|
|
|
imports = [
|
|
../shared/modules/user/main_user.nix
|
|
modules/niri/niri_conf.nix
|
|
modules/colemak-ec.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}";
|
|
}
|
|
];
|
|
|
|
# Stylix theming
|
|
stylix = {
|
|
enable = true;
|
|
# image = ./wallpaper.png;
|
|
|
|
# Check with `nix build nixpkgs#base16-schemes && ls result/share/themes`
|
|
base16Scheme = "${pkgs.base16-schemes}/share/themes/kimber.yaml";
|
|
polarity = "dark";
|
|
|
|
# System-wide cursor
|
|
cursor = {
|
|
package = pkgs.bibata-cursors;
|
|
name = "Bibata-Modern-Classic";
|
|
size = 32;
|
|
};
|
|
|
|
# Fonts
|
|
fonts = {
|
|
serif = {
|
|
package = pkgs.lato;
|
|
name = "Lato";
|
|
};
|
|
sansSerif = {
|
|
package = pkgs.lato;
|
|
name = "Lato";
|
|
};
|
|
monospace = {
|
|
package = pkgs.maple-mono.NF;
|
|
name = "Maple Mono NF";
|
|
};
|
|
emoji = {
|
|
package = pkgs.noto-fonts-color-emoji;
|
|
name = "Noto Color Emoji";
|
|
};
|
|
sizes = {
|
|
applications = 14;
|
|
desktop = 12;
|
|
popups = 12;
|
|
terminal = 16;
|
|
};
|
|
};
|
|
|
|
# Icon theme for tray applets (nm-applet, etc.)
|
|
iconTheme = {
|
|
enable = true;
|
|
package = pkgs.papirus-icon-theme;
|
|
light = "Papirus-Light";
|
|
dark = "Papirus-Dark";
|
|
};
|
|
|
|
# Keep custom Framework plymouth theme
|
|
targets.plymouth.enable = false;
|
|
};
|
|
|
|
nixpkgs.overlays = [
|
|
inputs.nur.overlays.default
|
|
];
|
|
|
|
# Intel graphics acceleration
|
|
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 = "framework";
|
|
themePackages = [
|
|
(pkgs.runCommand "plymouth-framework-theme" { } ''
|
|
mkdir -p $out/share/plymouth/themes/framework
|
|
cp -r ${./framework-plymouth-theme/framework}/* $out/share/plymouth/themes/framework/
|
|
substituteInPlace $out/share/plymouth/themes/framework/framework.plymouth \
|
|
--replace-fail "@IMAGEDIR@" "$out/share/plymouth/themes/framework"
|
|
# substituteInPlace $out/share/plymouth/themes/framework/framework.script \
|
|
# --replace-fail "@IMAGEDIR@" "$out/share/plymouth/themes/framework"
|
|
'')
|
|
];
|
|
};
|
|
|
|
# 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.
|
|
# It's still possible to open the bootloader list by pressing any key
|
|
# It will just not appear on screen unless a key is pressed
|
|
loader.timeout = 1;
|
|
# 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; # Define your hostname.
|
|
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
|
networking.wireless.iwd.enable = true;
|
|
|
|
time.timeZone = timeZone;
|
|
|
|
main_user = {
|
|
enable = true;
|
|
userName = deskCfg.userName;
|
|
fullName = deskCfg.fullName;
|
|
isDesktopUser = true;
|
|
extraGroups = [ "corectrl" "dialout" "docker" ];
|
|
};
|
|
|
|
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;
|
|
systemPackages = with pkgs; [
|
|
libreoffice
|
|
rpi-imager
|
|
];
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
cryptsetup
|
|
cage
|
|
];
|
|
|
|
programs.niri.enable = true;
|
|
# For electron apps in wayland
|
|
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
|
|
|
# auto write colemak-dh to keyboard ec
|
|
colemakEc.enable = true;
|
|
|
|
services.greetd = {
|
|
enable = true;
|
|
settings = rec {
|
|
initial_session = {
|
|
command = "${pkgs.niri}/bin/niri-session";
|
|
user = "nate";
|
|
};
|
|
default_session = initial_session;
|
|
};
|
|
};
|
|
|
|
# For yubioath desktop
|
|
services.pcscd.enable = true;
|
|
system.stateVersion = "25.05"; # Did you read the comment?
|
|
};
|
|
}
|