add: nix flake (#53)
This commit is contained in:
parent
95afa163a6
commit
07d3cb9820
2 changed files with 173 additions and 0 deletions
60
flake.nix
Normal file
60
flake.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
naersk.url = "github:nix-community/naersk";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, rust-overlay, naersk, flake-utils }:
|
||||
let systems = [ "x86_64-linux" "aarch64-linux" ];
|
||||
in flake-utils.lib.eachSystem systems (system:
|
||||
let
|
||||
overlays = [ (import rust-overlay) ];
|
||||
pkgs = import nixpkgs { inherit system overlays; };
|
||||
naersk' = pkgs.callPackage naersk {
|
||||
cargo = pkgs.rust-bin.stable.latest.default;
|
||||
rustc = pkgs.rust-bin.stable.latest.default;
|
||||
};
|
||||
in {
|
||||
devShell = (pkgs.mkShell.override { stdenv = pkgs.clangStdenv; }) {
|
||||
buildInputs = with pkgs; [
|
||||
rustPlatform.bindgenHook
|
||||
rust-bin.stable.latest.default
|
||||
pkg-config
|
||||
|
||||
xcb-util-cursor
|
||||
xorg.libxcb
|
||||
xwayland
|
||||
];
|
||||
};
|
||||
|
||||
packages = rec {
|
||||
xwayland-satellite = naersk'.buildPackage {
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
rustPlatform.bindgenHook
|
||||
rust-bin.stable.latest.default
|
||||
pkg-config
|
||||
|
||||
xcb-util-cursor
|
||||
xorg.libxcb
|
||||
|
||||
makeWrapper
|
||||
];
|
||||
buildInputs = [ pkgs.xwayland ];
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram $out/bin/xwayland-satellite \
|
||||
--prefix PATH : ${pkgs.xwayland}/bin
|
||||
'';
|
||||
};
|
||||
|
||||
default = xwayland-satellite;
|
||||
};
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue