diff --git a/flake.lock b/flake.lock index ab2fd19..2f44c5b 100644 --- a/flake.lock +++ b/flake.lock @@ -1839,6 +1839,7 @@ "snowfall-flake": "snowfall-flake", "snowfall-lib": "snowfall-lib_3", "sops-nix": "sops-nix", + "sr-iov": "sr-iov", "stylix": "stylix", "unstable": "unstable" } @@ -2033,6 +2034,22 @@ "type": "github" } }, + "sr-iov": { + "flake": false, + "locked": { + "lastModified": 1725366839, + "narHash": "sha256-w6Txt0vtnvsjRusFMPwFN3q4MPdBK34EFmZd3649XTg=", + "owner": "cyberus-technology", + "repo": "nixos-sriov", + "rev": "6bfcad7698afebbfead331826ee77f0b970603ed", + "type": "github" + }, + "original": { + "owner": "cyberus-technology", + "repo": "nixos-sriov", + "type": "github" + } + }, "stylix": { "inputs": { "base16": "base16", diff --git a/flake.nix b/flake.nix index d350afc..81fe1ee 100644 --- a/flake.nix +++ b/flake.nix @@ -94,6 +94,10 @@ url = "github:Sveske-Juice/declarative-jellyfin"; inputs.nixpkgs.follows = "nixpkgs"; }; + sr-iov = { + url = "github:cyberus-technology/nixos-sriov"; + flake = false; + }; }; outputs = inputs: let diff --git a/modules/nixos/presets/default/default.nix b/modules/nixos/presets/default/default.nix index 22ec849..cf4ad7a 100644 --- a/modules/nixos/presets/default/default.nix +++ b/modules/nixos/presets/default/default.nix @@ -19,7 +19,7 @@ in { }; services.fwupd.enable = true; #fwupdmgr update boot = { - kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; + #kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; loader = { systemd-boot.enable = !config.${namespace}.hardware.secureBoot.enable; efi.canTouchEfiVariables = !config.${namespace}.hardware.asahi.enable; @@ -29,6 +29,12 @@ in { # It will just not appear on screen unless a key is pressed loader.timeout = 0; }; + services.logind = { + lidSwitch = mkDefault "suspend"; + powerKey = mkDefault "suspend"; + powerKeyLongPress = mkDefault "poweroff"; + }; + # Set your time zone. time.timeZone = "Europe/Berlin"; diff --git a/systems/x86_64-linux/kylekrein-framework12/default.nix b/systems/x86_64-linux/kylekrein-framework12/default.nix index 969f333..af5c511 100644 --- a/systems/x86_64-linux/kylekrein-framework12/default.nix +++ b/systems/x86_64-linux/kylekrein-framework12/default.nix @@ -31,9 +31,25 @@ in with lib.custom; { facter.reportPath = ./facter.json; systemd.network.wait-online.enable = lib.mkForce false; #facter - - custom.hardware.hibernation = { + imports = [ + "${inputs.sr-iov}/sriov.nix" + ]; + virtualisation.cyberus.intel-graphics-sriov.enable = true; + virtualisation.virtualbox.host = { enable = true; + package = + (import (pkgs.fetchFromGitHub { + owner = "nixos"; + repo = "nixpkgs"; + rev = "0398740424de50bc851ece775b19cc5d5eb755e9"; + sha256 = "sha256-ZA9s5LroljnJtU4HcGSGB2sqGcSVO3OD+qz5wo+wmlE="; + }) {inherit (pkgs) system;}).virtualbox; + enableKvm = true; + enableHardening = false; + addNetworkInterface = false; + }; + custom.hardware.hibernation = { + enable = false; swapFileOffset = 533760; }; custom.presets.disko.impermanenceBtrfsLuks = {