Starting to break out for different XPS systems
This commit is contained in:
7
system/boot.nix
Normal file
7
system/boot.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
}
|
||||
14
system/default.nix
Normal file
14
system/default.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./boot.nix
|
||||
./networking.nix
|
||||
./locale.nix
|
||||
./services.nix
|
||||
./packages.nix
|
||||
./users.nix
|
||||
./nix.nix
|
||||
./programs.nix
|
||||
];
|
||||
}
|
||||
21
system/locale.nix
Normal file
21
system/locale.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Set your time zone.
|
||||
time.timeZone = "America/Chicago";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "en_US.UTF-8";
|
||||
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||
LC_MEASUREMENT = "en_US.UTF-8";
|
||||
LC_MONETARY = "en_US.UTF-8";
|
||||
LC_NAME = "en_US.UTF-8";
|
||||
LC_NUMERIC = "en_US.UTF-8";
|
||||
LC_PAPER = "en_US.UTF-8";
|
||||
LC_TELEPHONE = "en_US.UTF-8";
|
||||
LC_TIME = "en_US.UTF-8";
|
||||
};
|
||||
}
|
||||
6
system/networking.nix
Normal file
6
system/networking.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
networking.hostName = "abra"; # Define your hostname.
|
||||
networking.networkmanager.enable = true;
|
||||
}
|
||||
12
system/nix.nix
Normal file
12
system/nix.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It's perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "25.05"; # Did you read the comment?
|
||||
}
|
||||
71
system/packages.nix
Normal file
71
system/packages.nix
Normal file
@@ -0,0 +1,71 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Install firefox.
|
||||
programs.firefox.enable = true;
|
||||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||
alacritty
|
||||
|
||||
# Wayland and Sway essentials
|
||||
sway
|
||||
xdg-desktop-portal-wlr
|
||||
xdg-desktop-portal-gtk
|
||||
wofi
|
||||
swaylock
|
||||
swayidle
|
||||
# Additional packages for SDDM compatibility
|
||||
qt5.qtwayland
|
||||
qt6.qtwayland
|
||||
|
||||
polkit # policy kit
|
||||
ffmpeg # media player / encoding
|
||||
xdg-utils # desktop integration tools
|
||||
vivaldi
|
||||
|
||||
nodejs_22
|
||||
code-cursor-fhs
|
||||
jq
|
||||
zellij
|
||||
bibata-cursors
|
||||
podman
|
||||
podman-compose
|
||||
yazi
|
||||
wget
|
||||
];
|
||||
|
||||
fonts = {
|
||||
enableDefaultPackages = true;
|
||||
packages = with pkgs; [
|
||||
# Nerd Fonts - individual packages
|
||||
nerd-fonts.jetbrains-mono
|
||||
nerd-fonts.fira-code
|
||||
nerd-fonts.sauce-code-pro # Source Code Pro equivalent
|
||||
nerd-fonts.dejavu-sans-mono
|
||||
|
||||
# Additional fonts for fallbacks
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-emoji
|
||||
liberation_ttf
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
];
|
||||
|
||||
fontconfig = {
|
||||
enable = true;
|
||||
defaultFonts = {
|
||||
monospace = [ "JetBrainsMono Nerd Font" "Fira Code" ];
|
||||
sansSerif = [ "Noto Sans" "Liberation Sans" ];
|
||||
serif = [ "Noto Serif" "Liberation Serif" ];
|
||||
emoji = [ "Noto Color Emoji" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
33
system/programs.nix
Normal file
33
system/programs.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable Sway at system level (required for SDDM to detect it)
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
wrapperFeatures.gtk = true;
|
||||
};
|
||||
|
||||
# Enable Xwayland for compatibility
|
||||
programs.xwayland.enable = true;
|
||||
|
||||
# Environment variables for Wayland
|
||||
environment.variables = {
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
XDG_CURRENT_DESKTOP = "sway";
|
||||
QT_QPA_PLATFORM = "wayland";
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
_JAVA_AWT_WM_NONREPARENTING = "1";
|
||||
# Additional Wayland environment variables
|
||||
GDK_BACKEND = "wayland,x11";
|
||||
CLUTTER_BACKEND = "wayland";
|
||||
};
|
||||
|
||||
# Ensure Wayland sessions are properly registered
|
||||
environment.sessionVariables = {
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
XDG_CURRENT_DESKTOP = "sway";
|
||||
};
|
||||
|
||||
# Enable other useful programs
|
||||
programs.light.enable = true;
|
||||
}
|
||||
26
system/services-gdm.nix
Normal file
26
system/services-gdm.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Alternative configuration using GDM instead of SDDM
|
||||
# Uncomment this and comment out SDDM in services.nix if SDDM doesn't work
|
||||
|
||||
# Enable GDM display manager (alternative to SDDM)
|
||||
services.displayManager.gdm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
settings = {
|
||||
daemon = {
|
||||
WaylandEnable = true;
|
||||
};
|
||||
security = {
|
||||
DisallowTCP = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Autologin configuration for GDM
|
||||
services.displayManager.autoLogin = {
|
||||
enable = true;
|
||||
user = "jared";
|
||||
};
|
||||
}
|
||||
78
system/services.nix
Normal file
78
system/services.nix
Normal file
@@ -0,0 +1,78 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable CUPS to print documents.
|
||||
services.printing.enable = true;
|
||||
|
||||
# Enable sound with pipewire.
|
||||
services.pulseaudio.enable = false;
|
||||
security.rtkit.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
# If you want to use JACK applications, uncomment this
|
||||
#jack.enable = true;
|
||||
|
||||
# use the example session manager (no others are packaged yet so this is enabled by default,
|
||||
# no need to redefine it in your config for now)
|
||||
#media-session.enable = true;
|
||||
};
|
||||
|
||||
# Enable X11 server (required for some applications and SDDM compatibility)
|
||||
services.xserver.enable = true;
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
X11Forwarding = true;
|
||||
PermitRootLogin = "no"; # no root
|
||||
PasswordAuthentication = false; # no passwords
|
||||
};
|
||||
};
|
||||
|
||||
# Enable SDDM display manager with proper Wayland support
|
||||
services.displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = true;
|
||||
settings = {
|
||||
General = {
|
||||
DisplayServer = "wayland";
|
||||
GreeterEnvironment = "QT_WAYLAND_SHELL_INTEGRATION=layer-shell";
|
||||
Numlock = "on";
|
||||
HaltCommand = "/run/current-system/systemd/bin/systemctl poweroff";
|
||||
RebootCommand = "/run/current-system/systemd/bin/systemctl reboot";
|
||||
InputMethod = "";
|
||||
};
|
||||
Autologin = {
|
||||
User = "jared";
|
||||
Session = "sway";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Libinput configuration for both X11 and Wayland
|
||||
services.libinput = {
|
||||
enable = true;
|
||||
touchpad = {
|
||||
naturalScrolling = true;
|
||||
disableWhileTyping = true; # Optional: Palm rejection
|
||||
};
|
||||
mouse = {
|
||||
naturalScrolling = true;
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Security and session management
|
||||
security.polkit.enable = true;
|
||||
|
||||
# Ensure proper seat management for Wayland
|
||||
services.seatd = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
14
system/users.nix
Normal file
14
system/users.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Define a user account. Don't forget to set a password with 'passwd'.
|
||||
users.users.jared = {
|
||||
isNormalUser = true;
|
||||
description = "Jared";
|
||||
extraGroups = [ "networkmanager" "wheel" "video" "input" "audio" "docker" "seat" "render" ];
|
||||
# Set initial password (user should change this after first login)
|
||||
initialPassword = "changeme";
|
||||
packages = with pkgs; [
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user