refactor: move some of wim's configs to module folder

This commit is contained in:
matt1432 2023-10-15 17:27:57 -04:00
parent 9942d9a0bc
commit 7005fc441d
5 changed files with 54 additions and 93 deletions

View file

@ -1,6 +1,9 @@
{ pkgs, ... }: {
services = {
fwupd.enable = true;
upower.enable = true;
locate = {
enable = true;
package = pkgs.mlocate;

View file

@ -1,54 +0,0 @@
{ pkgs, ... }:
{
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
# enable brightness control for swayosd
programs.light.enable = true;
services = {
udev.extraRules = ''
# give permanent path to keyboard XF86* binds
SUBSYSTEMS=="input", ATTRS{id/product}=="0006", ATTRS{id/vendor}=="0000", SYMLINK += "video-bus"
# give permanent path to touchpad
SUBSYSTEMS=="input", ATTRS{id/product}=="01e0", ATTRS{id/vendor}=="27c6", ATTRS{name}=="GXTP5140:00 27C6:01E0 Touchpad", SYMLINK += "touchpad"
'';
fwupd.enable = true;
# Enable CUPS to print documents.
printing = {
enable = true;
drivers = with pkgs; [
hplip
];
};
pipewire = {
enable = true;
alsa.enable = true;
jack.enable = true;
pulse.enable = true;
};
upower.enable = true;
};
hardware = {
pulseaudio.enable = false;
sensor.iio.enable = true;
opengl.enable = true;
opengl.driSupport32Bit = true;
uinput.enable = true;
};
virtualisation = {
libvirtd.enable = true;
waydroid.enable = true;
};
}

View file

@ -3,7 +3,6 @@
{
imports = [
./boot.nix
./extra-hardware.nix
./security.nix
./packages.nix
];

View file

@ -1,13 +1,19 @@
{ pkgs, ... }:
{ lib, ... }:
{
imports = [
./hardware-configuration.nix
../../modules/audio.nix
../../modules/kmscon.nix
../../modules/printer.nix
./cfg/main.nix
./home/main.nix
];
networking = {
useDHCP = lib.mkDefault true;
hostName = "wim";
networkmanager = {
enable = true;
@ -18,14 +24,6 @@
# Set your time zone.
time.timeZone = "America/Montreal";
services.kmscon = {
enable = true;
hwRender = true;
# FIXME: https://github.com/Aetf/kmscon/issues/18 // Icons not rendering properly
# FIXME: https://github.com/Aetf/kmscon/issues/56 // Mouse cursor stays
extraOptions = "--font-size 12.5 --font-dpi 170 --font-name 'JetBrainsMono Nerd Font'";
};
# 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

View file

@ -1,40 +1,55 @@
# 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, modulesPath, ... }:
{
{ config, modulesPath, ... }: {
nixpkgs.hostPlatform = "x86_64-linux";
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
boot = {
initrd = {
availableKernelModules = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" ];
luks.devices."root".device = "/dev/disk/by-uuid/ab82b477-2477-453f-b95f-28e5553ad10d";
};
kernelModules = [ "kvm-amd" ];
};
fileSystems."/" = {
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/6ae4d722-dacf-485a-8d29-b276f540dc91";
fsType = "btrfs";
};
boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/ab82b477-2477-453f-b95f-28e5553ad10d";
fileSystems."/boot" = {
"/boot" = {
device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat";
};
swapDevices = [ ];
};
zramSwap.enable = true;
hardware = {
cpu.amd.updateMicrocode = config.hardware.enableRedistributableFirmware;
# 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.enp7s0f4u2.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp6s0.useDHCP = lib.mkDefault true;
sensor.iio.enable = true;
opengl.enable = true;
opengl.driSupport32Bit = true;
uinput.enable = true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
bluetooth = {
enable = true;
powerOnBoot = true;
};
};
virtualisation = {
libvirtd.enable = true;
waydroid.enable = true;
};
# enable brightness control for swayosd
programs.light.enable = true;
services.udev.extraRules = ''
# give permanent path to keyboard XF86* binds
SUBSYSTEMS=="input", ATTRS{id/product}=="0006", ATTRS{id/vendor}=="0000", SYMLINK += "video-bus"
# give permanent path to touchpad
SUBSYSTEMS=="input", ATTRS{id/product}=="01e0", ATTRS{id/vendor}=="27c6", ATTRS{name}=="GXTP5140:00 27C6:01E0 Touchpad", SYMLINK += "touchpad"
'';
}