nixos-config/petalius.nix

135 lines
3.2 KiB
Nix
Raw Normal View History

2017-08-28 17:19:07 +00:00
{ config, pkgs, ... }:
{
imports =
[
2020-07-14 14:47:09 +00:00
./common-headless.nix
2020-07-15 09:48:32 +00:00
./sway.nix
2017-08-28 17:19:07 +00:00
./large-sw.nix
./uefi.nix
./fstrim.nix
2019-04-04 08:34:49 +00:00
./atmega.nix
2017-08-28 17:19:07 +00:00
];
environment.etc."lvm/lvm.conf".text = ''
devices {
issue_discards = 1
}
'';
2020-05-23 16:58:07 +00:00
boot.initrd.luks.devices = {
nvme0n1p2 = {
2017-08-28 17:19:07 +00:00
device = "/dev/disk/by-uuid/5ca3d7ec-3f9e-4a08-8bc2-b26bfc3459c5";
preLVM = true;
allowDiscards = true;
2020-05-23 16:58:07 +00:00
};
};
2017-08-28 17:19:07 +00:00
services.xserver = {
2017-09-02 07:41:48 +00:00
dpi = 120;
2017-08-28 17:19:07 +00:00
libinput.enable = true;
config = ''
Section "InputClass"
Identifier "touchpad"
Driver "libinput"
MatchDevicePath "/dev/input/event*"
MatchIsPointer "true"
EndSection
'';
videoDrivers = [ "modesetting" ];
useGlamor = true;
};
programs.light.enable = true;
services.tlp.enable = true;
networking.hostName = "petalius";
networking.hostId = "cf58caa9";
2017-11-14 15:44:21 +00:00
# systemd.services.ModemManager = {
# enable = true;
# wantedBy = [ "multi-user.target" ];
# };
2017-08-28 17:19:07 +00:00
hardware.opengl.extraPackages = [ pkgs.vaapiIntel ];
nixpkgs.config.packageOverrides = pkgs: rec {
};
environment.systemPackages = with pkgs; [
unison
];
virtualisation.docker = {
enable = true;
storageDriver = "overlay2";
};
2019-07-17 16:05:54 +00:00
users.extraUsers.gebner.extraGroups = [ "docker" "libvirtd" "video" "input" "dialout" ];
2018-11-04 14:37:01 +00:00
virtualisation.libvirtd.enable = true;
2017-08-28 17:19:07 +00:00
2019-02-12 13:39:55 +00:00
virtualisation.virtualbox.host.enable = true;
2017-08-28 17:19:07 +00:00
2020-05-23 16:58:07 +00:00
# boot.kernelPackages = pkgs.lib.mkOverride 10 pkgs.linuxPackages_5_5;
2019-07-17 16:11:18 +00:00
# boot.kernelPackages = pkgs.lib.mkOverride 10 pkgs.linuxPackages_4_19;
2017-08-28 21:31:53 +00:00
boot.kernelPatches = [
# { patch = ./len0073.patch; name = "len0073"; }
2017-08-28 21:31:53 +00:00
];
boot.kernelParams = [
# "psmouse.synaptics_intertouch=1"
"psmouse.proto=imps"
2017-08-28 21:31:53 +00:00
];
boot.kernelModules = [
"rmi_smbus"
"i2c_hid"
"psmouse"
2017-08-28 21:31:53 +00:00
];
2017-08-28 17:19:07 +00:00
2019-08-06 10:30:21 +00:00
# time.timeZone = pkgs.lib.mkOverride 10 "Asia/Tokyo";
2019-09-09 17:17:26 +00:00
# time.timeZone = pkgs.lib.mkOverride 10 "Europe/London";
2019-11-21 08:28:11 +00:00
# time.timeZone = pkgs.lib.mkOverride 10 "Europe/Lisbon";
2020-01-16 13:45:33 +00:00
# time.timeZone = pkgs.lib.mkOverride 10 "US/Eastern";
2017-08-28 17:19:07 +00:00
#services.avahi.nssmdns = true;
system.stateVersion = "18.03";
2018-05-22 19:15:31 +00:00
2018-09-01 13:40:10 +00:00
networking.wireguard.interfaces.wg0 = {
ips = ["10.59.0.2/16"];
privateKeyFile = "/etc/wgkeys/petalius";
allowedIPsAsRoutes = true;
2018-09-03 13:43:01 +00:00
postSetup = ''
2019-10-14 09:03:14 +00:00
${pkgs.systemd}/bin/resolvectl domain wg0 '~htdf.gebner.org' '~mtlaa.gebner.org' '~ams.gebner.org'
2019-10-03 10:30:33 +00:00
${pkgs.systemd}/bin/resolvectl dns wg0 10.58.0.1
2018-09-03 13:43:01 +00:00
'';
2018-09-01 13:40:10 +00:00
peers = [{
publicKey = "ByLlJbevlTBooAo2RIZGGJvBHKqA9qiOpHBvR5yuJX4=";
allowedIPs = ["10.56.0.0/14" "10.60.1.1"];
2019-10-03 10:30:33 +00:00
# endpoint = "htdf-gw.gebner.org:35869";
2019-10-03 18:10:37 +00:00
# endpoint = "80.109.2.154:35869";
endpoint = "127.0.0.1:35869";
2018-09-01 13:40:10 +00:00
}];
};
systemd.services.wireguard-wg0.wantedBy = pkgs.lib.mkOverride 10 [];
2019-10-03 18:10:37 +00:00
systemd.services.wstunnel = {
path = with pkgs; [
(haskell.lib.justStaticExecutables
(haskellPackages.callPackage ./pkgs/wstunnel.nix {}))
];
wantedBy = [ "wireguard-wg0.service" ];
after = [ "network.target" ];
script = ''
wstunnel -L 35869:htdf-gw.gebner.org:35869 -u wss://gebner.org
'';
};
2019-10-03 10:30:33 +00:00
services.resolved = {
domains = [];
enable = true;
};
2017-08-28 17:19:07 +00:00
}