system/nixos/hosts/home/default.nix

110 lines
2.3 KiB
Nix
Raw Normal View History

{ config, pkgs, ... }:
2022-08-29 00:18:24 +03:00
{
2022-08-30 04:32:05 +03:00
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
2023-03-18 16:47:02 +03:00
../../shared/common.nix
../../shared/sound.nix
../../shared/window-manager.nix
../../shared/fonts.nix
../../shared/gnupg.nix
../../shared/garbage-collector.nix
../../shared/networking.secret.nix
../../shared/ipfs.nix
2022-08-30 04:32:05 +03:00
];
2022-08-29 00:18:24 +03:00
2022-10-12 02:56:07 +03:00
# Configure kernel
2022-08-29 00:18:24 +03:00
boot = {
# I cannot use rtl88x2bu driver in stable
kernelPackages = pkgs.unstable.linuxPackages_6_1;
2022-08-29 00:18:24 +03:00
extraModulePackages = with config.boot.kernelPackages; [
rtl88x2bu
];
};
2022-10-12 02:56:07 +03:00
# Use the GRUB 2 boot loader.
boot.loader.grub = {
enable = true;
version = 2;
device = "/dev/sdb";
};
2022-08-29 00:18:24 +03:00
networking = {
hostName = "home"; # Define your hostname.
2022-10-12 02:56:07 +03:00
useDHCP = false;
2022-08-29 00:18:24 +03:00
interfaces = {
enp3s0.useDHCP = true;
wlp11s0f3u2.useDHCP = true;
};
2022-10-12 02:56:07 +03:00
networkmanager.enable = true;
2022-08-29 00:18:24 +03:00
};
2022-11-13 23:14:04 +03:00
local.nix.allowUnfreePackages = [ "cnijfilter2" ];
2022-09-11 19:14:43 +03:00
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 = [
{
2023-03-17 11:56:38 +03:00
output = "HDMI-1";
2022-08-29 00:18:24 +03:00
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
'';
}
{
2023-03-17 11:56:38 +03:00
output = "DP-1";
2022-08-29 16:09:59 +03:00
primary = true;
monitorConfig = ''
Option "PreferredMode" "2560x1440"
2022-08-29 00:18:24 +03:00
'';
}
];
};
2022-10-12 02:56:07 +03:00
2023-03-03 13:36:30 +03:00
services.logind.extraConfig = ''
# dont shutdown when power button is short-pressed
HandlePowerKey=ignore
'';
2022-10-12 02:56:07 +03:00
# Enable the Docker
virtualisation.docker.enable = true;
2022-10-13 07:47:31 +03:00
2023-03-02 16:00:19 +03:00
# Additional nix configs
2022-10-13 07:47:31 +03:00
local.nix.enableMyRegistry = true;
2023-03-02 16:00:19 +03:00
# Wireguard client
age.secrets.wireguard-home-private = {
2023-03-18 16:47:02 +03:00
file = ../../../secrets/wireguard-home-private.age;
2023-03-02 16:00:19 +03:00
mode = "0400";
};
local.wireguard = {
enable = true;
ip = "10.100.0.2/24";
privateKeyFile = config.age.secrets.wireguard-home-private.path;
};
2023-03-15 10:49:52 +03:00
# Invisible internet project
services.i2pd = {
enable = true;
proto.httpProxy.enable = true;
proto.http.enable = true;
};
2023-03-15 22:52:13 +03:00
services.transmission.enable = true;
2022-08-29 00:18:24 +03:00
}