From cdab35f9048a20e40b4a90c68d44009d1531cd55 Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Sun, 14 Jul 2024 00:33:27 +0100 Subject: [PATCH] feat(loona): a bunch of stuff --- flake.lock | 17 +++++++++++++++++ flake.nix | 13 ++++++++++++- home/ash/desktop.nix | 1 + home/ash/lutris.nix | 5 +++++ home/ash/vscodium.nix | 1 + hosts/loona/configuration.nix | 17 +++++++++++++++++ roles/libvirt.nix | 18 ++++++++++++++++++ 7 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 home/ash/lutris.nix create mode 100644 roles/libvirt.nix diff --git a/flake.lock b/flake.lock index 274f880..4e2d6e1 100644 --- a/flake.lock +++ b/flake.lock @@ -315,6 +315,22 @@ "type": "github" } }, + "nixpkgs-zed": { + "locked": { + "lastModified": 1720763479, + "narHash": "sha256-7D4KeRoBKiSrjhKjCjkkNtdh4fUDmBVubdQMZokLQJE=", + "owner": "GaetanLepage", + "repo": "nixpkgs", + "rev": "f62f4aa5819324640d60158f38c8ed333b4de18f", + "type": "github" + }, + "original": { + "owner": "GaetanLepage", + "ref": "zed", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "agenix": "agenix", @@ -324,6 +340,7 @@ "nixos-generators": "nixos-generators", "nixpkgs-stable": "nixpkgs-stable", "nixpkgs-unstable": "nixpkgs-unstable", + "nixpkgs-zed": "nixpkgs-zed", "vscode-extensions": "vscode-extensions" } }, diff --git a/flake.nix b/flake.nix index b2a07d3..fc000b6 100644 --- a/flake.nix +++ b/flake.nix @@ -8,6 +8,10 @@ url = "github:NixOS/nixpkgs/nixos-unstable"; }; + nixpkgs-zed = { + url = "github:GaetanLepage/nixpkgs/zed"; + }; + home-manager-stable = { url = "github:nix-community/home-manager/release-24.05"; inputs.nixpkgs.follows = "nixpkgs-stable"; @@ -36,12 +40,18 @@ agenix.url = "github:ryantm/agenix"; }; - outputs = { self, nixpkgs-stable, nixpkgs-unstable, fsh, home-manager-stable, home-manager-unstable, nixos-generators, vscode-extensions, agenix, ... }: + outputs = { self, nixpkgs-stable, nixpkgs-unstable, nixpkgs-zed, fsh, home-manager-stable, home-manager-unstable, nixos-generators, vscode-extensions, agenix, ... }: let home-manager = home-manager-unstable; + zed-overlay = final: prev: { + # Inherit the changes into the overlay + inherit (nixpkgs-zed.legacyPackages.${prev.system}) + zed-editor; + }; overlays = [ fsh.overlays.default vscode-extensions.overlays.default + zed-overlay ]; overlays-module = ({ nixpkgs, ... }: { nixpkgs.overlays = overlays; @@ -111,6 +121,7 @@ ./home/ash/desktop.nix ./home/ash/emacs.nix ./home/ash/intellij.nix + ./home/ash/lutris.nix ./home/ash/vscodium.nix ./home/ash/zoom.nix ]; diff --git a/home/ash/desktop.nix b/home/ash/desktop.nix index a75dae6..a2a180c 100644 --- a/home/ash/desktop.nix +++ b/home/ash/desktop.nix @@ -7,6 +7,7 @@ gnome.gnome-sudoku dino thunderbird +# zed-editor ]; programs.direnv.enable = true; diff --git a/home/ash/lutris.nix b/home/ash/lutris.nix new file mode 100644 index 0000000..636cbcd --- /dev/null +++ b/home/ash/lutris.nix @@ -0,0 +1,5 @@ +{ config, pkgs, ... }: { + home.packages = with pkgs; [ + lutris + ]; +} diff --git a/home/ash/vscodium.nix b/home/ash/vscodium.nix index b22e49a..1122673 100644 --- a/home/ash/vscodium.nix +++ b/home/ash/vscodium.nix @@ -26,6 +26,7 @@ tauri-apps.tauri-vscode catppuccin.catppuccin-vsc catppuccin.catppuccin-vsc-icons + ziglang.vscode-zig ]); }) ]; diff --git a/hosts/loona/configuration.nix b/hosts/loona/configuration.nix index 00295f8..849ddde 100644 --- a/hosts/loona/configuration.nix +++ b/hosts/loona/configuration.nix @@ -5,6 +5,7 @@ ../../common/generic-uefi-zfs.nix ../../common/tailscale.nix ../../common/tpm.nix + ../../roles/libvirt.nix ../../roles/podman.nix ./hardware-configuration.nix ]; @@ -53,6 +54,22 @@ programs.steam.enable = true; nixpkgs.config.allowUnfree = true; + nixpkgs.config.packageOverrides = pkgs: { + intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; }; + }; + hardware.graphics = { + enable32Bit = true; + extraPackages = with pkgs; [ + intel-media-driver # LIBVA_DRIVER_NAME=iHD + intel-vaapi-driver # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) + libvdpau-va-gl + ]; + }; + + environment.sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; }; + + boot.extraModulePackages = with config.boot.kernelPackages; [ xpadneo ]; + virtualisation.waydroid.enable = true; system.stateVersion = "22.11"; diff --git a/roles/libvirt.nix b/roles/libvirt.nix new file mode 100644 index 0000000..440da6c --- /dev/null +++ b/roles/libvirt.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: { + virtualisation.libvirtd = { + enable = true; + qemu = { + package = pkgs.qemu_kvm; + runAsRoot = true; + swtpm.enable = true; + ovmf = { + enable = true; + packages = [(pkgs.OVMF.override { + secureBoot = true; + tpmSupport = true; + }).fd]; + }; + }; + }; + users.users.ash.extraGroups = ["libvirtd"]; +}