Add laptop host

This commit is contained in:
muon 2024-09-30 08:38:12 +00:00
parent e73f27a94c
commit 7ad646f580
8 changed files with 317 additions and 88 deletions

View file

@ -0,0 +1,123 @@
{ config, lib, pkgs, inputs, system, ... }:
let cfg = config.mods;
in {
# Hardware
imports = [ ./hardware-configuration.nix ];
environment.systemPackages = with inputs.nix-alien.packages.${system};
[ nix-alien ];
# System
mods.user.name = "muon";
networking.hostName = "muop";
mods.home.file = ./home.nix;
# Modules
mods.desktop.enable = true;
mods.desktop.wayland.enable = false;
mods.desktop.gaming.enable = true;
mods.boot.enable = false;
mods.theme.enable = true;
mods.theme.scheme = "woodland";
mods.theme.wallpaper = ./wallpaper.png;
mods.containers.steam.enable = false;
mods.server.media.enable = false;
mods.server.astral.enable = false;
mods.server.astral.autoStart = false;
mods.docker.media.enable = false;
mods.server.sync.enable = true;
mods.tailscale.enable = false;
mods.openvpn.enable = false;
mods.wireguard.enable = false;
services.xserver.windowManager.i3.enable = true;
# Proprietary </3
mods.unfree.steam.enable = true;
mods.unfree.nvidia.enable = true;
mods.unfree.minecraft.enable = false;
services.flatpak.enable = true;
# Hardware preferences
boot = {
tmp.cleanOnBoot = true;
bootspec.enable = true;
consoleLogLevel = 0;
kernelParams =
[ "cgroup_no_v1=all" "systemd.unified_cgroup_hierarchy=yes" ];
initrd.verbose = false;
loader = {
systemd-boot.enable = true;
systemd-boot.editor = false;
efi.canTouchEfiVariables = true;
timeout = 1;
};
};
# environment.variables = {
# # GDK_SCALE = "2";
# # XCURSOR_SIZE = "24";
# };
hardware = {
opengl = {
enable = true;
driSupport32Bit = true;
extraPackages = with pkgs; [ vaapiVdpau libvdpau-va-gl ];
};
nvidia = {
open = false;
modesetting.enable = true;
nvidiaSettings = true;
forceFullCompositionPipeline = true;
powerManagement.enable = true;
prime = {
sync.enable = true;
# offload = {
# enable = true;
# enableOffloadCmd = true;
# };
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
pulseaudio.support32Bit = true;
};
xdg.portal = {
enable = true;
wlr.enable = false;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
## Mouse
services.libinput.mouse.accelProfile = "flat";
## Monitors
mods.monitors = {
primary = {
name = "eDP-1";
config = {
enable = true;
mode = "1920x1080";
position = "0x0";
primary = true;
rate = "60.00";
};
};
};
# Version of first install
system.stateVersion = "23.05";
}

View file

@ -0,0 +1,50 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-uuid/29b32abb-ea5d-4cca-b506-3485d8df430c";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-57f71aee-059c-4ae1-8859-89cfcb21a4af".device =
"/dev/disk/by-uuid/57f71aee-059c-4ae1-8859-89cfcb21a4af";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/9094-4224";
fsType = "vfat";
};
fileSystems."/mnt/bulk" = {
device = "/dev/disk/by-uuid/a5a0a375-9dc3-43e6-9e1d-9431d502dbfa";
fsType = "ext4";
};
swapDevices = [{
device = "/var/lib/swapfile";
size = 8 * 1024;
}];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

52
hosts/muop/home.nix Normal file
View file

@ -0,0 +1,52 @@
{ pkgs, lib, osConfig,... }:
let cfg = osConfig.mods; in {
# Modules
mods.xdg.enable = true;
mods.social.enable = true;
mods.i3.enable = true;
mods.terminal.zsh.enable = true;
mods.terminal.emulator.enable = true;
mods.terminal.development.enable = true;
mods.terminal.tools.enable = true;
mods.desktop.development.enable = true;
mods.desktop.productivity.enable = true;
mods.desktop.media.enable = true;
# Hardware preferences
## Monitors
xsession.windowManager.i3.config.workspaceOutputAssign = [{
workspace = "1";
output = "${cfg.monitors.primary.name}";
}];
services.autorandr.enable = true;
programs.autorandr = {
enable = true;
hooks.postswitch = {
"notify-i3" = "${pkgs.i3}/bin/i3-msg restart";
"set-wallpaper" = ''
${lib.getExe pkgs.feh} --bg-fill --nofehbg ${./wallpaper.png}
'';
};
profiles.default = {
fingerprint = {
"${cfg.monitors.primary.name}" = "00ffffffffffff0030e4190500000000001a01049522137803a1c59459578f27205054000000010101010101010101010101010101012e3680a070381f403020350058c210000019222480a070381f403020350058c210000019000000fd00283c43430e010a20202020202000000002000c47ff0a3c6e1f182b6e000000001c";
};
config = {
"${cfg.monitors.primary.name}" =
cfg.monitors.primary.config;
};
};
};
# wayland.windowManager.hyprland.settings = {
# monitor = [
# "DP-2,2560x1440@144,0x480,1"
# "HDMI-A-2,1920x1080,2560x0,1,transform,3"
# ];
# input.sensitivity = -0.4;
# };
# Version of first install
home.stateVersion = "23.05";
}

BIN
hosts/muop/wallpaper.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB