dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 1f9091d8fd54d761fa391b3debb730dc511e5c48 parent bcfbdcd0258e23fbf0d4a00a0fa129c3dd059825 Author: maydayv7 <maydayv7@gmail.com> Date: Wed, 20 Sep 2023 23:05:07 +0530 feat: Android Virtualization using Waydroid Also configure GNOME Action Menu (Guillotine)
Diffstat:
| M | README.md | | | 5 | ++++- |
| M | devices/Vortex.nix | | | 1 | + |
| M | files/default.nix | | | 1 | + |
| M | files/gnome/dconf.nix | | | 2 | +- |
| A | files/gnome/menu.json | | | 55 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| M | modules/README.md | | | 4 | +++- |
| M | modules/gui/gnome.nix | | | 7 | +++++-- |
| M | modules/hardware/virtualisation.nix | | | 79 | ++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------- |
8 files changed, 122 insertions(+), 32 deletions(-)
diff --git a/README.md b/README.md @@ -37,6 +37,7 @@ This [repository](https://github.com/maydayv7/dotfiles) contains the configurati - Advanced Configuration [Checks](./modules/nix/checks.nix) using [`pre-commit-hooks.nix`](https://github.com/cachix/pre-commit-hooks.nix) - Support for `source` Filters with [`nix-filter`](https://github.com/numtide/nix-filter) and [`gitignore.nix`](https://github.com/hercules-ci/gitignore.nix) - Wrapped `wine` [Applications](./packages/wine) using Emmanuel's [Wrapper](https://github.com/emmanuelrosa/erosanix/tree/0dabea58d483e13d2de141517cb4ff1cb230b2aa/pkgs/mkwindowsapp) +- Support for Android Virtualization using [Waydroid](https://waydro.id/) - Declaratively Configured [Windows VM](./modules/hardware/virtualisation/windows.nix) using the [WFVM](https://git.m-labs.hk/M-Labs/wfvm) Module ## Programs @@ -342,7 +343,7 @@ This repository makes use of [`GitHub Actions`](./.github/workflows) in order to ### File System -The system may be set up using either a `simple` or `advanced` filesystem layout. The advanced ZFS opt-in state filesystem configuration allows for a vastly improved experience, preventing formation of cruft and exerting total control over the device state, by erasing the system at every boot, keeping only what's required +The system may be set up using either a `simple` or `advanced` filesystem layout. The advanced ZFS encrypted opt-in state filesystem configuration allows for a vastly improved experience, preventing formation of cruft and exerting total control over the device state, by erasing the system at every boot, keeping only what's required #### Data Storage @@ -424,9 +425,11 @@ You can navigate to the `README`'s present in the various directories to know mo - Upgrade to NixOS v23.05 (Stoat)! - Drop `cod`, `nix-linter` and `mutter-rounded` +- Support Android Virtualization using Waydroid - Fix GNOME Extensions - Improve XFCE Configuration Handling - Improve Automatic Package Update Script +- Use ZFS encryption - Drop `touchegg` Support ### 22.11 (v11) diff --git a/devices/Vortex.nix b/devices/Vortex.nix @@ -17,6 +17,7 @@ security = true; support = ["mobile" "printer" "virtualisation"]; modules = ["dell-inspiron-5509"]; + vm.android.enable = true; }; gui.desktop = "gnome"; diff --git a/files/default.nix b/files/default.nix @@ -40,6 +40,7 @@ in rec { gnome = { dconf = ./gnome/dconf.nix; iso = readFile ./gnome/iso; + menu = readFile ./gnome/menu.json; }; # GPG Keys Directory diff --git a/files/gnome/dconf.nix b/files/gnome/dconf.nix @@ -316,7 +316,7 @@ in { "org.gnome.Geary.desktop" "org.gnome.Nautilus.desktop" "org.gnome.Console.desktop" - "org.gnome.gnome-text-editor.desktop" + "org.gnome.TextEditor.desktop" "org.gnome.Settings.desktop" ]; }; diff --git a/files/gnome/menu.json b/files/gnome/menu.json @@ -0,0 +1,55 @@ +{ + "settings": { + "icon": "open-menu-symbolic", + "loglevel": "warning" + }, + "menu": [ + { + "type": "submenu", + "title": "Virtualization", + "icon": "computer-symbolic", + "items": [ + { + "type": "switch", + "title": "Android", + "icon": "application-x-addon-symbolic", + "start": "waydroid session start", + "stop": "waydroid session stop", + "check": "sh -c 'waydroid status | grep RUNNING'", + "interval_s": 10 + } + ] + }, + { + "type": "submenu", + "title": "Settings", + "icon": "application-menu-symbolic", + "items": [ + { + "type": "command", + "title": "Configuration", + "command": "xdg-open .config/guillotine.json", + "instancing": "singleInstance", + "icon": "preferences-other-symbolic", + "killOnDisable": false + }, + { + "type": "command", + "title": "Log", + "command": "gnome-terminal -e 'journalctl -f GNOME_SHELL_EXTENSION_UUID=guillotine@fopdoodle.net' ", + "instancing": "singleInstance", + "icon": "emblem-documents-symbolic", + "killOnDisable": false + }, + { + "type": "command", + "title": "Log gnome-shell", + "command": "gnome-terminal -e 'journalctl -f _COMM=gnome-shell' ", + "instancing": "singleInstance", + "icon": "emblem-documents-symbolic", + "killOnDisable": false + } + ] + } + ] +} diff --git a/modules/README.md b/modules/README.md @@ -32,7 +32,9 @@ The `modules` directory contains custom-made pure Flakes-compatible configuratio - `modules`: List of Hardware Configuration Modules imported from [`inputs.hardware`](https://github.com/nixos/nixos-hardware) - Ex. `[ "common-pc" ]` - `security`: Enable Additional Security and Hardening Settings - `true / false` - `support`: List of Additional Supported Hardware - `[ "mobile" "printer" "ssd" "virtualisation" ]` - - `passthrough`: PCI Device IDs for VM Passthrough using VFI/O (Use [`scripts/pci.sh`](../scripts/pci.sh)) - Ex. `[ "00:02.0" "00:1c.0" ]` + - `vm`: Configure Virtualisation Support - + - `android`: Enable Android Virtualisation + - `passthrough`: PCI Device IDs for VM Passthrough using VFI/O (Use [`scripts/pci.sh`](../scripts/pci.sh)) - Ex. `[ "00:02.0" "00:1c.0" ]` - [`nix`](./nix): Module that configures the Nix Package Manager - diff --git a/modules/gui/gnome.nix b/modules/gui/gnome.nix @@ -85,7 +85,7 @@ in { mail = ["org.gnome.Geary.desktop"]; markdown = ["org.gnome.gitlab.somas.Apostrophe.desktop"]; pdf = ["org.gnome.Evince.desktop"]; - text = ["org.gnome.gnome-text-editor.desktop"]; + text = ["org.gnome.TextEditor.desktop"]; video = ["io.github.celluloid_player.Celluloid.desktop"]; }; @@ -108,6 +108,9 @@ in { # GTK+ Bookmarks ".config/gtk-3.0/bookmarks".text = gtk.bookmarks; + # Action Menu + ".config/guillotine.json".text = gnome.menu; + # Prevent Suspension on lid close ".config/autostart/ignore-lid-switch-tweak.desktop".text = '' [Desktop Entry] @@ -202,7 +205,7 @@ in { space-bar status-area-horizontal-spacing timepp - transparent-top-bar + transparent-top-bar-adjustable-transparency top-bar-organizer user-avatar-in-quick-settings vitals diff --git a/modules/hardware/virtualisation.nix b/modules/hardware/virtualisation.nix @@ -5,53 +5,78 @@ ... }: let inherit (builtins) concatStringsSep elem; - inherit (lib) mkIf mkOption types; + inherit (lib) mkEnableOption mkIf mkOption types; enable = elem "virtualisation" config.hardware.support; + cfg = config.hardware.vm; in { - options.hardware.passthrough = mkOption { - description = "PCI Device IDs for VM Passthrough"; - type = types.listOf types.str; - default = []; - example = ["00:02.0" "00:1c.0"]; + options.hardware.vm = { + android.enable = mkEnableOption "Enable Android Virtualisation"; + passthrough = mkOption { + description = "PCI Device IDs for VM Passthrough"; + type = types.listOf types.str; + default = []; + example = ["00:02.0" "00:1c.0"]; + }; }; ## Virtualisation Settings ## config = mkIf enable { # Enablement user.groups = ["kvm" "libvirtd"]; - user.persist.dirs = [".config/libvirt" ".local/share/libvirt"]; - environment.persist.dirs = ["/var/lib/libvirt"]; security.virtualisation.flushL1DataCache = "cond"; boot = { kernelParams = ["intel_iommu=on" "i915.enable_gvt=1"]; kernelModules = ["kvm-intel" "vfio" "vfio-pci" "vfio_virqfd" "vfio_iommu_type1"]; extraModprobeConfig = '' options kvm_intel nested=1 - options vfio-pci ids=${concatStringsSep "," config.hardware.passthrough} + options vfio-pci ids=${concatStringsSep "," cfg.passthrough} ''; }; - # VM Packages - environment.systemPackages = with pkgs; [libguestfs virt-manager]; - # VM Utilities - virtualisation = { - kvmgt.enable = true; - spiceUSBRedirection.enable = true; - libvirtd = { - enable = true; - onBoot = "ignore"; - onShutdown = "shutdown"; - qemu = { - package = pkgs.qemu_kvm; - runAsRoot = false; - swtpm.enable = true; - ovmf = { - enable = true; - packages = [pkgs.OVMFFull]; - }; + virtualisation.kvmgt.enable = true; + virtualisation.spiceUSBRedirection.enable = true; + virtualisation.libvirtd = { + enable = true; + onBoot = "ignore"; + onShutdown = "shutdown"; + qemu = { + package = pkgs.qemu_kvm; + runAsRoot = false; + swtpm.enable = true; + ovmf = { + enable = true; + packages = [pkgs.OVMFFull]; }; }; }; + + # Android Virtualisation + virtualisation.waydroid = {inherit (cfg.android) enable;}; + + # VM Packages + environment.systemPackages = with pkgs; + [libguestfs virt-manager] + ++ ( + if cfg.android.enable + then [wl-clipboard] + else [] + ); + + # File Persistence + user.persist.dirs = + [".config/libvirt" ".local/share/libvirt"] + ++ ( + if cfg.android.enable + then [".local/share/waydroid"] + else [] + ); + environment.persist.dirs = + ["/var/lib/libvirt"] + ++ ( + if cfg.android.enable + then ["/var/lib/waydroid"] + else [] + ); }; }