From e76d0d571f93c8e932f54e6472daa605798435e5 Mon Sep 17 00:00:00 2001 From: Dmitriy Kholkin Date: Sat, 20 Nov 2021 03:31:20 +0300 Subject: [PATCH] cleanup --- profiles/applications/packages.nix | 5 +- profiles/packages/android-emulator.nix | 128 ------------------------- profiles/workspace/gtk.nix | 5 +- roles/desktop.nix | 2 +- 4 files changed, 4 insertions(+), 136 deletions(-) delete mode 100644 profiles/packages/android-emulator.nix diff --git a/profiles/applications/packages.nix b/profiles/applications/packages.nix index cdda47b..0cbdb77 100644 --- a/profiles/applications/packages.nix +++ b/profiles/applications/packages.nix @@ -10,7 +10,7 @@ with config.deviceSpecific; { fd ffmpeg.bin git-filter-repo - # glib.bin # gio + glib # gptfdisk libqalculate lm_sensors @@ -24,11 +24,10 @@ with config.deviceSpecific; { samba sd tealdeer - tidal-dl + # tidal-dl unzip usbutils wget - xclip youtube-dl zip diff --git a/profiles/packages/android-emulator.nix b/profiles/packages/android-emulator.nix deleted file mode 100644 index 38e6b1a..0000000 --- a/profiles/packages/android-emulator.nix +++ /dev/null @@ -1,128 +0,0 @@ -{ stdenv, lib, runtimeShell -, name ? "android-emulator", sdk ? null, deviceType ? "" -, platformVersion ? "30", systemImageType ? "default", abiVersion ? "x86_64" -, enableGPU ? false, extraAVDFiles ? [] -, app ? null, package ? null, activity ? null -, avdHomeDir ? null -}: - -stdenv.mkDerivation { - inherit name; - - buildCommand = '' - mkdir -p $out/bin - - cat > $out/bin/${name}-run << "EOF" - #!${runtimeShell} -e - - # We need a TMPDIR - if [ "$TMPDIR" = "" ] - then - export TMPDIR=/tmp - fi - - ${if avdHomeDir == null then '' - # Store the virtual devices somewhere else, instead of polluting a user's HOME directory - export ANDROID_SDK_HOME=$(mktemp -d $TMPDIR/nix-android-vm-XXXX) - '' else '' - mkdir -p "${avdHomeDir}" - export ANDROID_SDK_HOME="${avdHomeDir}" - ''} - - # We need to specify the location of the Android SDK root folder - export ANDROID_SDK_ROOT=${sdk} - - # We have to look for a free TCP port - - echo "Looking for a free TCP port in range 5554-5584" >&2 - - for i in $(seq 5554 2 5584) - do - if [ -z "$(${sdk}/platform-tools/adb devices | grep emulator-$i)" ] - then - port=$i - break - fi - done - - if [ -z "$port" ] - then - echo "Unfortunately, the emulator port space is exhausted!" >&2 - exit 1 - else - echo "We have a free TCP port: $port" >&2 - fi - - export ANDROID_SERIAL="emulator-$port" - - # Create a virtual android device for testing if it does not exist - # ${sdk}/cmdline-tools/latest/bin/avdmanager list target - - if [ "$(${sdk}/cmdline-tools/latest/bin/avdmanager list avd | grep 'Name: ${name}')" = "" ] - then - # Create a virtual android device - yes "" | ${sdk}/cmdline-tools/latest/bin/avdmanager create avd -n "${name}" -k "system-images;android-${platformVersion};${systemImageType};${abiVersion}" -d "${deviceType}" $NIX_ANDROID_AVD_FLAGS - - # fix wrong sdk path - sed -i "s|image.sysdir.1.\+|image.sysdir.1=${sdk}/system-images/android-${platformVersion}/${systemImageType}/${abiVersion}|" "$ANDROID_SDK_HOME/.android/avd/${name}.avd/config.ini" - - ${lib.optionalString enableGPU '' - # Enable GPU acceleration - echo "hw.gpu.enabled=yes" >> "$ANDROID_SDK_HOME/.android/avd/${name}.avd/config.ini" - ''} - - ${lib.concatMapStrings (extraAVDFile: '' - ln -sf ${extraAVDFile} "$ANDROID_SDK_HOME/.android/avd/${name}.avd" - '') extraAVDFiles} - fi - - # Launch the emulator - ${sdk}/emulator/emulator -avd "${name}" -no-boot-anim -port $port $NIX_ANDROID_EMULATOR_FLAGS & - - # Wait until the device has completely booted - echo "Waiting until the emulator has booted the device and the package manager is ready..." >&2 - - ${sdk}/platform-tools/adb -s emulator-$port wait-for-device - - echo "Device state has been reached" >&2 - - while [ -z "$(${sdk}/platform-tools/adb -s emulator-$port shell getprop dev.bootcomplete | grep 1)" ] - do - sleep 5 - done - - echo "dev.bootcomplete property is 1" >&2 - - #while [ -z "$(${sdk}/platform-tools/adb -s emulator-$port shell getprop sys.boot_completed | grep 1)" ] - #do - #sleep 5 - #done - - #echo "sys.boot_completed property is 1" >&2 - - echo "ready" >&2 - - ${lib.optionalString (app != null) '' - # Install the App through the debugger, if it has not been installed yet - - if [ -z "${package}" ] || [ "$(${sdk}/platform-tools/adb -s emulator-$port shell pm list packages | grep package:${package})" = "" ] - then - if [ -d "${app}" ] - then - appPath="$(echo ${app}/*.apk)" - else - appPath="${app}" - fi - - ${sdk}/platform-tools/adb -s emulator-$port install "$appPath" - fi - - # Start the application - ${lib.optionalString (package != null && activity != null) '' - ${sdk}/platform-tools/adb -s emulator-$port shell am start -a android.intent.action.MAIN -n ${package}/${activity} - ''} - ''} - EOF - chmod +x $out/bin/${name}-run - ''; -} diff --git a/profiles/workspace/gtk.nix b/profiles/workspace/gtk.nix index a5ccc49..0a645ee 100644 --- a/profiles/workspace/gtk.nix +++ b/profiles/workspace/gtk.nix @@ -31,6 +31,7 @@ in { }; }) ]; + gtk.iconCache.enable = true; programs.dconf.enable = true; services.dbus.packages = with pkgs; [ gnome3.dconf gcr ]; home-manager.users.alukard = { @@ -49,10 +50,6 @@ in { size = thm.fontSizes.normal.int; }; }; - home.sessionVariables.XDG_DATA_DIRS = [ - "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}" - "${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}" - ]; home.sessionVariables.GTK_THEME = "Generated"; }; } diff --git a/roles/desktop.nix b/roles/desktop.nix index 9a67538..d41fdbc 100644 --- a/roles/desktop.nix +++ b/roles/desktop.nix @@ -21,7 +21,7 @@ kitty mangohud mpv - ncmpcpp + # ncmpcpp packages piper rofi