system: extract shared configuration from host configs
Extract duplicated configuration from gunter and magicman into shared system modules. This eliminates ~116 lines of duplication and fixes a malformed gdm.wayland config in magicman. New shared modules: - boot.nix: systemd-boot, EFI, common kernel params - networking.nix: NetworkManager, nftables, firewall base - hyprland.nix: System-level Hyprland and display manager - xdg.nix: XDG session variables and portal setup - nix-config.nix: Nix daemon settings, binary caches, trusted users - nixpkgs-config.nix: allowUnfree and kernel packages default Updated modules: - locale.nix: Added timezone configuration Benefits: - Reduces duplication: net reduction of 53 lines - Magicman gains custom cache substituters for faster builds - Fixes malformed gdm.wayland config in magicman - Both hosts use identical base configuration - Host-specific config clearly stands out Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,24 +8,13 @@
|
||||
|
||||
# Bootloader stuff
|
||||
boot.kernelParams = [
|
||||
"quiet"
|
||||
"splash"
|
||||
"rd.systemd.show_status=false"
|
||||
"acpi_backlight=native"
|
||||
"video=efifb:nobgrt"
|
||||
"loglevel=3"
|
||||
"rd.udev.log_level=3"
|
||||
];
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
boot.loader.systemd-boot = {
|
||||
enable = true;
|
||||
configurationLimit = 3;
|
||||
};
|
||||
|
||||
boot.loader.efi = {
|
||||
canTouchEfiVariables = true;
|
||||
};
|
||||
boot.loader.systemd-boot.configurationLimit = 3;
|
||||
|
||||
boot.initrd.systemd.enable = true;
|
||||
boot.plymouth = {
|
||||
@@ -39,14 +28,6 @@
|
||||
|
||||
# Networking stuff
|
||||
networking.hostName = "magicman"; # Define your hostname.
|
||||
networking.networkmanager.enable = true;
|
||||
networking.nftables.enable = true;
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Set time stuff
|
||||
time.timeZone = "Europe/Oslo";
|
||||
|
||||
hardware = {
|
||||
enableRedistributableFirmware = true;
|
||||
@@ -80,58 +61,11 @@
|
||||
};
|
||||
};
|
||||
|
||||
# Setup hyprland
|
||||
services.xserver.enable = true;
|
||||
services.displayManager.gdm.wayland = {
|
||||
gdm.wayland = true;
|
||||
lightdm.enable = false;
|
||||
};
|
||||
programs.hyprland = {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
xwayland.enable = true;
|
||||
portalPackage = pkgs.xdg-desktop-portal-hyprland;
|
||||
};
|
||||
|
||||
# TRIM
|
||||
services.fstrim.enable = true;
|
||||
|
||||
# Setup common XDG env vars
|
||||
environment.sessionVariables = rec {
|
||||
XDG_CACHE_HOME = "$HOME/.cache";
|
||||
XDG_CONFIG_HOME = "$HOME/.config";
|
||||
XDG_DATA_HOME = "$HOME/.local/share";
|
||||
XDG_STATE_HOME = "$HOME/.local/state";
|
||||
XDG_BIN_HOME = "$HOME/.local/bin";
|
||||
PATH = [ "${XDG_BIN_HOME}" ];
|
||||
};
|
||||
|
||||
# Setup xdg portal
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
extraPortals = (
|
||||
with pkgs;
|
||||
[
|
||||
# xdg-desktop-portal-hyprland
|
||||
xdg-desktop-portal-gtk
|
||||
]
|
||||
);
|
||||
};
|
||||
|
||||
programs.steam.enable = true;
|
||||
|
||||
# Enable flakes
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
nix.settings.trusted-users = [
|
||||
"root"
|
||||
"torjus"
|
||||
];
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
# Install system-wide packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
|
||||
Reference in New Issue
Block a user