From 6fe125155e33bcd103991ccaf490e1adcff46856 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Mon, 11 Jan 2021 19:26:45 -0500 Subject: Firelink setup --- machines/firelink.nix | 109 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 96 insertions(+), 13 deletions(-) (limited to 'machines/firelink.nix') 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 {}; + 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"; -- cgit v1.2.3