2023-03-31 17:40:22 +03:00
|
|
|
|
{ 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
|
2023-03-31 17:40:22 +03:00
|
|
|
|
../../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 = {
|
2023-03-31 17:40:22 +03:00
|
|
|
|
# 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;
|
|
|
|
|
device = "/dev/sdb";
|
2023-10-18 16:24:02 +03:00
|
|
|
|
# memtest86.enable = true;
|
2022-10-12 02:56:07 +03:00
|
|
|
|
};
|
|
|
|
|
|
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 = {
|
2023-10-18 16:24:02 +03:00
|
|
|
|
wlp3s0.useDHCP = true;
|
|
|
|
|
# wlp11s0f3u2.useDHCP = true;
|
2022-08-29 00:18:24 +03:00
|
|
|
|
};
|
2022-10-12 02:56:07 +03:00
|
|
|
|
|
|
|
|
|
networkmanager.enable = true;
|
2023-07-06 17:03:40 +03:00
|
|
|
|
firewall.allowedTCPPortRanges = [
|
|
|
|
|
{ from = 1300; to = 1400; }
|
|
|
|
|
];
|
2022-08-29 00:18:24 +03:00
|
|
|
|
};
|
|
|
|
|
|
2023-10-18 16:24:02 +03:00
|
|
|
|
# enable bluetooth
|
|
|
|
|
hardware.bluetooth.enable = true;
|
|
|
|
|
|
|
|
|
|
local.nix.allowUnfreePackages = [ "cnijfilter2" "memtest86" ];
|
2022-11-13 23:14:04 +03:00
|
|
|
|
|
2023-07-03 23:16:31 +03:00
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
|
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 = ''
|
|
|
|
|
# don’t 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;
|
2023-07-28 17:08:13 +03:00
|
|
|
|
ip = "10.20.30.3/24";
|
2023-03-02 16:00:19 +03:00
|
|
|
|
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
|
|
|
|
|
2023-11-30 14:16:42 +03:00
|
|
|
|
# Torrent client
|
2023-03-15 22:52:13 +03:00
|
|
|
|
services.transmission.enable = true;
|
2022-08-29 00:18:24 +03:00
|
|
|
|
}
|