system/machines/home/default.nix

77 lines
1.6 KiB
Nix
Raw Normal View History

2022-09-11 19:14:43 +03:00
{ config, pkgs, lib, ... }:
2022-08-29 00:18:24 +03:00
let
2022-10-08 22:45:35 +03:00
secrets = import ../../secrets.nix;
2022-08-29 00:18:24 +03:00
in
{
2022-08-30 04:32:05 +03:00
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
2022-10-08 22:45:35 +03:00
../common.nix
2022-08-30 04:32:05 +03:00
];
2022-08-29 00:18:24 +03:00
boot = {
# Use the GRUB 2 boot loader.
loader.grub = {
enable = true;
version = 2;
2022-09-07 01:12:22 +03:00
device = "/dev/sdb";
2022-09-01 11:17:54 +03:00
dedsec-theme = {
enable = true;
style = "sitedown";
resolution = "1440p";
};
2022-08-29 00:18:24 +03:00
};
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;
};
};
2022-09-11 19:14:43 +03:00
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "cnijfilter2" ];
services = {
avahi = {
enable = true;
nssmdns = true;
};
printing = {
enable = true;
drivers = with pkgs; [ gutenprint cnijfilter2 ];
};
};
2022-08-29 00:18:24 +03:00
services.xserver = {
2022-08-29 16:09:59 +03:00
# All monitors in the right order
2022-08-31 13:23:54 +03:00
# Source: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/xserver.nix#L83
2022-08-29 00:18:24 +03:00
xrandrHeads = [
{
output = "HDMI-A-0";
monitorConfig = ''
2022-08-29 16:09:59 +03:00
Option "PreferredMode" "1920x1080"
2022-08-29 00:18:24 +03:00
Option "Rotate" "right"
2022-08-29 16:09:59 +03:00
'';
}
{
output = "DisplayPort-1";
primary = true;
monitorConfig = ''
Option "PreferredMode" "2560x1440"
2022-08-29 00:18:24 +03:00
'';
}
];
};
}