[
  {
    "path": ".envrc",
    "content": "use flake\n"
  },
  {
    "path": ".git-blame-ignore-revs",
    "content": "# format with `nixfmt-rfc-style`\n1030752c7fa96902b95212d522f7ea0fe7859b95\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      interval: \"weekly\"\n"
  },
  {
    "path": ".github/init",
    "content": "#!/usr/bin/env bash\nset -euo pipefail\n\ngit config --global user.name 'Cole Botkens'\ngit config --global user.email 'cole.mickens+colebot@gmail.com'\ngit remote update\n"
  },
  {
    "path": ".github/workflows/advance.yaml",
    "content": "name: \"Advance\"\nconcurrency: update-advance\non:\n  schedule:\n    - cron: '13 */6 * * *'\n  workflow_dispatch:\n  workflow_call:\njobs:\n  advance:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n    - name: setup-nix\n      uses: DeterminateSystems/nix-installer-action@main\n      with:\n        extra-conf: |\n          accept-flake-config = true\n    - name: prepare\n      run: nix develop -c .github/init\n    - name: advance\n      env:\n        CACHIX_SIGNING_KEY_NIXPKGS_WAYLAND: \"${{ secrets.cachix_signing_key_nixpkgs_wayland }}\"\n      run: nix develop -c ./main.nu advance\n"
  },
  {
    "path": ".github/workflows/build.yaml",
    "content": "name: \"Build\"\non:\n  push:\n    branches:\n    - master\n  schedule:\n    - cron: '17 */14 * * *'\n  workflow_dispatch:\n  workflow_call:\njobs:\n  build:\n    runs-on: ubuntu-latest\n    concurrency: build-${{matrix.jobs.branch}}-${{matrix.jobs.target}}\n    steps:\n    - uses: actions/checkout@v4\n    - name: setup-nix\n      uses: DeterminateSystems/nix-installer-action@main\n      with:\n        extra-conf: |\n          accept-flake-config = true\n    - name: prepare\n      run: nix develop -c .github/init\n    - name: build\n      env:\n        CACHIX_SIGNING_KEY_NIXPKGS_WAYLAND: \"${{ secrets.cachix_signing_key_nixpkgs_wayland }}\"\n      run: nix develop -c ./main.nu build\n"
  },
  {
    "path": ".github/workflows/check.yaml",
    "content": "name: \"Check\"\non:\n  push:\n    branches:\n    - master\n  schedule:\n    - cron: '17 */14 * * *'\n  pull_request:\n  workflow_dispatch:\n  workflow_call:\njobs:\n  check:\n    runs-on: ubuntu-latest\n    concurrency: build-${{matrix.jobs.branch}}-${{matrix.jobs.target}}\n    steps:\n    - uses: actions/checkout@v4\n    - name: setup-nix\n      uses: DeterminateSystems/nix-installer-action@main\n      with:\n        extra-conf: |\n          accept-flake-config = true\n    - name: prepare\n      run: nix develop -c .github/init\n    - name: check\n      run: nix develop -c ./main.nu check\n    - name: success\n      run: echo \"we made it, yay\"\n"
  },
  {
    "path": ".github/workflows/update.yaml",
    "content": "name: \"Update\"\nconcurrency: update-advance\non:\n  schedule:\n    - cron: '38 */12 * * *'\n  workflow_dispatch:\n  workflow_call:\njobs:\n  update:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n    - name: setup-nix\n      uses: DeterminateSystems/nix-installer-action@main\n      with:\n        extra-conf: |\n          accept-flake-config = true\n    - name: prepare\n      run: nix develop -c .github/init\n    - name: update\n      env:\n        CACHIX_SIGNING_KEY_NIXPKGS_WAYLAND: \"${{ secrets.cachix_signing_key_nixpkgs_wayland }}\"\n      run: nix develop -c ./main.nu update\n"
  },
  {
    "path": ".gitignore",
    "content": ".ci/commit-message\n.direnv\n*.qcow2\nresult\nresult-*\n"
  },
  {
    "path": "README.md",
    "content": "# nixpkgs-wayland\n\n[![Build](https://github.com/nix-community/nixpkgs-wayland/actions/workflows/build.yaml/badge.svg)](https://github.com/nix-community/nixpkgs-wayland/actions/workflows/build.yaml)\n[![Update](https://github.com/nix-community/nixpkgs-wayland/actions/workflows/update.yaml/badge.svg)](https://github.com/nix-community/nixpkgs-wayland/actions/workflows/update.yaml)\n[![Advance](https://github.com/nix-community/nixpkgs-wayland/actions/workflows/advance.yaml/badge.svg)](https://github.com/nix-community/nixpkgs-wayland/actions/workflows/advance.yaml)\n\n## overview\n\nAutomated, pre-built, (potentially) pre-release packages for Wayland (sway/wlroots) tools for NixOS (**nixos-unstable** channel).\n\nThese packages are auto-updated to the latest version available from their upstream source control. This means this overlay and package\nset will often contain **unreleased** versions.\n\nCommunity chat is on Matrix: [#nixpkgs-wayland:matrix.org](https://matrix.to/#/#nixpkgs-wayland:matrix.org). We are not on Libera.\n\nStarted by: [**@colemickens**](https://github.com/colemickens)\nand co-maintained by [**@Artturin**](https://github.com/Artturin) (🙏).\n\n<!-- TOC -->\n- [overview](#overview)\n- [Usage](#usage)\n  - [Binary Cache](#binary-cache)\n  - [Continuous Integration](#continuous-integration)\n  - [Flake Usage](#flake-usage)\n  - [Install for NixOS (non-flakes, manual import)](#install-for-nixos-non-flakes-manual-import)\n  - [Install for non-NixOS users](#install-for-non-nixos-users)\n- [Packages](#packages)\n- [Tips](#tips)\n    - [General](#general)\n    - [`sway`](#sway)\n    - [Nvidia Users](#nvidia-users)\n- [Development Guide](#development-guide)\n<!-- /TOC -->\n\n\n## Usage\n\n### Binary Cache\n\nThe [Cachix landing page for `nixpkgs-wayland`](https://nixpkgs-wayland.cachix.org) shows how to utilize the binary cache.\n\nPackages from this overlay are regularly built against `nixos-unstable` and pushed to this cache.\n\n### Continuous Integration\n\nWe have multiple CI jobs:\n1. Update - this tries to advance nixpkgs and upgrade all packages. If it can successfully build them, the updates are push to master.\n2. Advance - this tries to advance nixpkgs without touching the packages. This can help show when nixpkgs upgrades via `nixos-unstable` has advanced\n   into a state where we are broken building against it.\n3. Build - this just proves that `master` was working against `nixos-unstable` at the point in time captured by whatever is in `flake.lock` on `master`.\n\nWe don't have CI on Pull Requests, but I keep an eye on it after merging external contributions.\n\n### Flake Usage\n\n- Build and run [the Wayland-fixed up](https://github.com/obsproject/obs-studio/pull/2484) version of [OBS-Studio](https://obsproject.com/):\n  ```\n  nix shell \"github:nix-community/nixpkgs-wayland#obs-studio\" --command obs\n  ```\n- Build and run `waybar`:\n  ```\n  nix run \"github:nix-community/nixpkgs-wayland#waybar\"\n  ```\n\n* Use as an overlay or package set via flakes:\n\n  ```nix\n  {\n    inputs = {\n      nixpkgs-wayland.url = \"github:nix-community/nixpkgs-wayland\";\n\n      # only needed if you use as a package set:\n      nixpkgs-wayland.inputs.nixpkgs.follows = \"nixpkgs\";\n    };\n\n    outputs = inputs: {\n      nixosConfigurations.\"my-laptop-hostname\" =\n      let system = \"x86_64-linux\";\n      in nixpkgs.lib.nixosSystem {\n        inherit system;\n        modules = [({pkgs, config, ... }: {\n          config = {\n            nix.settings = {\n              # add binary caches\n              trusted-public-keys = [\n                \"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\"\n                \"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=\"\n              ];\n              substituters = [\n                \"https://cache.nixos.org\"\n                \"https://nixpkgs-wayland.cachix.org\"\n              ];\n            };\n\n            # use it as an overlay\n            nixpkgs.overlays = [ inputs.nixpkgs-wayland.overlay ];\n\n            # or, pull specific packages (built against inputs.nixpkgs, usually `nixos-unstable`)\n            environment.systemPackages = [\n              inputs.nixpkgs-wayland.packages.${system}.waybar\n            ];\n          };\n        })];\n      };\n    };\n  }\n  ```\n\n### Install for NixOS (non-flakes, manual import)\n\nIf you are not using Flakes, then consult the [NixOS Wiki page on Overlays](https://nixos.wiki/wiki/Overlays). Also, you can expand this section for a more literal, direct example. If you do pin, use a tool like `niv` to do the pinning so that you don't forget and wind up stuck on an old version.\n\n<details>\n\n```nix\n{ config, lib, pkgs, ... }:\nlet\n  rev = \"master\"; # 'rev' could be a git rev, to pin the overlay.\n  url = \"https://github.com/nix-community/nixpkgs-wayland/archive/${rev}.tar.gz\";\n  waylandOverlay = (import \"${builtins.fetchTarball url}/overlay.nix\");\nin\n  {\n    nixpkgs.overlays = [ waylandOverlay ];\n    environment.systemPackages = with pkgs; [ wayvnc ];\n    # ...\n  }\n```\n\nYou could write that to a file `./wayland.nix` next to your `configuration.nix` and then use it like so:\n\n```nix\n{ config, lib, pkgs, ... }:\n  {\n    # ...\n    imports = [\n      # ...\n      ./wayland.nix\n    ];\n  }\n```\n\n</details>\n\n### Install for non-NixOS users\n\nNon-NixOS users have many options, but here are two explicitly:\n\n1. Activate flakes mode, then just run them outright like the first example in this README.\n\n2. See the following details block for an example of how to add `nixpkgs-wayland` as a user-level\n   overlay and then install a package with `nix-env`.\n\n<details>\n\n1. There are two ways to activate an overlay for just your user:\n\n   1. Add a new entry in ``~/.config/nixpkgs/overlays.nix`:\n    ```nix\n    let\n      url = \"https://github.com/nix-community/nixpkgs-wayland/archive/master.tar.gz\";\n    in\n    [\n      (import \"${builtins.fetchTarball url}/overlay.nix\")\n    ]\n    ```\n\n   2. Add a new file under a dir, `~/.config/nixpkgs/overlays/nixpkgs-wayland.nix`:\n    ```nix\n    let\n      url = \"https://github.com/nix-community/nixpkgs-wayland/archive/master.tar.gz\";\n    in\n      (import \"${builtins.fetchTarball url}/overlay.nix\")\n    ```\n\n  Note, this method does not pin `nixpkgs-wayland`. That's left to the reader. (Just use flakes...)\n\n2. Then, `nix-env` will have access to the packages:\n\n```nix\nnix-env -iA neatvnc\n```\n\n</details>\n\n\n## Packages\n\n<!--pkgs-start-->\n| Package | Description |\n| --- | --- |\n| [aml](https://github.com/any1/aml) | Another main loop |\n| [cage](https://github.com/Hjdskes/cage) | Wayland kiosk that runs a single, maximized application |\n| [drm_info](https://github.com/ascent12/drm_info) | Small utility to dump info about DRM devices |\n| [dunst](https://github.com/dunst-project/dunst) | Lightweight and customizable notification daemon |\n| [eww](https://github.com/elkowar/eww) | Widget system made in Rust to create widgets for any WM |\n| [foot](https://codeberg.org/dnkl/foot/) | Fast, lightweight and minimalistic Wayland terminal emulator |\n| [freerdp3](https://www.freerdp.com/) | A Remote Desktop Protocol Client |\n| [gebaar-libinput](https://github.com/Osleg/gebaar-libinput-fork) | Gebaar, A Super Simple WM Independent Touchpad Gesture Daemon for libinput |\n| [glpaper](https://hg.sr.ht/~scoopta/glpaper) | Wallpaper program for wlroots based Wayland compositors such as sway that allows you to render glsl shaders as your wallpaper |\n| [grim](https://github.com/emersion/grim) | Grab images from a Wayland compositor |\n| [gtk-layer-shell](https://github.com/wmww/gtk-layer-shell) | Library to create panels and other desktop components for Wayland using the Layer Shell protocol |\n| [i3status-rust](https://github.com/greshake/i3status-rust) | Very resource-friendly and feature-rich replacement for i3status |\n| [imv](https://git.sr.ht/~exec64/imv) | Command line image viewer for tiling window managers |\n| [kanshi](https://git.sr.ht/~emersion/kanshi) | Dynamic display configuration tool |\n| [lavalauncher](https://git.sr.ht/~leon_plickat/lavalauncher) | Simple launcher panel for Wayland desktops |\n| [libvncserver_master](https://github.com/LibVNC/libvncserver) | VNC server library |\n| [mako](https://github.com/emersion/mako) | Lightweight Wayland notification daemon |\n| [neatvnc](https://github.com/any1/neatvnc) | VNC server library |\n| [new-wayland-protocols](https://gitlab.freedesktop.org/wayland/wayland-protocols/) | Wayland protocol extensions |\n| [obs-wlrobs](https://hg.sr.ht/~scoopta/wlrobs) | Obs-studio plugin that allows you to screen capture on wlroots based wayland compositors |\n| [rootbar](https://hg.sr.ht/~scoopta/rootbar) | Bar for Wayland WMs |\n| [salut](https://gitlab.com/snakedye/salut) | A sleek notification daemon |\n| [shotman](https://git.sr.ht/~whynothugo/shotman) | Uncompromising screenshot GUI for Wayland compositors |\n| [sirula](https://github.com/DorianRudolph/sirula) | Simple app launcher for wayland written in rust |\n| [slurp](https://github.com/emersion/slurp) | Select a region in a Wayland compositor |\n| [sway-unwrapped](https://github.com/swaywm/sway) | I3-compatible tiling Wayland compositor |\n| [swaybg](https://github.com/swaywm/swaybg) | Wallpaper tool for Wayland compositors |\n| [swayidle](https://github.com/swaywm/swayidle) | Idle management daemon for Wayland |\n| [swaylock](https://github.com/swaywm/swaylock) | Screen locker for Wayland |\n| [swaylock-effects](https://github.com/jirutka/swaylock-effects) | Screen locker for Wayland |\n| [swww](https://github.com/Horus645/swww) | Efficient animated wallpaper daemon for wayland, controlled at runtime |\n| [waybar](https://github.com/Alexays/Waybar) | Highly customizable Wayland bar for Sway and Wlroots based compositors |\n| [waypipe](https://gitlab.freedesktop.org/mstoeckl/waypipe/) | Network proxy for Wayland clients (applications) |\n| [wayvnc](https://github.com/any1/wayvnc) | VNC server for wlroots based Wayland compositors |\n| [wbg](https://codeberg.org/dnkl/wbg) | Wallpaper application for Wayland compositors |\n| [wdisplays](https://github.com/artizirk/wdisplays) | Graphical application for configuring displays in Wayland compositors |\n| [wev](https://git.sr.ht/~sircmpwn/wev) | Wayland event viewer |\n| [wf-recorder](https://github.com/ammen99/wf-recorder) | Utility program for screen recording of wlroots-based compositors |\n| [wl-clipboard](https://github.com/bugaevc/wl-clipboard) | Command-line copy/paste utilities for Wayland |\n| [wl-gammarelay-rs](https://github.com/MaxVerevkin/wl-gammarelay-rs) | A simple program that provides DBus interface to control display temperature and brightness under wayland without flickering  |\n| [wlay](https://github.com/atx/wlay) | Graphical output management for Wayland |\n| [wldash](https://wldash.org) | Wayland launcher/dashboard |\n| [wlogout](https://github.com/ArtsyMacaw/wlogout) | Wayland based logout menu |\n| [wlr-randr](https://git.sr.ht/~emersion/wlr-randr) | Xrandr clone for wlroots compositors |\n| [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots/) | Modular Wayland compositor library |\n| [wlsunset](https://git.sr.ht/~kennylevinsen/wlsunset) | Day/night gamma adjustments for Wayland |\n| [wlvncc](https://github.com/any1/wlvncc) | A Wayland Native VNC Client |\n| [wob](https://github.com/francma/wob) | Lightweight overlay bar for Wayland |\n| [wofi](https://hg.sr.ht/~scoopta/wofi) | Launcher/menu program for wlroots based wayland compositors such as sway |\n| [wshowkeys](https://github.com/ammgws/wshowkeys) | Displays keys being pressed on a Wayland session |\n| [wtype](https://github.com/atx/wtype) | xdotool type for wayland |\n| [xdg-desktop-portal-wlr](https://github.com/emersion/xdg-desktop-portal-wlr) | xdg-desktop-portal backend for wlroots |\n<!--pkgs-end-->\n\n</details>\n\n## Tips\n\n#### General\n\n- I recommend using [`home-manager`](https://github.com/rycee/home-manager/)!\n- It has modules and options for:\n  - `sway`\n  - `waybar`\n  - `obs` and plugins!\n  - more!\n\n#### `sway`\n\n- You will likely want a default config file to place at `$HOME/.config/sway/config`. You can use the upstream default as a starting point: https://github.com/swaywm/sway/blob/master/config.in\n- If you start `sway` from a raw TTY, make sure you use `exec sway` so that if sway crashes, an unlocked TTY is not exposed.\n\n#### Nvidia Users\n\n- Everything should just work now (aka, wlroots/sway don't need patching).\n- This is a known-good working config, at least at one point in time:\n  [mixins/nvidia.nix@ccd992](https://github.com/cole-mickens/nixcfg/blob/cdd9929d5d36ce5b4d64cf80bdeb1df3f2cba332/mixins/nvidia.nix)\n\n## Development Guide\n\n- Use `nix develop`\n- `./main.nu`:\n  - `./main.nu build` - builds and caches derivations that don't exist in the cache, use `nix-eval-jobs`\n  - `./main.nu advance` - advances the flake inputs, runs `main build`\n  - `./main.nu update` - advances the flake inputs, updates pkg revs, runs `main build`\n- `build` pushes to the `nixpkgs-wayland` cachix\n\nIf for some reason the overlay isn't progressing and you want to help,\njust clone the repo, run `nix develop -c ./main.nu update`\n"
  },
  {
    "path": "default.nix",
    "content": "# This file provides backward compatibility to nix < 2.4 clients\nlet\n  lock = builtins.fromJSON (builtins.readFile ./flake.lock);\n\n  inherit (lock.nodes.flake-compat.locked)\n    owner\n    repo\n    rev\n    narHash\n    ;\n\n  flake-compat = fetchTarball {\n    url = \"https://github.com/${owner}/${repo}/archive/${rev}.tar.gz\";\n    sha256 = narHash;\n  };\n\n  flake = import flake-compat { src = ./.; };\n\n  warn = msg: builtins.trace \"\u001b[1;31mwarning: ${msg}\u001b[0m\";\n  example = ''\n    nixpkgs.overlays=[(import \"''${builtins.fetchurl \"https://github.com/nix-community/nixpkgs-wayland/archive/master.tar.gz\"}/overlay.nix\")];\n  '';\n  warning = \"change your 'nixpkgs-wayland' import statement to import 'overlay.nix' directly. example:\\n  ${example}\";\nin\nwarn warning flake.defaultNix\n"
  },
  {
    "path": "demo/README.md",
    "content": "# Demo\n\nThis is a WIP demo\n\n## QEMU Demo\n\n    ./vm-build.sh && ./vm-run.sh\n    \n\n"
  },
  {
    "path": "demo/configuration.nix",
    "content": "{ ... }:\n{\n  imports = [ (import ./profile.nix { user = \"demo\"; }) ];\n\n  nix.settings.trusted-users = [\n    \"root\"\n    \"@wheel\"\n  ];\n\n  security.sudo.enable = true;\n\n  users.users.demo = {\n    uid = 1000;\n    isNormalUser = true;\n    password = \"demo1234\";\n    extraGroups = [\n      # allow demo to administer the machine\n      \"wheel\"\n    ];\n  };\n\n  users.users.root = {\n    password = \"root1234\";\n  };\n\n  services.xserver.enable = false;\n\n  services.getty.helpLine = ''\n\n       Welcome to the Sway demo\n\n    login: demo\n    password: demo1234\n\n    Once logged-in, type `sway` to start the desktop environment.\n  '';\n}\n"
  },
  {
    "path": "demo/flake.nix",
    "content": "{\n  description = \"nixpkgs-wayland\";\n\n  inputs = {\n    nixpkgs = {\n      url = \"github:nixos/nixpkgs/nixos-unstable\";\n    };\n    lib-aggregate = {\n      url = \"github:nix-community/lib-aggregate\";\n    };\n    nixpkgs-wayland = {\n      url = \"github:nix-community/nixpkgs-wayland\";\n    };\n    home-manager = {\n      url = \"github:nix-community/home-manager\";\n    };\n  };\n\n  nixConfig = {\n    extra-substituters = [ \"https://nixpkgs-wayland.cachix.org\" ];\n    extra-trusted-public-keys = [\n      \"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=\"\n    ];\n  };\n\n  outputs =\n    inputs:\n    let\n      inherit (inputs.lib-aggregate) lib;\n      inherit (inputs) self;\n    in\n    lib.flake-utils.eachSystem\n      [\n        \"aarch64-linux\"\n        \"x86_64-linux\"\n        \"riscv64-linux\"\n      ]\n      (system: {\n        nixosConfigurations.demo = inputs.nixpkgs.lib.nixosSystem {\n          inherit system;\n          specialArgs = {\n            inherit inputs;\n          };\n          modules = [\n            ./configuration.nix\n            (\n              { pkgs, ... }:\n              {\n                nixpkgs.overlays = [ inputs.nixpkgs-wayland.overlays.default ];\n              }\n            )\n\n            (\n              { pkgs, modulesPath, ... }:\n              {\n                imports = [ (modulesPath + \"/virtualisation/qemu-vm.nix\") ];\n                virtualisation = {\n                  memorySize = 1024 * 8;\n                  diskSize = 1024 * 2;\n                  cores = 8;\n                };\n                # For running Sway in a QEMU VM the Arch Linux Wiki recommends to use\n                # the QXL virtualized graphics card:\n                # https://wiki.archlinux.org/title/sway#Virtualization\n                # The screen resolution isn't automatically scaled. Full HD seems to\n                # be a good default that should work on most systems well.\n                virtualisation.qemu.options = [ \"-device qxl-vga,xres=1920,yres=1080\" ];\n\n                # The Arch Linux Wiki suggests using the qxl and bochs_drm kernel\n                # modules:\n                # https://wiki.archlinux.org/title/QEMU#qxl\n                boot.kernelModules = [\n                  \"qxl\"\n                  \"bochs_drm\"\n                ];\n              }\n            )\n          ];\n        };\n        packages = {\n          demo-vm = self.nixosConfigurations.${system}.demo.config.system.build.vmWithBootLoader;\n        };\n      });\n}\n"
  },
  {
    "path": "demo/home/profile.nix",
    "content": "{ pkgs, ... }:\n{\n  home.packages =\n    with pkgs;\n    [\n      brightnessctl\n      dmenu\n      pavucontrol\n      playerctl\n      termite\n      xdg_utils # needed for termite URL opening\n      xwayland\n    ]\n    ++ (with waylandPkgs; [\n      grim # screenshot CLI\n      waybar\n      kanshi # broken: display configurator\n      mako # notification manager\n      slurp # dimension-grabbing CLI, to use with grim\n      swayidle # lock screen manager\n    ]);\n\n  programs.termite.enable = true;\n  programs.termite.scrollbackLines = 10000;\n\n  programs.firefox.enable = true;\n\n  # FIXME: doesn't work yet\n  xsession.enable = true;\n  xsession.windowManager.command = \"sway\";\n\n  xdg.enable = true;\n  xdg.configFile.\"sway/config\" = {\n    source = pkgs.substituteAll {\n      name = \"sway-config\";\n      src = ./sway-config;\n      wallpaper = ./wallpaper.jpg;\n    };\n  };\n\n  xdg.configFile.\"chromium-flags.conf\" = {\n    source = pkgs.writeText \"chromium-flags.conf\" ''\n      --force-device-scale-factor=1\n    '';\n  };\n\n  gtk.enable = true;\n\n  home.stateVersion = \"23.11\";\n}\n"
  },
  {
    "path": "demo/home/sway-config",
    "content": "# Default config for sway\n#\n# Copy this to ~/.config/sway/config and edit it to your liking.\n#\n# Read `man 5 sway` for a complete reference.\n\n### Variables\n#\n# Logo key. Use Mod1 for Alt.\nset $mod Mod4\n# Home row direction keys, like vim\nset $left h\nset $down j\nset $up k\nset $right l\n# Your preferred terminal emulator\n#set $term urxvt\nset $term termite\n# alacritty\n# Your preferred application launcher\n# Note: it's recommended that you pass the final command to sway\nset $menu dmenu_path | dmenu | xargs swaymsg exec\n\n### Output configuration\n#\n# Default wallpaper (more resolutions are available in __DATADIR__/backgrounds/sway/)\noutput * bg @wallpaper@ fill\n\noutput eDP-1 scale 1.5\n\n#\n# Example configuration:\n#\n#   output HDMI-A-1 resolution 1920x1080 position 1920,0\n#\n# You can get the names of your outputs by running: swaymsg -t get_outputs\n\n### Idle configuration\n#\n# Example configuration:\n#\nexec swayidle \\\n    timeout 500 'swaylock -c 000000' \\\n    timeout 600 'swaymsg \"output * dpms off\"' \\\n       resume 'swaymsg \"output * dpms on\"' \\\n    before-sleep 'swaylock -c 000000'\n\n# Start the notification center\nexec mako --default-timeout 50000\n\n# Start one shell\nexec $term\n\n# This will lock your screen after 300 seconds of inactivity, then turn off\n# your displays after another 600 seconds, and turn your screens back on when\n# resumed. It will also lock your screen before your computer goes to sleep.\n\n### Input configuration\n#\n# Example configuration:\n#\n#   input \"2:14:SynPS/2_Synaptics_TouchPad\" {\n#       dwt enabled\n#       tap enabled\n#       natural_scroll enabled\n#       middle_emulation enabled\n#   }\n#\n# You can get the names of your inputs by running: swaymsg -t get_inputs\n# Read `man 5 sway-input` for more information about this section.\n\ninput \"1386:888:Wacom_Intuos_BT_M_Pen\" {\n  map_to_output HDMI-A-2\n  # FIXME: map BTN_0 to BTN_3, BTN_STYLUS and BTN_STYLUS2 buttons\n}\n\n### Key bindings\n#\n# Basics:\n#\n    # start a terminal\n    bindsym $mod+Return exec $term\n\n    # kill focused window\n    bindsym $mod+Shift+q kill\n\n    # start your launcher\n    bindsym $mod+d exec $menu\n    bindsym $mod+p exec $menu\n\n    # Drag floating windows by holding down $mod and left mouse button.\n    # Resize them with right mouse button + $mod.\n    # Despite the name, also works for non-floating windows.\n    # Change normal to inverse to use left mouse button for resizing and right\n    # mouse button for dragging.\n    floating_modifier $mod normal\n\n    # reload the configuration file\n    bindsym $mod+Shift+c reload\n\n    # exit sway (logs you out of your Wayland session)\n    bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'\n#\n# Moving around:\n#\n    # Move your focus around\n    bindsym $mod+$left focus left\n    bindsym $mod+$down focus down\n    bindsym $mod+$up focus up\n    bindsym $mod+$right focus right\n    # or use $mod+[up|down|left|right]\n    bindsym $mod+Left focus left\n    bindsym $mod+Down focus down\n    bindsym $mod+Up focus up\n    bindsym $mod+Right focus right\n\n    # _move_ the focused window with the same, but add Shift\n    bindsym $mod+Shift+$left move left\n    bindsym $mod+Shift+$down move down\n    bindsym $mod+Shift+$up move up\n    bindsym $mod+Shift+$right move right\n    # ditto, with arrow keys\n    bindsym $mod+Shift+Left move left\n    bindsym $mod+Shift+Down move down\n    bindsym $mod+Shift+Up move up\n    bindsym $mod+Shift+Right move right\n#\n# Workspaces:\n#\n    # switch to workspace\n    bindsym $mod+1 workspace 1\n    bindsym $mod+2 workspace 2\n    bindsym $mod+3 workspace 3\n    bindsym $mod+4 workspace 4\n    bindsym $mod+5 workspace 5\n    bindsym $mod+6 workspace 6\n    bindsym $mod+7 workspace 7\n    bindsym $mod+8 workspace 8\n    bindsym $mod+9 workspace 9\n    bindsym $mod+0 workspace 10\n    # move focused container to workspace\n    bindsym $mod+Shift+1 move container to workspace 1\n    bindsym $mod+Shift+2 move container to workspace 2\n    bindsym $mod+Shift+3 move container to workspace 3\n    bindsym $mod+Shift+4 move container to workspace 4\n    bindsym $mod+Shift+5 move container to workspace 5\n    bindsym $mod+Shift+6 move container to workspace 6\n    bindsym $mod+Shift+7 move container to workspace 7\n    bindsym $mod+Shift+8 move container to workspace 8\n    bindsym $mod+Shift+9 move container to workspace 9\n    bindsym $mod+Shift+0 move container to workspace 10\n    # Note: workspaces can have any name you want, not just numbers.\n    # We just use 1-10 as the default.\n#\n# Layout stuff:\n#\n    # You can \"split\" the current object of your focus with\n    # $mod+b or $mod+v, for horizontal and vertical splits\n    # respectively.\n    bindsym $mod+b splith\n    bindsym $mod+v splitv\n\n    # Switch the current container between different layout styles\n    bindsym $mod+s layout stacking\n    bindsym $mod+w layout tabbed\n    bindsym $mod+e layout toggle split\n\n    # Make the current focus fullscreen\n    bindsym $mod+f fullscreen\n\n    # Toggle the current focus between tiling and floating mode\n    bindsym $mod+Shift+space floating toggle\n\n    # Swap focus between the tiling area and the floating area\n    bindsym $mod+space focus mode_toggle\n\n    # move focus to the parent container\n    bindsym $mod+a focus parent\n#\n# Scratchpad:\n#\n    # Sway has a \"scratchpad\", which is a bag of holding for windows.\n    # You can send windows there and get them back later.\n\n    # Move the currently focused window to the scratchpad\n    bindsym $mod+Shift+minus move scratchpad\n\n    # Show the next scratchpad window or hide the focused scratchpad window.\n    # If there are multiple scratchpad windows, this command cycles through them.\n    bindsym $mod+minus scratchpad show\n#\n# Resizing containers:\n#\nmode \"resize\" {\n    # left will shrink the containers width\n    # right will grow the containers width\n    # up will shrink the containers height\n    # down will grow the containers height\n    bindsym $left resize shrink width 10px\n    bindsym $down resize grow height 10px\n    bindsym $up resize shrink height 10px\n    bindsym $right resize grow width 10px\n\n    # ditto, with arrow keys\n    bindsym Left resize shrink width 10px\n    bindsym Down resize grow height 10px\n    bindsym Up resize shrink height 10px\n    bindsym Right resize grow width 10px\n\n    # return to default mode\n    bindsym Return mode \"default\"\n    bindsym Escape mode \"default\"\n}\nbindsym $mod+r mode \"resize\"\n\n# Media keys\nbindsym XF86AudioLowerVolume exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') -5%\nbindsym XF86AudioMute exec pactl set-sink-mute $(pacmd list-sinks |awk '/* index:/{print $3}') toggle\nbindsym XF86AudioNext exec playerctl next\nbindsym XF86AudioPlay exec playerctl play-pause\nbindsym XF86AudioPrev exec playerctl previous\nbindsym XF86AudioRaiseVolume exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') +5%\nbindsym XF86MonBrightnessDown exec brightnessctl set 5%-\nbindsym XF86MonBrightnessUp exec brightnessctl set +5%\nbindsym XF86LaunchB exec $menu\n#\n# Status Bar:\n\nbar {\n    swaybar_command waybar\n}\n"
  },
  {
    "path": "demo/legacy/default.nix",
    "content": "let\n  nixpkgs = builtins.fetchTarball {\n    url = \"https://github.com/nixos/nixpkgs/archive/master.tar.gz\";\n    sha256 = \"195mgl12xa3qdxj2qnqswff4ic205442ankz0mgfrlsvp3jpm4qr\";\n  };\n\n  rev = \"master\";\n  # 'rev' could be a git rev, to pin the overla.\n  # if you pin, you should use a tool like `niv` maybe, but please consider trying flakes\n  url = \"https://github.com/colemickens/nixpkgs-wayland/archive/${rev}.tar.gz\";\n  waylandOverlay = import (builtins.fetchTarball url);\n\n  pkgs = import nixpkgs { overlays = [ waylandOverlay ]; };\nin\npkgs.waylandPkgs.waybar\n"
  },
  {
    "path": "demo/profile.nix",
    "content": "{ user }:\n{ pkgs, inputs, ... }@args:\nlet\n  inherit (inputs) home-manager;\nin\n{\n  imports = [ \"${home-manager}/nixos\" ];\n\n  nixpkgs.overlays = [ (import ../overlay.nix) ];\n\n  # When this is enabled, the QEMU VM goes blank after boot\n  networking.networkmanager.enable = true;\n\n  fonts.packages = with pkgs; [\n    dejavu_fonts # just a basic good font\n    font-awesome_5\n  ];\n\n  # add sound support\n  hardware.pulseaudio.enable = true;\n\n  # setup the user's  home\n  home-manager.users.\"${user}\" = (import ./home/profile.nix) args;\n\n  # Sway\n  programs.sway.enable = true;\n  programs.sway.extraSessionCommands = ''\n    # Tell toolkits to use wayland\n    export CLUTTER_BACKEND=wayland\n    #export QT_QPA_PLATFORM=wayland-egl\n    export QT_WAYLAND_DISABLE_WINDOWDECORATION=1\n    export SDL_VIDEODRIVER=wayland\n\n    # Fix krita and other Egl-using apps\n    export LD_LIBRARY_PATH=/run/opengl-driver/lib\n\n    # Disable HiDPI scaling for X apps\n    # https://wiki.archlinux.org/index.php/HiDPI#GUI_toolkits\n    export GDK_SCALE=1\n    export QT_AUTO_SCREEN_SCALE_FACTOR=0\n  '';\n\n  # manage those with home-manager\n  programs.sway.extraPackages = [ ];\n\n  # Add the required groups for the user to get access\n  users.extraUsers.\"${user}\" = {\n    extraGroups = [\n      # allow sudo\n      \"wheel\"\n      \"input\"\n      \"tty\"\n      \"audio\"\n      \"video\"\n      # allow sway's setuid executable\n      \"sway\"\n      \"networkmanager\"\n    ];\n  };\n}\n"
  },
  {
    "path": "demo/vm-build.sh",
    "content": "#!/usr/bin/env bash\nnix build \".#packages.x86_64-linux.demo-vm\"\n"
  },
  {
    "path": "demo/vm-run.sh",
    "content": "#!/usr/bin/env bash\n\nif [[ ! -e ./result ]]; then\n  echo Run ./vm-build.sh first\n  exit 1\nfi\n\nexec ./result/bin/run-nixos-vm\n"
  },
  {
    "path": "flake.nix",
    "content": "{\n  description = \"nixpkgs-wayland\";\n\n  inputs = {\n    nixpkgs = {\n      url = \"github:nixos/nixpkgs/nixos-unstable\";\n    };\n    lib-aggregate = {\n      url = \"github:nix-community/lib-aggregate\";\n    };\n    flake-compat = {\n      url = \"github:nix-community/flake-compat\";\n    };\n  };\n\n  nixConfig = {\n    extra-substituters = [ \"https://nixpkgs-wayland.cachix.org\" ];\n    extra-trusted-substituters = [ \"https://nixpkgs-wayland.cachix.org\" ];\n    extra-trusted-public-keys = [\n      \"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=\"\n    ];\n  };\n\n  outputs =\n    inputs:\n    let\n      inherit (inputs.lib-aggregate) lib;\n      inherit (inputs) self;\n\n      waylandOverlay =\n        final: prev:\n        let\n          template =\n            {\n              attrName,\n              nixpkgsAttrName ? \"\",\n              extra ? { },\n              replace ? { },\n              replaceInput ? { },\n              deprecationWarning ? \"\",\n            }:\n            import ./templates/template.nix {\n              inherit\n                prev\n                attrName\n                extra\n                replace\n                nixpkgsAttrName\n                replaceInput\n                deprecationWarning\n                ;\n            };\n          checkMutuallyExclusive = lib.mutuallyExclusive (map (e: e.attrName) attrsExtraChangesNeeded) (\n            map (e: e.attrName) attrsNoExtraChangesNeeded\n          );\n          genPackagesGH =\n            if checkMutuallyExclusive then\n              lib.listToAttrs (\n                map (a: {\n                  name = a.attrName;\n                  value = template a;\n                }) (attrsExtraChangesNeeded ++ attrsNoExtraChangesNeeded)\n              )\n            else\n              throw \"some 'attrName' value is in both attrsExtraChangesNeeded and attrsNoExtraChangesNeeded\";\n\n          # these need extra nativeBuildInputs or buildInputs or the patches cleared\n          attrsExtraChangesNeeded = [\n            {\n              attrName = \"drm_info\";\n              extra.nativeBuildInputs = [ prev.scdoc ];\n            }\n            {\n              attrName = \"swaylock\";\n              replace.patches = [ ];\n            }\n            {\n              attrName = \"grim\";\n              replace.patches = [ ];\n            }\n            {\n              attrName = \"waybar\";\n              deprecationWarning = \"'waybar' will be removed in October 2025. Please use the flake from https://github.com/Alexays/Waybar.\";\n              extra.buildInputs = [ prev.gpsd ];\n              replace = previousAttrs: {\n                patches = [];\n                postUnpack =\n                  let\n                    # Derived from subprojects/cava.wrap\n                    libcava = rec {\n                      version = \"0.10.4\";\n                      src = prev.fetchFromGitHub {\n                        owner = \"LukashonakV\";\n                        repo = \"cava\";\n                        rev = version;\n                        hash = \"sha256-9eTDqM+O1tA/3bEfd1apm8LbEcR9CVgELTIspSVPMKM=\";\n                      };\n                    };\n                    # Derived from subprojects/catch2.wrap\n                    catch2 = rec {\n                      version = \"3.7.0\";\n                      src = prev.fetchFromGitHub {\n                        owner = \"catchorg\";\n                        repo = \"Catch2\";\n                        rev = \"v${version}\";\n                        hash = \"sha256-U9hv6DaqN5eCMcAQdfFPqWpsbqDFxRQixELSGbNlc0g=\";\n                      };\n                    };\n                  in\n                  ''\n                    (\n                      cd \"$sourceRoot\"\n                      cp -R --no-preserve=mode,ownership ${libcava.src} subprojects/cava-${libcava.version}\n                      cp -R --no-preserve=mode,ownership ${catch2.src} subprojects/Catch2-${catch2.version}\n                      patchShebangs .\n                    )\n                  '';\n              };\n            }\n            {\n              attrName = \"gtk-layer-shell\";\n              extra.nativeBuildInputs = [ prev.vala ];\n              replace.patches = [ ];\n            }\n            {\n              attrName = \"sway-unwrapped\";\n              extra.buildInputs = [ prev.xorg.xcbutilwm ];\n              replaceInput = {\n                wlroots = final.wlroots;\n                wayland-protocols = final.new-wayland-protocols;\n              };\n              replace = previousAttrs: {\n                mesonFlags = lib.remove \"-Dxwayland=disabled\" (\n                  lib.remove \"-Dxwayland=enabled\" prev.sway-unwrapped.mesonFlags\n                );\n                patches =\n                  let\n                    patchesToRemove = [\n                      (prev.fetchpatch {\n                        name = \"libinput-1.27-p1.patch\";\n                        url = \"https://github.com/swaywm/sway/commit/bbadf9b8b10d171a6d5196da7716ea50ee7a6062.patch\";\n                        hash = \"sha256-lA+oL1vqGQOm7K+AthzHYBzmOALrDgxzX/5Dx7naq84=\";\n                      })\n                      (prev.fetchpatch {\n                        name = \"libinput-1.27-p2.patch\";\n                        url = \"https://github.com/swaywm/sway/commit/e2409aa49611bee1e1b99033461bfab0a7550c48.patch\";\n                        hash = \"sha256-l598qfq+rpKy3/0arQruwd+BsELx85XDjwIDkb/o6og=\";\n                      })\n                    ];\n                  in\n                  (lib.filter (\n                    patch: !(lib.any (rmpatch: rmpatch != patch) patchesToRemove)\n                  ) previousAttrs.patches);\n\n              };\n            }\n            {\n              attrName = \"cage\";\n              extra.buildInputs = [ prev.xorg.xcbutilwm ];\n              replaceInput = {\n                wlroots_0_18 = prev.wlroots_0_19;\n              };\n              # _FORTIFY_SOURCE requires compiling with optimization (-O)\n              # PR https://github.com/NixOS/nixpkgs/pull/232917 added -O0\n              replace.CFLAGS = \"\";\n              # https://github.com/cage-kiosk/cage/commit/d3fb99d6654325ec46277cfdb589f89316bed701\n              replace.mesonFlags = lib.remove \"-Dxwayland=true\" (\n                lib.remove \"-Dxwayland=false\" prev.cage.mesonFlags\n              );\n            }\n            {\n              attrName = \"wob\";\n              extra.buildInputs = [\n                prev.pixman\n                prev.cmocka\n              ];\n            }\n            {\n              attrName = \"libvncserver_master\";\n              nixpkgsAttrName = \"libvncserver\";\n              # The version in nixpkgs has different paths so the patch is updated here.\n              replace.patches = [ ./pkgs/libvncserver_master/pkgconfig.patch ];\n            }\n            {\n              attrName = \"wayvnc\";\n              nixpkgsAttrName = \"wayvnc\";\n              extra.buildInputs = [ prev.jansson ];\n            }\n            {\n              attrName = \"eww\";\n              nixpkgsAttrName = \"eww\";\n              extra.buildInputs = [\n                prev.libdbusmenu\n                prev.libdbusmenu-gtk3\n              ];\n              # patch was applied upstream\n              replace.cargoPatches = [ ];\n              # cargoPatches is addded to patches\n              replace.patches = [ ];\n            }\n            {\n              attrName = \"wf-recorder\";\n              replace.patches = [];\n              extra.buildInputs = [\n                prev.mesa\n                prev.pipewire\n              ];\n            }\n            {\n              attrName = \"xdg-desktop-portal-wlr\";\n              nixpkgsAttrName = \"xdg-desktop-portal-wlr\";\n              replace.patches = [ ];\n            }\n            {\n              attrName = \"new-wayland-protocols\";\n              nixpkgsAttrName = \"wayland-protocols\";\n            }\n            # {\n            #   attrName = \"wl-screenrec\";\n            #   # soon in nixpkgs\n            #   extra.buildInputs = [ prev.libdrm ];\n            #   replace.doCheck = false;\n            # }\n            {\n              attrName = \"wbg\";\n              extra.buildInputs = [\n                prev.libjxl\n                prev.pixman\n              ];\n            }\n            {\n              attrName = \"dunst\";\n              # remove once nixpkgs is above 1.11.1\n              replace = previousAttrs: {\n                postInstall =\n                  builtins.replaceStrings\n                    [\n                      ''\n                        substituteInPlace $out/share/zsh/site-functions/_dunstctl $out/share/fish/vendor_completions.d/{dunstctl,dunstify} \\\n                          --replace-fail \"jq\" \"${lib.getExe prev.jq}\"\n                      ''\n                    ]\n                    [\n                      ''\n                        substituteInPlace $out/share/zsh/site-functions/_dunstctl $out/share/fish/vendor_completions.d/{dunstctl,dunstify}.fish \\\n                          --replace-fail \"jq\" \"${lib.getExe prev.jq}\"\n                      ''\n                    ]\n                    previousAttrs.postInstall;\n              };\n            }\n            {\n              attrName = \"neatvnc\";\n              replace.patches = [];\n              replaceInput = {\n                ffmpeg = prev.ffmpeg_7;\n              };\n            }\n            {\n              attrName = \"waypipe\";\n              extra = {\n                depsBuildBuild = [ prev.pkg-config ];\n                nativeBuildInputs = [ prev.pkg-config prev.wayland-scanner ];\n                buildInputs = [ prev.wayland ];\n              };\n            }\n          ];\n\n          # these do not need changes from the package that nixpkgs has\n          attrsNoExtraChangesNeeded = lib.attrValues (\n            lib.genAttrs\n              [\n                \"gebaar-libinput\"\n                \"glpaper\"\n                \"imv\"\n                \"mako\"\n                \"slurp\"\n                \"swaybg\"\n                \"swayidle\"\n                \"swaylock-effects\"\n                \"wl-clipboard\"\n                \"wlogout\"\n                \"wlr-randr\"\n                \"wofi\"\n                \"wtype\"\n                \"wshowkeys\"\n                \"aml\"\n                \"wdisplays\"\n                \"kanshi\"\n                \"wev\"\n                \"lavalauncher\"\n                \"wlsunset\"\n                \"rootbar\"\n                \"sirula\"\n                \"swww\"\n                \"wlay\"\n                \"i3status-rust\"\n                \"shotman\"\n              ]\n              (s: {\n                attrName = s;\n              })\n          );\n\n          waylandPkgs = genPackagesGH // rec {\n            # wlroots-related\n            salut = prev.callPackage ./pkgs/salut { };\n            wlvncc = prev.callPackage ./pkgs/wlvncc { libvncserver = final.libvncserver_master; };\n            obs-wlrobs = template {\n              nixpkgsAttrName = \"obs-studio-plugins.wlrobs\";\n              attrName = \"obs-wlrobs\";\n            };\n            # the above should actually be, but there's eval error and doing\n            # 'nix build -f packages.nix' would build all packages in obs-studio-plugins\n            # obs-studio-plugins = prev.obs-studio-plugins // {\n            #   wlrobs = template {\n            #     nixpkgsAttrName = \"obs-studio-plugins.wlrobs\";\n            #     attrName = \"wlrobs\";\n            #   };\n            # };\n            wldash = prev.callPackage ./pkgs/wldash { };\n            wlroots = prev.callPackage ./pkgs/wlroots {\n              wlroots = prev.wlroots_0_18;\n              wayland-protocols = final.new-wayland-protocols;\n            };\n\n            wl-gammarelay-rs = prev.callPackage ./pkgs/wl-gammarelay-rs { };\n\n            freerdp3 = prev.callPackage ./pkgs/freerdp3 {\n              inherit (prev.darwin.apple_sdk.frameworks)\n                AudioToolbox\n                AVFoundation\n                Carbon\n                Cocoa\n                CoreMedia\n                ;\n              inherit (prev.gst_all_1) gstreamer gst-plugins-base gst-plugins-good;\n            };\n\n            # misc\n            foot = prev.callPackage ./pkgs/foot { inherit foot; };\n          };\n        in\n        waylandPkgs // { inherit waylandPkgs; };\n    in\n    lib.flake-utils.eachSystem\n      [\n        \"aarch64-linux\"\n        \"x86_64-linux\"\n        \"riscv64-linux\"\n      ]\n      (\n        system:\n        let\n          pkgsFor =\n            pkgs: overlays:\n            import pkgs {\n              inherit system overlays;\n              config.allowUnfree = true;\n              config.allowAliases = false;\n            };\n          pkgs_ = lib.genAttrs (builtins.attrNames inputs) (inp: pkgsFor inputs.\"${inp}\" [ ]);\n          opkgs_ = overlays: lib.genAttrs (builtins.attrNames inputs) (inp: pkgsFor inputs.\"${inp}\" overlays);\n          waypkgs = (opkgs_ [ self.overlays.default ]).nixpkgs;\n        in\n        rec {\n          devShells.default = pkgs_.nixpkgs.mkShell {\n            nativeBuildInputs = with pkgs_.nixpkgs; [\n              nix\n              nushell\n              cachix\n              cacert\n              git\n              mercurial\n              ripgrep\n              sd\n            ];\n          };\n\n          formatter = pkgs_.nixpkgs.nixfmt;\n\n          bundle = pkgs_.nixpkgs.symlinkJoin {\n            name = \"nixpkgs-wayland-bundle\";\n            paths = builtins.attrValues (\n              lib.filterAttrs (_: v: lib.meta.availableOn pkgs_.nixpkgs.stdenv.hostPlatform v) waypkgs.waylandPkgs\n            );\n          };\n\n          packages = waypkgs.waylandPkgs // {\n            default = bundle;\n          };\n        }\n      )\n    // {\n      # overlays have to be outside of eachSystem block\n      overlay = waylandOverlay;\n\n      overlays.default = waylandOverlay;\n    };\n}\n"
  },
  {
    "path": "main.nu",
    "content": "#!/usr/bin/env nu\n\nlet system = \"x86_64-linux\";\nlet forceCheck = false; # use for development to re-update all pkgs\n\n$env.CACHIX_CACHE = (\n  if \"CACHIX_CACHE\" in $env { $env.CACHIX_CACHE }\n  else \"nixpkgs-wayland\"\n)\n\n$env.CACHIX_SIGNING_KEY = (\n  if \"CACHIX_SIGNING_KEY_NIXPKGS_WAYLAND\" in $env { $env.CACHIX_SIGNING_KEY_NIXPKGS_WAYLAND }\n  else \"null\"\n)\n\ndef getBadHash [ attrName: string ] {\n  let val = ((do -i { ^nix build --no-link $attrName }| complete)\n      | get stderr\n      | split row \"\\n\"\n      | where ($it | str contains \"got:\")\n      | str replace --regex '\\s+got:(.*)(sha256-.*)' '$2'\n      | get 0\n  )\n  $val\n}\n\ndef replaceHash [ packageName: string, position: string, hashName: string, oldHash: string ] {\n  let fakeSha256 = \"0000000000000000000000000000000000000000000000000000\";\n\n  do -c { ^sd -s $\"($oldHash)\" $\"($fakeSha256)\" $\"($position)\" }\n  let newHash = (getBadHash $\".#($packageName)\")\n  do -c { ^sd -s $\"($fakeSha256)\" $\"($newHash)\" $\"($position)\" }\n\n  print -e {packageName: $packageName, hashName: $hashName, oldHash: $oldHash, newHash: $newHash}\n}\n\ndef updatePkg [packageName: string] {\n  let position = $\"pkgs/($packageName)/metadata.nix\"\n  let verinfo = (^nix eval --json -f $position | str trim | from json)\n\n  let skip = ((\"skip\" in ($verinfo | transpose | get column0)) and $verinfo.skip)\n  if $skip {\n    print -e $\"(ansi light_yellow) update ($packageName) - (ansi light_cyan_underline)skipped(ansi reset)\"\n  } else {\n    # Try update rev\n    let newrev = (\n      if (\"repo_git\" in ($verinfo | transpose | get column0)) {\n        (do -c {\n          ^git ls-remote $verinfo.repo_git $\"refs/heads/($verinfo.branch)\"\n        } | complete | get stdout | str trim | str replace --regex '(\\s+)(.*)$' \"\")\n      } else if ( \"repo_hg\" in ($verinfo | transpose | get column0) ) {\n        (do -c {\n          ^hg identify $verinfo.repo_hg -r $verinfo.branch\n        } | complete | get stdout | str trim)\n      } else {\n        error make { msg: \"unknown repo type\" }\n      }\n    )\n\n    let shouldUpdate = (if ($forceCheck) {\n      print -e $\"(ansi light_yellow) update ($packageName) - (ansi light_yellow_underline)forced(ansi reset)\"\n      true\n    } else if ($newrev != $verinfo.rev) {\n      print -e $\"(ansi light_yellow) update ($packageName) - (ansi light_yellow_underline)update to ($newrev)(ansi reset)\"\n      true\n    } else {\n      print -e $\"(ansi dark_gray) update ($packageName) - noop(ansi reset)\"\n      false\n    })\n\n    if ($shouldUpdate) {\n      do -c { ^sd -s $\"($verinfo.rev)\" $\"($newrev)\" $\"($position)\" }\n      print -e {packageName: $packageName, oldrev: $verinfo.rev, newrev: $newrev}\n\n      replaceHash $packageName $position \"sha256\" $verinfo.sha256\n      if \"vendorSha256\" in ($verinfo | transpose | get column0) {\n        replaceHash $packageName $position \"vendorSha256\" $verinfo.vendorSha256\n      }\n\n      do -c {\n        ^git commit $position -m $\"auto-update: ($packageName): ($verinfo.rev) => ($newrev)\"\n      } | complete\n    }\n\n    null\n  } # end !skip\n}\n\ndef updatePkgs [] {\n  let pkgs = (^nix eval --json $\".#packages.($system)\" --apply 'x: builtins.attrNames x' | str trim | from json)\n  let pkgs = ($pkgs | where ($it != \"default\"))\n  for pkg in $pkgs {\n    updatePkg $pkg\n  }\n}\n\ndef \"main rereadme\" [] {\n  let color = \"yellow\"\n  let packageNames = (nix eval --json $\".#packages.($system)\" --apply 'x: builtins.attrNames x' | str trim | from json)\n  let pkgList = ($packageNames | where ($it != \"default\"))\n  let delimStart = \"<!--pkgs-start-->\"\n  let delimEnd = \"<!--pkgs-end-->\"\n  let pkgrows = ($pkgList | each { |packageName|\n    let meta = (do -c {\n      nix eval --json $\".#packages.($system).($packageName).meta\" | str trim | from json\n    })\n    let home = (if \"homepage\" in ($meta | transpose | get column0) {\n      $meta.homepage\n    } else { \"__missing__\" })\n    ($\"| [($packageName)]\\(($home)\\) | ($meta.description) |\")\n  })\n  let rows = [\n    $delimStart\n    \"| Package | Description |\"\n    \"| --- | --- |\"\n    $pkgrows\n    $delimEnd\n  ]\n  let tableText = ($rows | flatten | str join \"\\n\")\n\n  let regexString = ([ '(?s)(.*)' $delimStart '(.*)' $delimEnd '(.*)' ] | str join '')\n  let replaceText = $\"\\$1($tableText)\\$3\"\n  ^rg --multiline $regexString \"README.md\" --replace $replaceText | save --raw README2.md\n  mv -f README2.md README.md\n\n  do -i { ^git commit -m \"auto-update: updated readme\" \"./README.md\" }\n}\n\ndef flakeAdvance [] {\n  ^nix flake update --recreate-lock-file --commit-lock-file\n}\n\ndef gitPush [] {\n  print -e \":: git push origin HEAD\"\n  ^git push origin HEAD\n}\n\ndef \"main build\" [--cache] {\n  print -e \":: nix build bundle (cachix)\"\n  rm -rf result*\n  ^nix build --keep-going '.#bundle.x86_64-linux'\n  if $cache {\n    ^ls -d result* | ^tee \"/dev/stderr\" | cachix push $\"($env.CACHIX_CACHE)\"\n  }\n\n  rm -rf result*\n  print -e \":: nix build devshell-inputDrv (cachix)\"\n  ^nix build --keep-going $\".#devShells.($system).default.inputDerivation\"\n  if $cache {\n    ^ls -d result* | ^tee \"/dev/stderr\" | cachix push $\"($env.CACHIX_CACHE)\"\n  }\n}\n\ndef \"main advance\" [] {\n  flakeAdvance\n  main build\n  gitPush\n}\n\ndef \"main update\" [packageName?: string] {\n  print -e \":: update\"\n  if $packageName == null {\n    flakeAdvance\n    updatePkgs\n    main build --cache=true\n    main rereadme\n    gitPush\n  } else {\n    updatePkg $packageName\n  }\n}\n\ndef \"main check\" [packageName?: string] {\n  print -e \":: ci checks\"\n  main build --cache=false\n  main rereadme\n}\n\ndef main [] {\n  print -e \"commands: [advance, update, build]\"\n}\n"
  },
  {
    "path": "overlay.nix",
    "content": "# This file provides backward compatibility to nix < 2.4 clients\nlet\n  lock = builtins.fromJSON (builtins.readFile ./flake.lock);\n\n  inherit (lock.nodes.flake-compat.locked)\n    owner\n    repo\n    rev\n    narHash\n    ;\n\n  flake-compat = fetchTarball {\n    url = \"https://github.com/${owner}/${repo}/archive/${rev}.tar.gz\";\n    sha256 = narHash;\n  };\n\n  flake = import flake-compat { src = ./.; };\nin\nflake.defaultNix.overlays.default\n"
  },
  {
    "path": "packages.nix",
    "content": "# This file provides backward compatibility to nix < 2.4 clients\n{\n  system ? builtins.currentSystem,\n}:\nlet\n  lock = builtins.fromJSON (builtins.readFile ./flake.lock);\n\n  inherit (lock.nodes.flake-compat.locked)\n    owner\n    repo\n    rev\n    narHash\n    ;\n\n  flake-compat = fetchTarball {\n    url = \"https://github.com/${owner}/${repo}/archive/${rev}.tar.gz\";\n    sha256 = narHash;\n  };\n\n  flake = import flake-compat {\n    inherit system;\n    src = ./.;\n  };\nin\nflake.defaultNix.packages.${builtins.currentSystem}\n"
  },
  {
    "path": "pkgs/aml/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"any1\";\n  repo = \"aml\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"685035c9830aa89df02a43df89b644690bd885f5\";\n  sha256 = \"sha256-10gm6YphZrpLShj3NUj/AG24dSVLZAZbbnXr7GiF4DI=\";\n}\n"
  },
  {
    "path": "pkgs/cage/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"Hjdskes\";\n  repo = \"cage\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"2e593fe5a8a2186a558ceb414674775e4ba5d2b1\";\n  sha256 = \"sha256-AgBlauOEQvLr4+LMoLRa8rcS4GDtwOFd9flBHyLUhxE=\";\n}\n"
  },
  {
    "path": "pkgs/drm_info/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"ascent12\";\n  repo = \"drm_info\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"e9cabcd98038e4e97e4b10d20be81df0f153d793\";\n  sha256 = \"sha256-RxT+i/syPdiOjQexY4sFKUCs10RK12AfYK8CW1woMy0=\";\n}\n"
  },
  {
    "path": "pkgs/dunst/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"dunst-project\";\n  repo = \"dunst\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"ee63a720acad34f62567a1ae6a8e7b0636e56a50\";\n  sha256 = \"sha256-tktbQHEl9YmuaeF+dbz8GWnjYBGwcbvrCCx03fXtZNI=\";\n}\n"
  },
  {
    "path": "pkgs/eww/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"elkowar\";\n  repo = \"eww\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"fddb4a09b107237819e661151e007b99b5cab36d\";\n  sha256 = \"sha256-PJW4LvW9FmkG9HyUtgXOq7MDjYtBc/iJuOxyf29nD0Y=\";\n}\n"
  },
  {
    "path": "pkgs/foot/default.nix",
    "content": "{\n  stdenv,\n  lib,\n  fetchFromGitea,\n  fetchurl,\n  runCommand,\n  fcft,\n  freetype,\n  pixman,\n  libxkbcommon,\n  fontconfig,\n  wayland,\n  meson,\n  ninja,\n  ncurses,\n  scdoc,\n  tllist,\n  wayland-protocols,\n  wayland-scanner,\n  pkg-config,\n  utf8proc,\n  allowPgo ? !stdenv.hostPlatform.isMusl,\n  python3, # for PGO\n  # for clang stdenv check\n  foot,\n  llvmPackages,\n}:\n\nlet\n  metadata = import ./metadata.nix;\n\n  pname = \"foot\";\n  version = metadata.rev;\n  src = fetchFromGitea {\n    domain = \"codeberg.org\";\n    owner = \"dnkl\";\n    repo = pname;\n    rev = version;\n    inherit (metadata) sha256;\n  };\n\n  # build stimuli file for PGO build and the script to generate it\n  # independently of the foot's build, so we can cache the result\n  # and avoid unnecessary rebuilds as it can take relatively long\n  # to generate\n  #\n  # For every bump, make sure that the hash is still accurate.\n  stimulusGenerator = stdenv.mkDerivation {\n    name = \"foot-generate-alt-random-writes\";\n\n    src = \"${src}/scripts/generate-alt-random-writes.py\";\n\n    dontUnpack = true;\n\n    buildInputs = [ python3 ];\n\n    installPhase = ''\n      install -Dm755 $src $out\n    '';\n  };\n\n  stimuliFile = runCommand \"pgo-stimulus-file\" { } ''\n    ${stimulusGenerator} \\\n      --rows=67 --cols=135 \\\n      --scroll --scroll-region \\\n      --colors-regular --colors-bright --colors-256 --colors-rgb \\\n      --attr-bold --attr-italic --attr-underline \\\n      --sixel \\\n      --seed=2305843009213693951 \\\n      $out\n  '';\n\n  compilerName =\n    if stdenv.cc.isClang then\n      \"clang\"\n    else if stdenv.cc.isGNU then\n      \"gcc\"\n    else\n      \"unknown\";\n\n  # https://codeberg.org/dnkl/foot/src/branch/master/INSTALL.md#performance-optimized-pgo\n  pgoCflags =\n    {\n      \"clang\" = \"-O3 -Wno-ignored-optimization-argument\";\n      \"gcc\" = \"-O3\";\n    }\n    .\"${compilerName}\";\n\n  # ar with lto support\n  ar =\n    stdenv.cc.bintools.targetPrefix\n    + {\n      \"clang\" = \"llvm-ar\";\n      \"gcc\" = \"gcc-ar\";\n      \"unknown\" = \"ar\";\n    }\n    .\"${compilerName}\";\n\n  # PGO only makes sense if we are not cross compiling and\n  # using a compiler which foot's PGO build supports (clang or gcc)\n  doPgo = allowPgo && (stdenv.hostPlatform == stdenv.buildPlatform) && compilerName != \"unknown\";\n\n  terminfoDir = \"${placeholder \"terminfo\"}/share/terminfo\";\nin\nstdenv.mkDerivation {\n  inherit version pname src;\n\n  separateDebugInfo = true;\n\n  depsBuildBuild = [\n    pkg-config\n  ];\n\n  nativeBuildInputs =\n    [\n      wayland-scanner\n      meson\n      ninja\n      ncurses\n      scdoc\n      pkg-config\n    ]\n    ++ lib.optionals (compilerName == \"clang\") [\n      stdenv.cc.cc.libllvm.out\n    ];\n\n  buildInputs = [\n    tllist\n    wayland-protocols\n    fontconfig\n    freetype\n    pixman\n    wayland\n    libxkbcommon\n    fcft\n    utf8proc\n  ];\n\n  # recommended build flags for performance optimized foot builds\n  # https://codeberg.org/dnkl/foot/src/branch/master/INSTALL.md#release-build\n  CFLAGS = if !doPgo then \"-O3\" else pgoCflags;\n\n  # ar with gcc plugins for lto objects\n  preConfigure = ''\n    export AR=\"${ar}\"\n  '';\n\n  mesonBuildType = \"release\";\n\n  # See https://codeberg.org/dnkl/foot/src/tag/1.9.2/INSTALL.md#options\n  mesonFlags = [\n    # Use lto\n    \"-Db_lto=true\"\n    # “Build” and install terminfo db\n    \"-Dterminfo=enabled\"\n    # Ensure TERM=foot is used\n    \"-Ddefault-terminfo=foot\"\n    # Tell foot to set TERMINFO and where to install the terminfo files\n    \"-Dcustom-terminfo-install-location=${terminfoDir}\"\n    # Install systemd user units for foot-server\n    \"-Dsystemd-units-dir=${placeholder \"out\"}/lib/systemd/user\"\n    # Especially -Wunused-command-line-argument is a problem with clang\n    \"-Dwerror=false\"\n  ];\n\n  # build and run binary generating PGO profiles,\n  # then reconfigure to build the normal foot binary utilizing PGO\n  preBuild =\n    lib.optionalString doPgo ''\n      meson configure -Db_pgo=generate\n      ninja\n      # make sure there is _some_ profiling data on all binaries\n      meson test\n      ./footclient --version\n      ./foot --version\n      ./utils/xtgettcap\n      # generate pgo data of wayland independent code\n      ./pgo ${stimuliFile} ${stimuliFile} ${stimuliFile}\n      meson configure -Db_pgo=use\n    ''\n    + lib.optionalString (doPgo && compilerName == \"clang\") ''\n      llvm-profdata merge default_*profraw --output=default.profdata\n    '';\n\n  # Install example themes which can be added to foot.ini via the include\n  # directive to a separate output to save a bit of space\n  postInstall = ''\n    moveToOutput share/foot/themes \"$themes\"\n  '';\n\n  doCheck = true;\n\n  strictDeps = true;\n\n  outputs = [\n    \"out\"\n    \"terminfo\"\n    \"themes\"\n  ];\n\n  passthru.tests = {\n    clang-default-compilation = foot.override {\n      inherit (llvmPackages) stdenv;\n    };\n\n    noPgo = foot.override {\n      allowPgo = false;\n    };\n\n    # By changing name, this will get rebuilt everytime we change version,\n    # even if the hash stays the same. Consequently it'll fail if we introduce\n    # a hash mismatch when updating.\n    stimulus-script-is-current = stimulusGenerator.src.overrideAttrs (_: {\n      name = \"generate-alt-random-writes-${version}.py\";\n    });\n  };\n\n  meta = with lib; {\n    homepage = \"https://codeberg.org/dnkl/foot/\";\n    changelog = \"https://codeberg.org/dnkl/foot/releases/tag/${version}\";\n    description = \"Fast, lightweight and minimalistic Wayland terminal emulator\";\n    license = licenses.mit;\n    maintainers = [\n      maintainers.sternenseemann\n      maintainers.abbe\n    ];\n    platforms = platforms.linux;\n    mainProgram = \"foot\";\n  };\n}\n"
  },
  {
    "path": "pkgs/foot/metadata.nix",
    "content": "rec {\n  type = \"gitea\";\n  domain = \"codeberg.org\";\n  owner = \"dnkl\";\n  repo = \"foot\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"72d9a13c0c6b6ee4b56a38f508c2e8d5c56616b5\";\n  sha256 = \"sha256-cUUoAVBtlhnZJWfuCYqHjjYKIpKf9JBHcE5YCi5WscI=\";\n}\n"
  },
  {
    "path": "pkgs/freerdp3/default.nix",
    "content": "{\n  stdenv,\n  lib,\n  fetchFromGitHub,\n  cmake,\n  docbook-xsl-nons,\n  libxslt,\n  pkg-config,\n  alsa-lib,\n  faac,\n  faad2,\n  ffmpeg,\n  glib,\n  openh264,\n  openssl,\n  pcre2,\n  zlib,\n  libX11,\n  libXcursor,\n  libXdamage,\n  libXdmcp,\n  libXext,\n  libXi,\n  libXinerama,\n  libXrandr,\n  libXrender,\n  libXtst,\n  libXv,\n  libxkbcommon,\n  libxkbfile,\n  libv4l,\n  wayland,\n  wayland-scanner,\n  gstreamer,\n  gst-plugins-base,\n  gst-plugins-good,\n  libunwind,\n  orc,\n  cairo,\n  libusb1,\n  libpulseaudio,\n  cups,\n  pcsclite,\n  systemd,\n  libjpeg_turbo,\n  icu,\n  SDL2,\n  SDL2_ttf,\n  krb5,\n  cjson,\n  pkcs11helper,\n  webkitgtk_4_1,\n  buildServer ? true,\n  nocaps ? false,\n  AudioToolbox,\n  AVFoundation,\n  Carbon,\n  Cocoa,\n  CoreMedia,\n  fuse3,\n  withUnfree ? false,\n}:\n\nlet\n  metadata = import ./metadata.nix;\n  cmFlag = flag: if flag then \"ON\" else \"OFF\";\n  disabledTests = lib.optionals stdenv.isDarwin [\n    {\n      dir = \"winpr/libwinpr/sysinfo/test\";\n      file = \"TestGetComputerName.c\";\n    }\n  ];\n\n  inherit (lib) optionals;\nin\nstdenv.mkDerivation rec {\n  pname = \"freerdp\";\n  version = metadata.rev;\n\n  src = fetchFromGitHub {\n    owner = \"FreeRDP\";\n    repo = \"FreeRDP\";\n    inherit (metadata) rev sha256;\n  };\n\n  postPatch =\n    ''\n      export HOME=$TMP\n\n      # skip NIB file generation on darwin\n      sed -z 's/NIB file generation.*//' -i client/Mac{,/cli}/CMakeLists.txt\n\n      # failing test(s)\n      ${lib.concatMapStringsSep \"\\n\" (e: ''\n        substituteInPlace ${e.dir}/CMakeLists.txt \\\n          --replace ${e.file} \"\"\n        rm ${e.dir}/${e.file}\n      '') disabledTests}\n\n      substituteInPlace \"libfreerdp/freerdp.pc.in\" \\\n        --replace \"Requires:\" \"Requires: @WINPR_PKG_CONFIG_FILENAME@\"\n    ''\n    + lib.optionalString (pcsclite != null) ''\n      substituteInPlace \"winpr/libwinpr/smartcard/smartcard_pcsc.c\" \\\n        --replace \"libpcsclite.so\" \"${lib.getLib pcsclite}/lib/libpcsclite.so\"\n    ''\n    + lib.optionalString nocaps ''\n      substituteInPlace \"libfreerdp/locale/keyboard_xkbfile.c\" \\\n        --replace \"RDP_SCANCODE_CAPSLOCK\" \"RDP_SCANCODE_LCONTROL\"\n    '';\n\n  buildInputs =\n    [\n      cairo\n      cups\n      faad2\n      ffmpeg\n      fuse3\n      glib\n      gst-plugins-base\n      gst-plugins-good\n      gstreamer\n      icu\n      libX11\n      libXcursor\n      libXdamage\n      libXdmcp\n      libXext\n      libXi\n      libXinerama\n      libXrandr\n      libXrender\n      libXtst\n      libXv\n      libjpeg_turbo\n      libpulseaudio\n      libunwind\n      libusb1\n      libxkbcommon\n      libxkbfile\n      openh264\n      openssl\n      orc\n      pcre2\n      pcsclite\n      zlib\n      SDL2\n      SDL2_ttf\n      krb5\n      cjson\n      pkcs11helper\n      webkitgtk_4_1\n    ]\n    ++ optionals stdenv.isLinux [\n      alsa-lib\n      libv4l\n      systemd\n      wayland\n    ]\n    ++ optionals stdenv.isDarwin [\n      AudioToolbox\n      AVFoundation\n      Carbon\n      Cocoa\n      CoreMedia\n    ]\n    ++ optionals withUnfree [ faac ];\n\n  nativeBuildInputs = [\n    cmake\n    libxslt\n    docbook-xsl-nons\n    pkg-config\n  ] ++ optionals stdenv.isLinux [\n    wayland-scanner\n  ];\n\n  doCheck = true;\n\n  # https://github.com/FreeRDP/FreeRDP/issues/8526#issuecomment-1357134746\n  cmakeFlags =\n    [\n      \"-Wno-dev\"\n      \"-DCMAKE_INSTALL_LIBDIR=lib\"\n      \"-DDOCBOOKXSL_DIR=${docbook-xsl-nons}/xml/xsl/docbook\"\n    ]\n    ++ lib.mapAttrsToList (k: v: \"-D${k}=${cmFlag v}\") {\n      BUILD_TESTING = false; # false is recommended by upstream\n      WITH_CAIRO = cairo != null;\n      WITH_CUPS = cups != null;\n      WITH_FAAC = withUnfree && faac != null;\n      WITH_FAAD2 = faad2 != null;\n      WITH_JPEG = libjpeg_turbo != null;\n      WITH_OPENH264 = openh264 != null;\n      WITH_OSS = false;\n      WITH_PCSC = pcsclite != null;\n      WITH_PULSE = libpulseaudio != null;\n      WITH_SERVER = buildServer;\n      WITH_VAAPI = false; # false is recommended by upstream\n      WITH_X11 = true;\n    };\n\n  env = {\n    NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin \"-DTARGET_OS_IPHONE=0 -DTARGET_OS_WATCH=0 -include AudioToolbox/AudioToolbox.h\";\n\n    NIX_LDFLAGS = lib.optionalString stdenv.isDarwin \"-framework AudioToolbox\";\n  };\n\n  meta = with lib; {\n    description = \"A Remote Desktop Protocol Client\";\n    longDescription = ''\n      FreeRDP is a client-side implementation of the Remote Desktop Protocol (RDP)\n      following the Microsoft Open Specifications.\n    '';\n    homepage = \"https://www.freerdp.com/\";\n    license = licenses.asl20;\n    maintainers = with maintainers; [ peterhoeg ];\n    platforms = platforms.unix;\n  };\n}\n"
  },
  {
    "path": "pkgs/freerdp3/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"FreeRDP\";\n  repo = \"FreeRDP\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"6111ac458c041e7d21d88910deb2f061317a743f\";\n  sha256 = \"sha256-yOkJ1uT8CwnhsjAR2E9nD2F+FXFm3ZbZFVY4913rVI4=\";\n  # Can't find SDL2 started in https://github.com/FreeRDP/FreeRDP/pull/10996 probably\n  skip = true;\n}\n"
  },
  {
    "path": "pkgs/gebaar-libinput/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"Osleg\";\n  repo = \"gebaar-libinput-fork\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"6ce14eb64a9f4bb8201bae26052521ae5e64f553\";\n  sha256 = \"sha256-NwF9TOJ6SzJJBa7mrUOCLEhz2xf0it7rVuOzhqvDwt0=\";\n}\n"
  },
  {
    "path": "pkgs/glpaper/metadata.nix",
    "content": "rec {\n  type = \"hgsourcehut\";\n  domain = \"hg.sr.ht\";\n  owner = \"~scoopta\";\n  repo = \"glpaper\";\n  repo_hg = \"https://${domain}/${owner}/${repo}\";\n  branch = \"default\";\n  rev = \"af9827d20bfe\";\n  sha256 = \"sha256-zgvnWqsw243jZ9e6fG6L0hDfRRHwzmIdsxwnnWhimu0=\";\n}\n"
  },
  {
    "path": "pkgs/grim/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"emersion\";\n  repo = \"grim\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"47e2658619c6b5a790732c5876fb84e8273f08a9\";\n  sha256 = \"sha256-X3NHAFe27hnjM6YQ5YsFJWkGYe+mRAFUjiR20R5tTAQ=\";\n}\n"
  },
  {
    "path": "pkgs/gtk-layer-shell/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"wmww\";\n  repo = \"gtk-layer-shell\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"2a8ddaa09844ba78783c95d288300a1d8a93e429\";\n  sha256 = \"sha256-+vJouQEauTe/dp2WdOJcc2Byv1+Hb0iaUgwBPnV9g48=\";\n}\n"
  },
  {
    "path": "pkgs/i3status-rust/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"greshake\";\n  repo = \"i3status-rust\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"bb1a479bbb77cf6b390be87f948a3b4f756fa8c0\";\n  sha256 = \"sha256-utEFjWCyCbp5Jw1+NP4abaCuEGGKXrjZhSWqdTaxYHI=\";\n}\n"
  },
  {
    "path": "pkgs/imv/metadata.nix",
    "content": "rec {\n  type = \"gitsourcehut\";\n  domain = \"git.sr.ht\";\n  owner = \"~exec64\";\n  repo = \"imv\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"8f36d35ff6a844de7d338a4e9b34bc98f114014b\";\n  sha256 = \"sha256-aJ2EXgsS0WUTxMqC1Q+uOWLG8BeuwAyXPmJB/9/NCCU=\";\n}\n"
  },
  {
    "path": "pkgs/kanshi/metadata.nix",
    "content": "rec {\n  type = \"gitsourcehut\";\n  domain = \"git.sr.ht\";\n  owner = \"~emersion\";\n  repo = \"kanshi\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"00a653a9c5172a7fe97c4669f63703ac4a681007\";\n  sha256 = \"sha256-14n7k3GWghRfqjA7BwRofkUeajo2XH0fWAaICSc7pAM=\";\n}\n"
  },
  {
    "path": "pkgs/lavalauncher/metadata.nix",
    "content": "rec {\n  type = \"gitsourcehut\";\n  domain = \"git.sr.ht\";\n  owner = \"~leon_plickat\";\n  repo = \"lavalauncher\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"da17d8a29bfc6b78280242b8fdbcb1b6df4f8aff\";\n  sha256 = \"sha256-hobhZ6s9m2xCdAurdj0EF1BeS88j96133zu+2jb1FMM=\";\n}\n"
  },
  {
    "path": "pkgs/libvncserver_master/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"LibVNC\";\n  repo = \"libvncserver\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"4c15a85d448c33f08ddd3d713672c70ea507f5ee\";\n  sha256 = \"sha256-YHe4DYlYNy1L7KzfvdVlLDxEi8we3UezEAaMSBfIhhc=\";\n}\n"
  },
  {
    "path": "pkgs/libvncserver_master/pkgconfig.patch",
    "content": "diff --git a/src/libvncclient/libvncclient.pc.cmakein b/src/libvncclient/libvncclient.pc.cmakein\nindex ceeda39d..2516e643 100644\n--- a/src/libvncclient/libvncclient.pc.cmakein\n+++ b/src/libvncclient/libvncclient.pc.cmakein\n@@ -1,7 +1,7 @@\n prefix=@CMAKE_INSTALL_PREFIX@\n exec_prefix=@CMAKE_INSTALL_PREFIX@\n-libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@\n-includedir=@CMAKE_INSTALL_PREFIX@/include\n+libdir=@CMAKE_INSTALL_FULL_LIBDIR@\n+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@\n\n Name: LibVNCClient\n Description: A library for easy implementation of a VNC client.\ndiff --git a/src/libvncserver/libvncserver.pc.cmakein b/src/libvncserver/libvncserver.pc.cmakein\nindex 33ec6685..57244742 100644\n--- a/src/libvncserver/libvncserver.pc.cmakein\n+++ b/src/libvncserver/libvncserver.pc.cmakein\n@@ -1,7 +1,7 @@\n prefix=@CMAKE_INSTALL_PREFIX@\n exec_prefix=@CMAKE_INSTALL_PREFIX@\n-libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@\n-includedir=@CMAKE_INSTALL_PREFIX@/include\n+libdir=@CMAKE_INSTALL_FULL_LIBDIR@\n+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@\n\n Name: LibVNCServer\n Description: A library for easy implementation of a VNC server.\n"
  },
  {
    "path": "pkgs/mako/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"emersion\";\n  repo = \"mako\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"84637d1cb42def0ef74d6ec961e05c3900b4c23f\";\n  sha256 = \"sha256-5Mv0P/SoUiJIiYvGm5wvNZhtz2ytwsqqRc3Pk3ju0WA=\";\n}\n"
  },
  {
    "path": "pkgs/neatvnc/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"any1\";\n  repo = \"neatvnc\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"4962e0af5d550b2c4fd34c79dbdca543f233d87c\";\n  sha256 = \"sha256-6xHasCH27useFWYPzDlUe0eaZ81WZu4JtftPb+ks+kk=\";\n}\n"
  },
  {
    "path": "pkgs/new-wayland-protocols/metadata.nix",
    "content": "rec {\n  type = \"gitlab\";\n  domain = \"gitlab.freedesktop.org\";\n  owner = \"wayland\";\n  repo = \"wayland-protocols\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"main\";\n  rev = \"6a73aacd7c04a1e40d64ce28d48fe10df550b6fb\";\n  sha256 = \"sha256-ykzFUVSg8kCkhYwO8IBiwiCAURumU5bQqqjn2gHi1sA=\";\n}\n"
  },
  {
    "path": "pkgs/obs-wlrobs/metadata.nix",
    "content": "rec {\n  type = \"hgsourcehut\";\n  domain = \"hg.sr.ht\";\n  owner = \"~scoopta\";\n  repo = \"wlrobs\";\n  repo_hg = \"https://${domain}/${owner}/${repo}\";\n  branch = \"default\";\n  rev = \"b8668b4d6d6d\";\n  sha256 = \"sha256-gqGnDrfID5hTcpX3EkSGg4yDwa/ZKCQCqJ3feq44I1I=\";\n}\n"
  },
  {
    "path": "pkgs/rootbar/metadata.nix",
    "content": "rec {\n  type = \"hgsourcehut\";\n  domain = \"hg.sr.ht\";\n  owner = \"~scoopta\";\n  repo = \"rootbar\";\n  repo_hg = \"https://${domain}/${owner}/${repo}\";\n  branch = \"default\";\n  rev = \"36333af9fd8d\";\n  sha256 = \"sha256-CpORCSJyHZhcK14EhjxoPt/h0026NU5J/kicL1dX96o=\";\n}\n"
  },
  {
    "path": "pkgs/salut/default.nix",
    "content": "{\n  lib,\n  rustPlatform,\n  fetchFromGitLab,\n  pkg-config,\n  libxkbcommon,\n  fontconfig,\n}:\n\nlet\n  metadata = import ./metadata.nix;\nin\nrustPlatform.buildRustPackage rec {\n  pname = \"salut\";\n  version = metadata.rev;\n\n  src = fetchFromGitLab {\n    inherit (metadata)\n      owner\n      repo\n      rev\n      sha256\n      ;\n  };\n\n  cargoLock = {\n    lockFile = src + \"/Cargo.lock\";\n    allowBuiltinFetchGit = true;\n  };\n\n  nativeBuildInputs = [ pkg-config ];\n\n  buildInputs = [\n    libxkbcommon\n    fontconfig\n  ];\n\n  meta = with lib; {\n    description = \"A sleek notification daemon\";\n    homepage = \"https://gitlab.com/snakedye/salut\";\n    license = licenses.mpl20;\n  };\n}\n"
  },
  {
    "path": "pkgs/salut/metadata.nix",
    "content": "rec {\n  owner = \"snakedye\";\n  repo = \"salut\";\n  repo_git = \"https://gitlab.com/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"aa57c4d190812908a9c32cd49cff14390c6dfdcb\";\n  sha256 = \"sha256-W0lhhImSXtYJDeMbxyEioYu/Bh7ZclwR1/5DzNbxM8o=\";\n}\n"
  },
  {
    "path": "pkgs/shotman/metadata.nix",
    "content": "rec {\n  type = \"gitsourcehut\";\n  domain = \"git.sr.ht\";\n  owner = \"~whynothugo\";\n  repo = \"shotman\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"main\";\n  rev = \"da244d40ac8e60b37c77ecef4fde053cfbb6b82d\";\n  sha256 = \"sha256-j9HNqRJnGiy720uS0zC6Tt1WjF4b6+XqPEMTqTEOD6w=\";\n}\n"
  },
  {
    "path": "pkgs/sirula/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"DorianRudolph\";\n  repo = \"sirula\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"83efe28847060c30be311f6861e71bef6a407718\";\n  sha256 = \"sha256-njXsPgagJwpuqYQ2QxmOQS5SWElouwh1pomf52dYeG4=\";\n}\n"
  },
  {
    "path": "pkgs/slurp/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"emersion\";\n  repo = \"slurp\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"1de937788344c0c2beafd4a264fd8bfcf919bd93\";\n  sha256 = \"sha256-ywQwXK+1B6/TknkRDhOR0rTtQcLn35JK27UM/Ez4aF0=\";\n}\n"
  },
  {
    "path": "pkgs/sway-unwrapped/metadata.nix",
    "content": "rec {\n  upattr = \"sway-unwrapped\";\n  domain = \"github.com\";\n  owner = \"swaywm\";\n  repo = \"sway\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"340505bb6f6ad2418448445fa7e5d58f771c3b4d\";\n  sha256 = \"sha256-AdggynGr51YRzrro1723JTASQJhtUY2hoZLhSLEUppE=\";\n}\n"
  },
  {
    "path": "pkgs/swaybg/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"swaywm\";\n  repo = \"swaybg\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"1bf721fcb61a7c78cc618868640a3ab24c5a3077\";\n  sha256 = \"sha256-AYZGM8EDQvpyv+vVHzihakltSWapSvnxio9yJcBWvRo=\";\n}\n"
  },
  {
    "path": "pkgs/swayidle/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"swaywm\";\n  repo = \"swayidle\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"c5e0e1fd11677b7732c073e1709cf92be9184c04\";\n  sha256 = \"sha256-CWp7YVG1qedSzZR3bO19Ppn1ojKpaB5xRYFw4rdAPUM=\";\n}\n"
  },
  {
    "path": "pkgs/swaylock/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"swaywm\";\n  repo = \"swaylock\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"b0f417c488fd12b1ac9f7c3eea9b49d6221b761d\";\n  sha256 = \"sha256-5JAA8mCY3vOsauvRK2zquBrzA2ROakEfahzp4a6j/Ac=\";\n}\n"
  },
  {
    "path": "pkgs/swaylock-effects/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"jirutka\";\n  repo = \"swaylock-effects\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"496059a8565c2d5eed672c2e5bc5e1edd14b3de8\";\n  sha256 = \"sha256-8RDaa7IvMpG3GK6wd0EPO+lLeQlr5ioVa5oyR9wct1U=\";\n}\n"
  },
  {
    "path": "pkgs/swww/metadata.nix",
    "content": "rec {\n  owner = \"Horus645\";\n  repo = \"swww\";\n  repo_git = \"https://github.com/${owner}/${repo}\";\n  branch = \"main\";\n  rev = \"63d71f2b8c6d1533b5fef748dfc490dd461e343c\";\n  sha256 = \"sha256-KzuedC2yJU56sRBeMlndPuXK6UWHxSUtgAmJ/+Gww6I=\";\n}\n"
  },
  {
    "path": "pkgs/waybar/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"Alexays\";\n  repo = \"Waybar\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"0776e694df56c2c849b682369148210d81324e93\";\n  sha256 = \"sha256-rwN74KZdAQVLdengxHpUwkyaZTdoRzFjJ3SSr6rx2/o=\";\n}\n"
  },
  {
    "path": "pkgs/waypipe/metadata.nix",
    "content": "rec {\n  type = \"gitlab\";\n  domain = \"gitlab.freedesktop.org\";\n  owner = \"mstoeckl\";\n  repo = \"waypipe\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"21639c783328e22faadeb1de8fab5b17b8d36abb\";\n  sha256 = \"sha256-BlKhtnhJkvVHxwW9UNDK7eCda2Awp2+h2TEuTpSWHtA=\";\n}\n"
  },
  {
    "path": "pkgs/wayvnc/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"any1\";\n  repo = \"wayvnc\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"1f7d299a318abd60af29c37b04175429f7a6c060\";\n  sha256 = \"sha256-FC3JT6G+8exK3WT+EmweOf/vrwmARiMnBh3zEuT2ZJs=\";\n}\n"
  },
  {
    "path": "pkgs/wbg/metadata.nix",
    "content": "rec {\n  type = \"gitea\";\n  domain = \"codeberg.org\";\n  owner = \"dnkl\";\n  repo = \"wbg\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"bc00df2244a0d8f88d4051f505ef9aebb51447ca\";\n  sha256 = \"sha256-L+20795gILq4ClmKQFwBd2QJAJdH1sG2YXiTDMEVi7s=\";\n}\n"
  },
  {
    "path": "pkgs/wdisplays/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"artizirk\";\n  repo = \"wdisplays\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"157b8c51e850dc5f6b490f56f35cb101a9054e4c\";\n  sha256 = \"sha256-KabaW2BH4zAS0xWkzCM8YaAnP/hkZL7Wq3EARantRis=\";\n}\n"
  },
  {
    "path": "pkgs/wev/metadata.nix",
    "content": "rec {\n  type = \"gitsourcehut\";\n  domain = \"git.sr.ht\";\n  owner = \"~sircmpwn\";\n  repo = \"wev\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"2a46014ec5e375139f91aed456d5f01065964f86\";\n  sha256 = \"sha256-0ZA44dMDuVYfplfutOfI2EdPNakE9KnOuRfk+CEDCRk=\";\n}\n"
  },
  {
    "path": "pkgs/wf-recorder/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"ammen99\";\n  repo = \"wf-recorder\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"664fc451caa7559a39c2cdd70ff02ea781e2d4b3\";\n  sha256 = \"sha256-poQ8Fe5cjpuf2t9OMI05PmCcFlium+cCiJB55x9jHvs=\";\n}\n"
  },
  {
    "path": "pkgs/wl-clipboard/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"bugaevc\";\n  repo = \"wl-clipboard\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"aaa927ee7f7d91bcc25a3b68f60d01005d3b0f7f\";\n  sha256 = \"sha256-V8JAai4gZ1nzia4kmQVeBwidQ+Sx5A5on3SJGSevrUU=\";\n}\n"
  },
  {
    "path": "pkgs/wl-gammarelay-rs/default.nix",
    "content": "{\n  lib,\n  fetchFromGitHub,\n  rustPlatform,\n}:\n\nlet\n  metadata = import ./metadata.nix;\nin\nrustPlatform.buildRustPackage rec {\n  pname = \"wl-gammarelay-rs\";\n  version = metadata.rev;\n\n  src = fetchFromGitHub {\n    inherit (metadata)\n      owner\n      repo\n      rev\n      sha256\n      ;\n  };\n\n  cargoLock = {\n    lockFile = src + \"/Cargo.lock\";\n    allowBuiltinFetchGit = true;\n  };\n\n  meta = with lib; {\n    description = \"A simple program that provides DBus interface to control display temperature and brightness under wayland without flickering \";\n    homepage = \"https://github.com/MaxVerevkin/wl-gammarelay-rs\";\n    license = licenses.gpl3;\n    maintainers = with maintainers; [ artturin ];\n  };\n}\n"
  },
  {
    "path": "pkgs/wl-gammarelay-rs/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"MaxVerevkin\";\n  repo = \"wl-gammarelay-rs\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"main\";\n  rev = \"1dde760b03a5afd4761af17d8c49b7058cbd800d\";\n  sha256 = \"sha256-WdY90CUtphtUUFAh+daSQGmlWTn28Qc79A5yHTV3IOY=\";\n}\n"
  },
  {
    "path": "pkgs/wl-screenrec/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"russelltg\";\n  repo = \"wl-screenrec\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"main\";\n  rev = \"a3d0b5da69487441ce81ebfc3be8ba8d2255c714\";\n  sha256 = \"sha256-DE0Olwc2hYuGjkA1p1kbEXxMmoWOH7PTrne6pm1z97s=\";\n}\n"
  },
  {
    "path": "pkgs/wlay/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"atx\";\n  repo = \"wlay\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"ed316060ac3ac122c0d3d8918293e19dfe9a6c90\";\n  sha256 = \"sha256-Lu+EyoDHiXK9QzD4jdwbllCOCl2aEU+uK6/KxC2AUGQ=\";\n}\n"
  },
  {
    "path": "pkgs/wldash/default.nix",
    "content": "{\n  lib,\n  rustPlatform,\n  fetchFromGitHub,\n  pkg-config,\n  dbus,\n  libpulseaudio,\n  alsa-lib,\n  libxkbcommon,\n  wayland,\n  fontconfig,\n}:\n\nlet\n  metadata = import ./metadata.nix;\n  libraryPath = lib.makeLibraryPath [\n    wayland\n  ];\nin\nrustPlatform.buildRustPackage rec {\n  pname = \"wldash\";\n  version = metadata.rev;\n\n  src = fetchFromGitHub {\n    owner = \"kennylevinsen\";\n    repo = \"wldash\";\n    inherit (metadata) rev;\n    inherit (metadata) sha256;\n  };\n\n  cargoLock = {\n    lockFile = src + \"/Cargo.lock\";\n    allowBuiltinFetchGit = true;\n  };\n\n  nativeBuildInputs = [ pkg-config ];\n\n  buildInputs = [\n    dbus\n    libpulseaudio\n    alsa-lib\n    fontconfig\n    libxkbcommon\n  ];\n\n  dontPatchELF = true;\n\n  postInstall = ''\n    patchelf --set-rpath ${libraryPath}:$(patchelf --print-rpath $out/bin/wldash) $out/bin/wldash\n  '';\n\n  meta = with lib; {\n    description = \"Wayland launcher/dashboard\";\n    homepage = \"https://wldash.org\";\n    license = licenses.gpl3;\n    maintainers = with maintainers; [ alexarice ];\n    platforms = [\n      \"x86_64-linux\"\n      \"i686-linux\"\n    ];\n  };\n}\n"
  },
  {
    "path": "pkgs/wldash/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"kennylevinsen\";\n  repo = \"wldash\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"1156b3503a04780bbdcb6a781cce87281b8bf87d\";\n  sha256 = \"sha256-1MKZByK2afNHvd2h4ISb2ON6O0XCegBJ+xX3C223PY0=\";\n}\n"
  },
  {
    "path": "pkgs/wlogout/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"ArtsyMacaw\";\n  repo = \"wlogout\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"350fe88bd5fe818b386d503d766fe34b6ba0f87d\";\n  sha256 = \"sha256-/JEuFRKvtXiQPWswbXzFuqivNifP8VVfSKJQWZNbDlw=\";\n}\n"
  },
  {
    "path": "pkgs/wlr-randr/metadata.nix",
    "content": "rec {\n  type = \"gitsourcehut\";\n  domain = \"git.sr.ht\";\n  owner = \"~emersion\";\n  repo = \"wlr-randr\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"3eac217684b8d9da2f9d4ab1784d0227dd04aa4a\";\n  sha256 = \"sha256-ncIUhePR/Njxti2OZU77umNgk60YVGhhOLETpHZgrcI=\";\n}\n"
  },
  {
    "path": "pkgs/wlroots/default.nix",
    "content": "args_@{\n  lib,\n  fetchFromGitLab,\n  wlroots,\n  libdisplay-info,\n  hwdata,\n  lcms2,\n  ...\n}:\n\nlet\n  metadata = import ./metadata.nix;\n  ignore = [\n    \"wlroots\"\n    \"hwdata\"\n    \"libdisplay-info\"\n    \"lcms2\"\n  ];\n  args = lib.filterAttrs (n: _v: (!builtins.elem n ignore)) args_;\nin\n(wlroots.override args).overrideAttrs (old: {\n  version = \"${metadata.rev}\";\n  buildInputs = old.buildInputs ++ [\n    hwdata\n    libdisplay-info\n    lcms2\n  ];\n  src = fetchFromGitLab {\n    inherit (metadata)\n      domain\n      owner\n      repo\n      rev\n      sha256\n      ;\n  };\n})\n"
  },
  {
    "path": "pkgs/wlroots/metadata.nix",
    "content": "rec {\n  domain = \"gitlab.freedesktop.org\";\n  owner = \"wlroots\";\n  repo = \"wlroots\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"12316417b033465114705430105785e72dfe345d\";\n  sha256 = \"sha256-o0a0GBlKnDNZL/vAZN/a+QbZ8NWjD4F2bcQLAaPvkoY=\";\n}\n"
  },
  {
    "path": "pkgs/wlsunset/metadata.nix",
    "content": "rec {\n  type = \"gitsourcehut\";\n  domain = \"git.sr.ht\";\n  owner = \"~kennylevinsen\";\n  repo = \"wlsunset\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"c056294f0f6022abec4eeab2fb7a1732f5a20f08\";\n  sha256 = \"sha256-GhU27nmE6FEDhU1GT1xN6bB7MXePAVK8ZPFlEbHG8VQ=\";\n}\n"
  },
  {
    "path": "pkgs/wlvncc/default.nix",
    "content": "{\n  stdenv,\n  lib,\n  fetchFromGitHub,\n  pkg-config,\n  meson,\n  ninja,\n  wayland,\n  wayland-protocols,\n  wayland-scanner,\n  libxkbcommon,\n  libvncserver,\n  libpthreadstubs,\n  lzo,\n  pixman,\n  libuv,\n  libglvnd,\n  libjpeg,\n  libpng,\n  neatvnc,\n  libX11,\n  libdrm,\n  aml,\n  libgbm,\n  ffmpeg,\n  openssl,\n}:\n\nlet\n  metadata = import ./metadata.nix;\nin\nstdenv.mkDerivation rec {\n  pname = \"wlvncc\";\n  version = metadata.rev;\n\n  src = fetchFromGitHub {\n    owner = \"any1\";\n    repo = \"wlvncc\";\n    inherit (metadata) rev;\n    inherit (metadata) sha256;\n  };\n\n  nativeBuildInputs = [\n    pkg-config\n    wayland-scanner\n    meson\n    ninja\n  ];\n  buildInputs = [\n    wayland\n    wayland-protocols\n    libxkbcommon\n    libvncserver\n    libpthreadstubs\n    lzo\n    pixman\n    libuv\n    libglvnd\n    libjpeg\n    libpng\n    neatvnc\n    libX11\n    libdrm\n    aml\n    libgbm\n    ffmpeg\n    openssl\n  ];\n\n  enableParallelBuilding = true;\n\n  meta = with lib; {\n    description = \"A Wayland Native VNC Client\";\n    homepage = \"https://github.com/any1/wlvncc\";\n    license = licenses.isc;\n    platforms = platforms.linux;\n    maintainers = with maintainers; [ colemickens ];\n  };\n}\n"
  },
  {
    "path": "pkgs/wlvncc/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"any1\";\n  repo = \"wlvncc\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"860232f34a77837915a94078efe8cd527fa582e3\";\n  sha256 = \"sha256-4VaBvocqnDf58RlIgCYwSy1YKlnKmzGU9kTYsxd4y98=\";\n}\n"
  },
  {
    "path": "pkgs/wob/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"francma\";\n  repo = \"wob\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"f7668d9715256a9d0dd05bc9eba7799d5ab2ce2d\";\n  sha256 = \"sha256-tLz2A/RLHkA7iEfCLr22rVcTmnWLVp8BM58MuJ/NGEI=\";\n}\n"
  },
  {
    "path": "pkgs/wofi/metadata.nix",
    "content": "rec {\n  type = \"hgsourcehut\";\n  domain = \"hg.sr.ht\";\n  owner = \"~scoopta\";\n  repo = \"wofi\";\n  repo_hg = \"https://${domain}/${owner}/${repo}\";\n  branch = \"default\";\n  rev = \"ab9ba6305016\";\n  sha256 = \"sha256-XNM1vbdQOcm3pC6wgbTJeBxUqtGGnEi4ljZ6AQEkQ6o=\";\n}\n"
  },
  {
    "path": "pkgs/wshowkeys/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"ammgws\";\n  repo = \"wshowkeys\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"main\";\n  rev = \"e8bfc78f08ebdd1316daae59ecc77e62bba68b2b\";\n  sha256 = \"sha256-/HvNCQWsXOJZeCxHWmsLlbBDhBzF7XP/SPLdDiWMDC4=\";\n}\n"
  },
  {
    "path": "pkgs/wtype/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"atx\";\n  repo = \"wtype\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"d71be3a7b3f93b534a2823fd68cabd7ac2a02359\";\n  sha256 = \"sha256-TfpzAi0mkXugQn70MISyNFOXIJpDwvgh3enGv0Xq8S4=\";\n}\n"
  },
  {
    "path": "pkgs/xdg-desktop-portal-wlr/metadata.nix",
    "content": "rec {\n  domain = \"github.com\";\n  owner = \"emersion\";\n  repo = \"xdg-desktop-portal-wlr\";\n  repo_git = \"https://${domain}/${owner}/${repo}\";\n  branch = \"master\";\n  rev = \"e471c3dfe5fe03921fd7109e6affe7740f9503c3\";\n  sha256 = \"sha256-9T73obDmx4gsGo6KdaQHoBqOCig4/6TVJWhx7tOpym4=\";\n}\n"
  },
  {
    "path": "shell.nix",
    "content": "# This file provides backward compatibility to nix < 2.4 clients\n{\n  system ? builtins.currentSystem,\n}:\nlet\n  lock = builtins.fromJSON (builtins.readFile ./flake.lock);\n\n  inherit (lock.nodes.flake-compat.locked)\n    owner\n    repo\n    rev\n    narHash\n    ;\n\n  flake-compat = fetchTarball {\n    url = \"https://github.com/${owner}/${repo}/archive/${rev}.tar.gz\";\n    sha256 = narHash;\n  };\n\n  flake = import flake-compat {\n    inherit system;\n    src = ./.;\n  };\nin\nflake.shellNix\n"
  },
  {
    "path": "templates/template.nix",
    "content": "args_@{\n  attrName,\n  # the attr in nixpkgs could be different from what we want to provide\n  # example: us libvncserver_master nixpkgs libvncserver\n  nixpkgsAttrName,\n  prev,\n  extra,\n  replace,\n  replaceInput,\n  deprecationWarning,\n  ...\n}:\n\nlet\n  inherit (prev) lib;\n  metadata = import ../pkgs/${attrName}/metadata.nix;\n  ignore = [\n    \"attrName\"\n    \"nixpkgsAttrName\"\n    \"prev\"\n    \"extra\"\n    \"replace\"\n    \"replaceInput\"\n    \"deprecationWarning\"\n  ];\n  args = builtins.removeAttrs (args_ // replaceInput) ignore;\n  nixpkgsAttr = if nixpkgsAttrName != \"\" then nixpkgsAttrName else attrName;\n  overridenAttr =\n    (lib.attrByPath (lib.splitString \".\" nixpkgsAttr)\n      (throw \"attr ${attrName} does not exist in nixpkgs\")\n      prev\n    ).override\n      args;\n  overridenAttr' = lib.warnIf (\n    deprecationWarning != \"\"\n  ) \"nixpkgs-wayland: ${deprecationWarning}\" overridenAttr;\n\n  fetchers =\n    let\n      fetchSubmodules = metadata.fetchSubmodules or overridenAttr.src.fetchSubmodules or false;\n    in\n    {\n      github = prev.fetchFromGitHub {\n        inherit (metadata)\n          owner\n          repo\n          rev\n          sha256\n          ;\n        inherit fetchSubmodules;\n      };\n      gitlab = prev.fetchFromGitLab {\n        inherit (metadata)\n          owner\n          repo\n          rev\n          sha256\n          ;\n        domain = metadata.domain or \"gitlab.com\";\n        # uncomment after https://github.com/NixOS/nixpkgs/pull/198489\n        #inherit fetchSubmodules;\n      };\n      gitea = prev.fetchFromGitea {\n        inherit (metadata)\n          owner\n          repo\n          rev\n          sha256\n          domain\n          ;\n        inherit fetchSubmodules;\n      };\n      gitsourcehut = prev.fetchFromSourcehut {\n        inherit (metadata)\n          owner\n          repo\n          rev\n          sha256\n          ;\n        inherit fetchSubmodules;\n      };\n      hgsourcehut = prev.fetchFromSourcehut {\n        inherit (metadata)\n          owner\n          repo\n          rev\n          sha256\n          ;\n        vc = \"hg\";\n      };\n    };\n\n  src = fetchers.${metadata.type or \"github\"};\n\n  cargoLock = {\n    lockFile = src + \"/Cargo.lock\";\n    allowBuiltinFetchGit = true;\n  };\n\n  replace' = previousAttrs: if builtins.isFunction replace then replace previousAttrs else replace;\nin\noverridenAttr'.overrideAttrs (\n  previousAttrs:\n  (\n    {\n      pname = attrName;\n      version = \"+${lib.substring 0 7 metadata.rev}\";\n      inherit src;\n      # `--version` will be different than the version above\n      dontVersionCheck = true;\n    }\n    // lib.optionalAttrs (src ? meta.homepage) {\n      meta = previousAttrs.meta // {\n        inherit (src.meta) homepage;\n        # null changelog as it may use `finalAttrs.src.tag` while we use `rev`\n        changelog = null;\n      };\n    }\n    // lib.optionalAttrs (extra ? depsBuildBuild) {\n      depsBuildBuild = extra.depsBuildBuild ++ previousAttrs.depsBuildBuild;\n    }\n    // lib.optionalAttrs (extra ? nativeBuildInputs) {\n      nativeBuildInputs = extra.nativeBuildInputs ++ previousAttrs.nativeBuildInputs;\n    }\n    // lib.optionalAttrs (extra ? mesonFlags) {\n      mesonFlags = previousAttrs.mesonFlags ++ extra.mesonFlags;\n    }\n    // lib.optionalAttrs (extra ? buildInputs) {\n      buildInputs = extra.buildInputs ++ previousAttrs.buildInputs;\n    }\n    // lib.optionalAttrs (previousAttrs ? cargoDeps) {\n      cargoDeps = prev.rustPlatform.importCargoLock cargoLock;\n      cargoHash = null;\n    }\n    // replace' previousAttrs\n  )\n)\n"
  }
]