mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 06:19:00 +00:00
hosts/ni: modularize parts of the hardware setup
This commit is contained in:
parent
509ac5cdef
commit
3da9dc89fa
@ -26,6 +26,7 @@
|
||||
];
|
||||
|
||||
hosts.ni = {
|
||||
hardware.qol.enable = true;
|
||||
networking.setup = "networkmanager";
|
||||
networking.wireguard.enable = true;
|
||||
};
|
||||
|
@ -47,31 +47,10 @@
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault true;
|
||||
|
||||
# We're using some better filesystems so we're using it.
|
||||
boot.initrd.supportedFilesystems = [ "btrfs" ];
|
||||
boot.supportedFilesystems = [ "btrfs" ];
|
||||
|
||||
services.btrfs.autoScrub = {
|
||||
enable = true;
|
||||
fileSystems = [
|
||||
"/mnt/archives"
|
||||
];
|
||||
};
|
||||
|
||||
# Set up printers.
|
||||
services.printing = {
|
||||
enable = true;
|
||||
browsing = true;
|
||||
drivers = with pkgs; [
|
||||
gutenprint
|
||||
hplip
|
||||
splix
|
||||
];
|
||||
};
|
||||
|
||||
# Make your CPU more useful.
|
||||
services.auto-cpufreq.enable = true;
|
||||
|
||||
# Extend the life of an SSD.
|
||||
services.fstrim.enable = true;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
# Only optional modules should be imported here.
|
||||
{
|
||||
imports = [
|
||||
./hardware/qol.nix
|
||||
./networking/setup.nix
|
||||
./networking/wireguard.nix
|
||||
];
|
||||
|
33
hosts/ni/modules/hardware/qol.nix
Normal file
33
hosts/ni/modules/hardware/qol.nix
Normal file
@ -0,0 +1,33 @@
|
||||
# Some quality-of-life features for your hardware.
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
hostCfg = config.hosts.ni;
|
||||
cfg = hostCfg.hardware.qol;
|
||||
in
|
||||
{
|
||||
options.hosts.ni.hardware.qol.enable = lib.mkEnableOption "quality-of-life hardware features";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# We're using some better filesystems so we're using it.
|
||||
boot.initrd.supportedFilesystems = [ "btrfs" ];
|
||||
boot.supportedFilesystems = [ "btrfs" ];
|
||||
|
||||
# Set up printers.
|
||||
services.printing = {
|
||||
enable = true;
|
||||
browsing = true;
|
||||
drivers = with pkgs; [
|
||||
gutenprint
|
||||
hplip
|
||||
splix
|
||||
];
|
||||
};
|
||||
|
||||
# Make your CPU more useful.
|
||||
services.auto-cpufreq.enable = true;
|
||||
|
||||
# Extend the life of an SSD.
|
||||
services.fstrim.enable = true;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user