system/machines/home/default.nix

70 lines
1.4 KiB
Nix

{ config, pkgs, lib, ... }:
let
secrets = import ../../secrets.nix;
in
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
../common.nix
];
boot = {
# Use the GRUB 2 boot loader.
loader.grub = {
enable = true;
version = 2;
device = "/dev/sdb";
};
kernelPackages = pkgs.linuxPackages_latest;
extraModulePackages = with config.boot.kernelPackages; [
rtl88x2bu
];
};
networking = {
hostName = "home"; # Define your hostname.
inherit (secrets.networking) extraHosts;
interfaces = {
enp3s0.useDHCP = true;
wlp11s0f3u2.useDHCP = true;
};
};
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "cnijfilter2" ];
services = {
avahi = {
enable = true;
nssmdns = true;
};
printing = {
enable = true;
drivers = with pkgs; [ gutenprint cnijfilter2 ];
};
};
services.xserver = {
# All monitors in the right order
# Source: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/xserver.nix#L83
xrandrHeads = [
{
output = "HDMI-A-0";
monitorConfig = ''
Option "PreferredMode" "1920x1080"
Option "Rotate" "right"
'';
}
{
output = "DisplayPort-1";
primary = true;
monitorConfig = ''
Option "PreferredMode" "2560x1440"
'';
}
];
};
}