wayland-vm
This commit is contained in:
parent
cd27333687
commit
90b9e9d32b
@ -1,10 +1,10 @@
|
|||||||
{ modulesPath, inputs, lib, pkgs, ... }: {
|
{ modulesPath, inputs, lib, pkgs, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
# ./hardware-configuration.nix
|
||||||
"${modulesPath}/profiles/qemu-guest.nix"
|
"${modulesPath}/profiles/qemu-guest.nix"
|
||||||
"${modulesPath}/profiles/minimal.nix"
|
"${modulesPath}/profiles/minimal.nix"
|
||||||
./system-path.nix
|
./imports/system-path.nix
|
||||||
./qemu-vm.nix
|
./imports/qemu-vm.nix
|
||||||
];
|
];
|
||||||
disabledModules = [ "config/system-path.nix" ];
|
disabledModules = [ "config/system-path.nix" ];
|
||||||
|
|
||||||
@ -66,14 +66,51 @@
|
|||||||
environment.etc.nixpkgs.source = inputs.nixpkgs;
|
environment.etc.nixpkgs.source = inputs.nixpkgs;
|
||||||
environment.etc.self.source = inputs.self;
|
environment.etc.self.source = inputs.self;
|
||||||
|
|
||||||
environment.systemPackages = [
|
nixpkgs.overlays = [
|
||||||
pkgs.labwc.overrideAttrs (old: {
|
(self: super: {
|
||||||
mesonFlags = [ "-Dxwayland=disabled" ];
|
labwc = super.labwc.overrideAttrs (old: {
|
||||||
|
mesonFlags = [ "-Dxwayland=disabled" ];
|
||||||
|
});
|
||||||
|
waydroid-script = let
|
||||||
|
py = super.python3.withPackages (pythonPackages: with pythonPackages; [
|
||||||
|
tqdm
|
||||||
|
requests
|
||||||
|
]);
|
||||||
|
in super.stdenv.mkDerivation {
|
||||||
|
name = "myscript";
|
||||||
|
version = "git";
|
||||||
|
|
||||||
|
src = super.fetchFromGitHub {
|
||||||
|
repo = "waydroid_script";
|
||||||
|
owner = "AlukardBF";
|
||||||
|
rev = "d8eaf667220c5ef72519280354d373a149e041a3";
|
||||||
|
sha256 = "1m15x87c7pc7ag624zccjjb19ixki01c0pfr78myc8nbavi56lfz";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
py
|
||||||
|
super.lzip
|
||||||
|
super.sqlite
|
||||||
|
super.util-linux
|
||||||
|
];
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
cp waydroid_extras.py $out/bin/waydroid-script
|
||||||
|
chmod +x $out/bin/waydroid-script
|
||||||
|
sed -i '1i #!${py}/bin/python' $out/bin/waydroid-script
|
||||||
|
'';
|
||||||
|
};
|
||||||
})
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
# pkgs.util-linux
|
||||||
|
pkgs.labwc
|
||||||
pkgs.nano
|
pkgs.nano
|
||||||
pkgs.foot
|
pkgs.havoc
|
||||||
pkgs.gnused
|
pkgs.gnused
|
||||||
pkgs.ncftp
|
pkgs.ncftp
|
||||||
|
pkgs.waydroid-script
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.sessionVariables = {
|
environment.sessionVariables = {
|
||||||
@ -84,25 +121,12 @@
|
|||||||
console.font = "cyr-sun16";
|
console.font = "cyr-sun16";
|
||||||
console.keyMap = "ruwin_cplk-UTF-8";
|
console.keyMap = "ruwin_cplk-UTF-8";
|
||||||
|
|
||||||
fonts = {
|
fonts.enableDefaultFonts = lib.mkForce false;
|
||||||
fonts = [ pkgs.ibm-plex ];
|
|
||||||
fontconfig = {
|
|
||||||
enable = true;
|
|
||||||
defaultFonts = {
|
|
||||||
monospace = [ "IBM Plex Mono 12" ];
|
|
||||||
sansSerif = [ "IBM Plex Sans 12" ];
|
|
||||||
serif = [ "IBM Plex Serif 12" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
enableDefaultFonts = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.noXlibs = lib.mkForce false;
|
environment.noXlibs = lib.mkForce false;
|
||||||
|
|
||||||
security.polkit.enable = true;
|
security.polkit.enable = true;
|
||||||
|
|
||||||
system.stateVersion = "22.11";
|
|
||||||
|
|
||||||
services.getty.autologinUser = "alukard";
|
services.getty.autologinUser = "alukard";
|
||||||
|
|
||||||
environment.etc."gbinder.d/waydroid.conf".source = let
|
environment.etc."gbinder.d/waydroid.conf".source = let
|
||||||
@ -115,22 +139,26 @@
|
|||||||
|
|
||||||
environment.loginShellInit = lib.mkAfter ''
|
environment.loginShellInit = lib.mkAfter ''
|
||||||
[[ "$(tty)" == /dev/tty1 ]] && {
|
[[ "$(tty)" == /dev/tty1 ]] && {
|
||||||
labwc -s foot
|
labwc -s havoc
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
system.userActivationScripts.linktosharedfolder.text = let
|
system.userActivationScripts.linktosharedfolder.text = let
|
||||||
foot = pkgs.writeText "foot.ini" ''
|
havoc = pkgs.writeText "havoc.cfg" ''
|
||||||
font=IBM Plex Mono:size=12
|
[child]
|
||||||
|
program=bash
|
||||||
|
[font]
|
||||||
|
size=18
|
||||||
|
path=${pkgs.ibm-plex}/share/fonts/truetype/VictorMono-Regular.ttf
|
||||||
'';
|
'';
|
||||||
in ''
|
in ''
|
||||||
if [[ ! -d "$HOME/.config/foot" ]]; then
|
if [[ ! -d "$HOME/.config" ]]; then
|
||||||
mkdir -p $HOME/.config/foot
|
mkdir -p $HOME/.config
|
||||||
fi
|
fi
|
||||||
if [[ -h "$HOME/.config/foot/foot.ini" ]]; then
|
if [[ -h "$HOME/.config/havoc.cfg" ]]; then
|
||||||
rm -f "$HOME/.config/foot/foot.ini"
|
rm -f "$HOME/.config/havoc.cfg"
|
||||||
fi
|
fi
|
||||||
ln -s "${foot}" "$HOME/.config/foot/foot.ini"
|
ln -s "${havoc}" "$HOME/.config/havoc.cfg"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
environment.etc."xdg/labwc/environment".text = ''
|
environment.etc."xdg/labwc/environment".text = ''
|
||||||
@ -167,7 +195,7 @@
|
|||||||
|
|
||||||
<menu id="root-menu" label="">
|
<menu id="root-menu" label="">
|
||||||
<item label="Terminal">
|
<item label="Terminal">
|
||||||
<action name="Execute"><command>foot</command></action>
|
<action name="Execute"><command>havoc</command></action>
|
||||||
</item>
|
</item>
|
||||||
<item label="Reconfigure">
|
<item label="Reconfigure">
|
||||||
<action name="Reconfigure"></action>
|
<action name="Reconfigure"></action>
|
||||||
@ -200,8 +228,17 @@
|
|||||||
|
|
||||||
<keyboard>
|
<keyboard>
|
||||||
<default />
|
<default />
|
||||||
<keybind key="A-Return">
|
<keybind key="A-Tab">
|
||||||
<action name="Execute"><command>foot</command></action>
|
<action name="NextWindow" />
|
||||||
|
</keybind>
|
||||||
|
<keybind key="A-w">
|
||||||
|
<action name="Execute"><command>havoc</command></action>
|
||||||
|
</keybind>
|
||||||
|
<keybind key="A-q">
|
||||||
|
<action name="Close" />
|
||||||
|
</keybind>
|
||||||
|
<keybind key="A-a">
|
||||||
|
<action name="ToggleMaximize" />
|
||||||
</keybind>
|
</keybind>
|
||||||
</keyboard>
|
</keyboard>
|
||||||
|
|
||||||
@ -257,5 +294,7 @@
|
|||||||
window.active.button.close.unpressed.image.color: #ef6b7b
|
window.active.button.close.unpressed.image.color: #ef6b7b
|
||||||
window.inactive.button.close.unpressed.image.color: #bf616a
|
window.inactive.button.close.unpressed.image.color: #bf616a
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
system.stateVersion = "22.11";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
17
machines/Wayland-VM/imports/qemu-vm.nix
Normal file
17
machines/Wayland-VM/imports/qemu-vm.nix
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{ modulesPath, config, ... }: {
|
||||||
|
imports = [
|
||||||
|
"${modulesPath}/virtualisation/qemu-vm.nix"
|
||||||
|
];
|
||||||
|
virtualisation = {
|
||||||
|
qemu.options = [ "-vga none" "-device virtio-vga-gl" "-display gtk,gl=on" ];
|
||||||
|
cores = 4;
|
||||||
|
memorySize = 6044;
|
||||||
|
msize = 131072;
|
||||||
|
diskSize = 20480;
|
||||||
|
diskImage = "./vm-images/${config.device}.qcow2";
|
||||||
|
# resolution = { x = 1920; y = 1080; };
|
||||||
|
|
||||||
|
useNixStoreImage = true;
|
||||||
|
writableStore = false;
|
||||||
|
};
|
||||||
|
}
|
@ -1,11 +0,0 @@
|
|||||||
{ modulesPath, ... }: {
|
|
||||||
imports = [
|
|
||||||
"${modulesPath}/virtualisation/qemu-vm.nix"
|
|
||||||
];
|
|
||||||
virtualisation = {
|
|
||||||
qemu.options = ["-vga none" "-device virtio-vga-gl" "-display gtk,gl=on"];
|
|
||||||
cores = 4;
|
|
||||||
memorySize = 4096;
|
|
||||||
diskSize = 20480;
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user