257 lines
6.1 KiB
Nix
257 lines
6.1 KiB
Nix
{
|
|
inputs,
|
|
lib,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
unstable = import inputs.nixpkgs-unstable {
|
|
system = "x86_64-linux";
|
|
config.allowUnfree = true;
|
|
};
|
|
in
|
|
{
|
|
options.niriwm = {
|
|
enable = lib.mkEnableOption "Enable niri window manager.";
|
|
useNonFree = lib.mkOption {
|
|
default = false;
|
|
example = true;
|
|
description = "Whether to enable non-free software in the niri config";
|
|
};
|
|
installGaming = lib.mkOption {
|
|
default = false;
|
|
example = true;
|
|
description = "Whether to install gaming software on the system.";
|
|
};
|
|
systemPackages = lib.mkOption {
|
|
default = [ ];
|
|
description = "Add any additional packages desired. Merged with niri defaults.";
|
|
};
|
|
user = lib.mkOption {
|
|
type = lib.types.str;
|
|
};
|
|
};
|
|
|
|
###
|
|
## Configuration
|
|
###
|
|
config = lib.mkIf config.niriwm.enable {
|
|
|
|
nixpkgs.config.allowUnfree = config.niriwm.useNonFree;
|
|
|
|
###
|
|
## XDG portal setup
|
|
###
|
|
xdg.portal = {
|
|
config = {
|
|
common = {
|
|
default = [
|
|
"wlr"
|
|
];
|
|
};
|
|
};
|
|
extraPortals = with pkgs; [
|
|
xdg-desktop-portal-gnome
|
|
];
|
|
wlr.enable = true;
|
|
enable = true;
|
|
};
|
|
xdg.sounds.enable = true;
|
|
|
|
###
|
|
## System Packages
|
|
###
|
|
environment.systemPackages =
|
|
with pkgs;
|
|
lib.lists.flatten [
|
|
[
|
|
bash
|
|
egl-wayland
|
|
# foot is in programs.nix for Stylix theming
|
|
git
|
|
glib # gsettings
|
|
grim
|
|
kanshi
|
|
libnotify
|
|
lxqt.lxqt-policykit
|
|
man-pages
|
|
man-pages-posix
|
|
nautilus
|
|
networkmanagerapplet
|
|
nwg-drawer
|
|
pavucontrol
|
|
slurp
|
|
swaylock
|
|
swayosd
|
|
syncthingtray
|
|
unstable.ghostty
|
|
unstable.xwayland-satellite
|
|
# waybar is in programs.nix for Stylix theming
|
|
wdisplays
|
|
wl-clipboard
|
|
# wofi is in programs.nix for Stylix theming
|
|
xdg-utils
|
|
zsh
|
|
]
|
|
config.niriwm.systemPackages
|
|
];
|
|
environment.variables.QT_STYLE_OVERRIDE = "kvantum";
|
|
environment.sessionVariables = {
|
|
# use wayland
|
|
MOZ_ENABLE_WAYLAND = "1";
|
|
T_QPA_PLATFORM = "wayland";
|
|
GDK_BACKEND = "wayland";
|
|
WLR_NO_HARDWARE_CURSORS = "1";
|
|
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
|
NIXOS_OZONE_WL = "1";
|
|
# VA-API driver for hardware video acceleration (Intel 13th gen)
|
|
LIBVA_DRIVER_NAME = "iHD";
|
|
};
|
|
|
|
# adds additional man pages
|
|
documentation.dev.enable = true;
|
|
|
|
programs.gamemode = {
|
|
enable = true;
|
|
settings = {
|
|
general = {
|
|
reaper_freq = 5;
|
|
desiredgov = "performance";
|
|
softrealtime = "auto";
|
|
};
|
|
};
|
|
};
|
|
programs.kdeconnect.enable = true;
|
|
programs.niri.enable = true;
|
|
programs.regreet.enable = true;
|
|
programs.xfconf.enable = true;
|
|
programs.zsh.enable = true;
|
|
programs.ssh.startAgent = false; # Using GNOME Keyring's gcr-ssh-agent instead
|
|
programs.steam.enable = config.niriwm.installGaming;
|
|
|
|
# For nautilus
|
|
services.gnome.sushi.enable = true;
|
|
programs.nautilus-open-any-terminal = {
|
|
enable = true;
|
|
terminal = "ghostty";
|
|
};
|
|
|
|
services.syncthing = {
|
|
enable = true;
|
|
dataDir = "/home/${config.niriwm.user}/.syncthing";
|
|
openDefaultPorts = true;
|
|
user = config.niriwm.user;
|
|
};
|
|
systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; # Don't create default ~/Sync folder
|
|
|
|
# Set zsh as the default shell system-wide
|
|
users.defaultUserShell = pkgs.zsh;
|
|
environment.shells = with pkgs; [
|
|
zsh
|
|
bash
|
|
];
|
|
|
|
###
|
|
## Services
|
|
###
|
|
services.blueman.enable = true;
|
|
services.gvfs.enable = true; # file manager mount, trash, etc
|
|
services.tumbler.enable = true; # thumbnails
|
|
services.openssh.enable = true;
|
|
services.dbus.enable = true;
|
|
services.gnome.gnome-keyring.enable = true;
|
|
services.flatpak.enable = true;
|
|
services.usbmuxd.enable = false;
|
|
|
|
# For yubioath desktop
|
|
services.pcscd.enable = true;
|
|
|
|
# Printing
|
|
services.printing = {
|
|
enable = true;
|
|
browsing = true;
|
|
drivers = [ pkgs.brlaser ];
|
|
};
|
|
|
|
# Audio - Modern PipeWire setup for Framework laptop
|
|
# Disable PulseAudio in favor of PipeWire
|
|
services.pulseaudio.enable = false;
|
|
security.rtkit.enable = true;
|
|
services.pipewire = {
|
|
enable = true;
|
|
audio.enable = true;
|
|
alsa.enable = true;
|
|
alsa.support32Bit = true;
|
|
pulse.enable = true;
|
|
wireplumber.enable = true;
|
|
wireplumber.extraConfig = {
|
|
"wireplumber.settings" = {
|
|
bluetooth.autoswitch-to-headset-profile = false;
|
|
};
|
|
bluetoothEnhancements = {
|
|
"monitor.bluez.properties" = {
|
|
"bluez5.enable-sbc-xq" = true;
|
|
"bluez5.enable-msbc" = true;
|
|
"bluez5.enable-hw-volume" = true;
|
|
# Default roles
|
|
"bluez5.roles" = [
|
|
"a2dp_sink"
|
|
"a2dp_source"
|
|
"bap_sink"
|
|
"bap_source"
|
|
"hfp_hf"
|
|
"hfp_ag"
|
|
];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
###
|
|
## Misc
|
|
###
|
|
# Necessary for home-manager niri setup
|
|
security.polkit.enable = true;
|
|
|
|
# Keyring setup
|
|
security.pam.services.greetd.enableGnomeKeyring = true;
|
|
security.pam.services.login.enableGnomeKeyring = true;
|
|
|
|
hardware.bluetooth = {
|
|
enable = true;
|
|
powerOnBoot = true;
|
|
settings = {
|
|
General = {
|
|
Name = "Jaci-Frame";
|
|
ControllerMode = "dual";
|
|
FastConnectable = "true";
|
|
Experimental = "true";
|
|
};
|
|
Policy = {
|
|
AutoEnable = "true";
|
|
};
|
|
LE = {
|
|
EnableAdvMonInterleaveScan = 1;
|
|
};
|
|
};
|
|
};
|
|
|
|
#
|
|
# Hardware scanning support
|
|
#
|
|
hardware.sane = {
|
|
enable = true;
|
|
brscan5.enable = true;
|
|
};
|
|
|
|
#
|
|
# udev rules
|
|
#
|
|
services.udev.extraRules = ''
|
|
# For ddcutil monitor controls
|
|
KERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660"
|
|
'';
|
|
};
|
|
}
|