summaryrefslogtreecommitdiff
path: root/machines
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2021-01-11 19:26:45 -0500
committerKjetil Orbekk <kj@orbekk.com>2021-01-11 19:26:56 -0500
commit6fe125155e33bcd103991ccaf490e1adcff46856 (patch)
tree6b4fdb34900e8c7fd47c5501da6b07d2d8adc1a8 /machines
parent96c7a8a2b45e5354a8852485c7e0f54ab5ddac13 (diff)
Firelink setup
Diffstat (limited to 'machines')
-rw-r--r--machines/firelink.nix109
1 files changed, 96 insertions, 13 deletions
diff --git a/machines/firelink.nix b/machines/firelink.nix
index 6b47c79..16d99cc 100644
--- a/machines/firelink.nix
+++ b/machines/firelink.nix
@@ -2,6 +2,24 @@
let
nixpkgs-unstable = import <nixpkgs_unstable> {};
+ my-overlay = self: super: {
+ xow = super.xow.overrideAttrs (o: rec {
+ src = /home/orbekk/projects/source/.;
+ });
+ my-linuxPackages =
+ let linuxPkgs = nixpkgs-unstable.linuxPackages_latest;
+ in linuxPkgs.extend (self: super: {
+ # xpadneo = super.xpadneo.overrideAttrs (o: rec {
+ # version = "master";
+ # src = pkgs.fetchFromGitHub {
+ # owner = "atar-axis";
+ # repo = "xpadneo";
+ # rev = "bf8a3c3d7e28162d074744539d0b228566cb0e32";
+ # sha256 = "0hspmvghr3qi1wf17xwfhd5wy7z1rdzh6qhwlhwgfv21f02n2xs9";
+ # };
+ # });
+ });
+ };
in
{
imports = [
@@ -12,6 +30,53 @@ in
../config/yubikey.nix
];
+ environment.systemPackages = with pkgs; [
+ kodi
+ retroarch
+ wmctrl # for steam launcher
+ ];
+ nixpkgs.config.kodi = {
+ enableAdvancedLauncher = true;
+ enableAdvancedEmulatorLauncher = true;
+ enableJoystick = true;
+ enableSteamLauncher = true;
+ enableInputStreamAdaptive = true;
+ };
+ nixpkgs.config.retroarch = {
+ enableCitra = true;
+ enableDolphin = true;
+ };
+
+ nixpkgs.overlays = [ my-overlay ];
+ hardware.bluetooth.config = {
+ General = {
+ Privacy = "device";
+ };
+ };
+ # hardware.xpadneo.enable = true;
+ systemd.services.xow.wantedBy = ["multi-user.target"];
+ systemd.services.xow.serviceConfig.Group = "input";
+ hardware.uinput.enable = true;
+ systemd.packages = [ pkgs.xow ];
+ services.hardware.xow.enable = true;
+ boot.blacklistedKernelModules = ["mt76x2u"]; # Interferes with xow
+
+ hardware.pulseaudio = {
+ enable = true;
+ extraModules = [ pkgs.pulseaudio-modules-bt ];
+ package = lib.mkForce pkgs.pulseaudioFull;
+ systemWide = true;
+ # configFile = pkgs.writeText "default.pa" ''
+ # load-module module-bluetooth-policy
+ # load-module module-bluetooth-discover
+ # ## module fails to load with
+ # ## module-bluez5-device.c: Failed to get device path from module arguments
+ # ## module.c: Failed to load module "module-bluez5-device" (argument: ""): initialization failed.
+ # # load-module module-bluez5-device
+ # # load-module module-bluez5-discover
+ # '';
+ };
+
networking.networkmanager.enable = true;
networking.networkmanager.wifi.powersave = false;
networking.vlans = {
@@ -34,6 +99,8 @@ in
}];
virtualisation.libvirtd.enable = true;
+ # virtualisation.virtualbox.host.enable = true;
+ virtualisation.virtualbox.host.enableExtensionPack = true;
# Streaming test
# services.nginx.enable = true;
@@ -85,17 +152,24 @@ in
boot.loader.grub.device = "nodev";
boot.loader.grub.efiSupport = true;
boot.loader.efi.canTouchEfiVariables = true;
- boot.kernelPackages = pkgs.linuxPackages_latest;
+ boot.kernelPackages = pkgs.my-linuxPackages;
boot.kernelModules = [ "kvm-amd" "i2c-dev" ];
# https://bugzilla.kernel.org/show_bug.cgi?id=203709
boot.extraModprobeConfig = ''
- options iwlwifi power_save=0
- options iwlwifi swcrypto=1
- options iwlwifi disable_11ax=1
- options iwlmvm power_scheme=1
+ # options iwlwifi power_save=0
+ # options iwlwifi swcrypto=1
+ # options iwlwifi disable_11ax=1
+ # options iwlwifi bt_coex_active=0
+ # options iwlmvm power_scheme=1
+ # options bluetooth disable_ertm=1
+
+ # For xpadneo
+ alias hid:b0005g*v0000045Ep000002E0 hid_xpadneo
+ alias hid:b0005g*v0000045Ep000002FD hid_xpadneo
+ alias hid:b0005g*v0000045Ep00000B05 hid_xpadneo
+ alias hid:b0005g*v0000045Ep00000B13 hid_xpadneo
'';
- # boot.kernelPackages = nixpkgs-unstable.linuxPackages_latest;
systemd.services.monitor-switch-to-me = {
description = "Switch monitor to this computer";
@@ -111,14 +185,16 @@ in
};
services.udev.extraRules = ''
- ACTION!="add", GOTO="display_switch_end"
-
- # Trigger on Planck keyboard.
- ATTRS{idVendor}=="feed",\
- ATTRS{idProduct}=="6060",\
- RUN+="${pkgs.systemd}/bin/systemctl start --no-block monitor-switch-to-me.service"
+ # ACTION!="add", GOTO="display_switch_end"
+ # # Trigger on Planck keyboard.
+ # ATTRS{idVendor}=="feed",\
+ # ATTRS{idProduct}=="6060",\
+ # RUN+="${pkgs.systemd}/bin/systemctl start --no-block monitor-switch-to-me.service"
+ # LABEL="display_switch_end"
- LABEL="display_switch_end"
+ # For xpadneo
+ ACTION=="add", KERNEL=="0005:045E:02FD.*|0005:045E:02E0.*|0005:045E:0B05.*|0005:045E:0B13.*", SUBSYSTEM=="hid", DRIVER!="xpadneo", ATTR{driver/unbind}="%k", ATTR{[drivers/hid:xpadneo]bind}="%k"
+ ACTION=="add", DRIVERS=="xpadneo", SUBSYSTEM=="input", ENV{ID_INPUT_JOYSTICK}=="1", TAG+="uaccess", MODE="0664", ENV{LIBINPUT_IGNORE_DEVICE}="1"
'';
# boot.kernelPackages = let
@@ -154,6 +230,13 @@ in
boot.initrd.luks.devices."cryptsystem".device = "/dev/disk/by-uuid/8acc11c2-e540-4561-8c88-34176fca1a72";
boot.initrd.luks.devices."cryptsystem".allowDiscards = true;
+ # boot.initrd.luks.devices."cryptsystem".yubikey = {
+ # slot = 2;
+ # twoFactor = false;
+ # storage.device = "/boot";
+ # };
+ # boot.initrd.luks.cryptoModules = ["aes" "xts" "sha512"];
+ # boot.initrd.luks.yubikeySupport = true;
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/C636-D264";