diff --git a/flake.lock b/flake.lock index cb8dcf3..76d1aa0 100644 --- a/flake.lock +++ b/flake.lock @@ -1,33 +1,12 @@ { "nodes": { - "fenix": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1750747360, - "narHash": "sha256-0JEUva5TOJMLDHTUMY4uHQTqEC+esw5n61CfCilOynE=", - "owner": "nix-community", - "repo": "fenix", - "rev": "1390245c00b82dc83e057701c8d01657c5077279", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1712388808, - "narHash": "sha256-9ogU4c3vUmuMDoRlbQCeq3OKx0XJmgHcLZ4XywJNYWI=", + "lastModified": 1774078191, + "narHash": "sha256-nyxxxW1/2ouu9dU0I02ul5pHrmUrE1JVFhfFlmYe3Lw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "fe4295b9ecd88764c1abf6179e03b1a828ca0e9a", + "rev": "09061f748ee21f68a089cd5d91ec1859cd93d0be", "type": "github" }, "original": { @@ -39,28 +18,10 @@ }, "root": { "inputs": { - "fenix": "fenix", "nixpkgs": "nixpkgs", "systems": "systems" } }, - "rust-analyzer-src": { - "flake": false, - "locked": { - "lastModified": 1750703256, - "narHash": "sha256-tTsX1kLWgeDtOSzahAW6WMkBY7ZjQeqdJ8pmqPyEGLo=", - "owner": "rust-lang", - "repo": "rust-analyzer", - "rev": "96be3788a67552b6fde780061fac2889793eafe3", - "type": "github" - }, - "original": { - "owner": "rust-lang", - "ref": "nightly", - "repo": "rust-analyzer", - "type": "github" - } - }, "systems": { "locked": { "lastModified": 1689347949, diff --git a/flake.nix b/flake.nix index 7a43c6d..a721aa3 100644 --- a/flake.nix +++ b/flake.nix @@ -4,17 +4,12 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; systems.url = "github:nix-systems/default-linux"; - fenix = { - url = "github:nix-community/fenix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; outputs = inputs @ { self, nixpkgs, systems, - fenix, ... }: let eachSystem = nixpkgs.lib.genAttrs (import systems); @@ -22,17 +17,15 @@ pkgsFor = system: import nixpkgs { inherit system; - overlays = [ - fenix.overlays.default - ]; + overlays = []; }; in { packages = eachSystem (system: { - default = nixpkgs.legacyPackages.${system}.callPackage ./nix/package.nix {fenix = fenix;}; + default = nixpkgs.legacyPackages.${system}.callPackage ./nix/package.nix {}; }); devShells = eachSystem (system: { - default = (pkgsFor system).callPackage ./nix/shell.nix {fenix = fenix;}; + default = (pkgsFor system).callPackage ./nix/shell.nix {}; }); formatter.x86_64-linux = inputs.nixpkgs.legacyPackages.x86_64-linux.alejandra; diff --git a/libwaysip/src/lib.rs b/libwaysip/src/lib.rs index a6bea71..e4114a3 100644 --- a/libwaysip/src/lib.rs +++ b/libwaysip/src/lib.rs @@ -176,7 +176,7 @@ fn get_area_inner( // register this event_queue - .blocking_dispatch(&mut state) + .roundtrip(&mut state) .map_err(WaySipError::DispatchError)?; // then make a dispatch let xdg_output_manager = globals @@ -192,7 +192,7 @@ fn get_area_inner( } event_queue - .blocking_dispatch(&mut state) + .roundtrip(&mut state) .map_err(WaySipError::DispatchError)?; // then make a dispatch // you will find you get the outputs, but if you do not diff --git a/nix/package.nix b/nix/package.nix index 88fd237..5f095e6 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -1,36 +1,23 @@ -{ - fenix, - pkgs, - lib, +{ lib, + rustPlatform, + pkg-config, + glib, + pango, ... -}: let - toolchain = fenix.packages.${pkgs.system}.latest.toolchain; - rustPlatformNightly = pkgs.makeRustPlatform { - cargo = toolchain; - rustc = toolchain; - }; -in - rustPlatformNightly.buildRustPackage rec { +}: rustPlatform.buildRustPackage rec { pname = "waysip"; - version = "0.5.0-dev"; - - auditable = false; - src = lib.cleanSource ../.; + version = "${(builtins.fromTOML (builtins.readFile (src + "/Cargo.toml"))).workspace.package.version}-git"; + cargoLock.lockFile = "${src}/Cargo.lock"; - nativeBuildInputs = with pkgs; [ + nativeBuildInputs = [ pkg-config ]; - buildInputs = with pkgs; [ + buildInputs = [ glib pango - cairo ]; - postFixup = '' - patchelf $out/bin/waysip \ - --add-rpath ${lib.makeLibraryPath buildInputs} - ''; } diff --git a/nix/shell.nix b/nix/shell.nix index 1f0ab75..3e68fdb 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -1,25 +1,18 @@ -{ - pkgs, - fenix, -}: let - fenixPkgs = fenix.packages.${pkgs.system}; - rust-toolchain = with fenixPkgs.latest; - fenixPkgs.combine [ - cargo - rustc - rust-analyzer - rustfmt - clippy - ]; -in - pkgs.mkShell rec { +{ pkgs, + ... +}: pkgs.mkShell rec { name = "Waysip-devel"; nativeBuildInputs = with pkgs; [ + # linker pkg-config - rust-toolchain + # rust + rustc + cargo + scdoc # Tools - scdoc + clippy + rust-analyzer cargo-flamegraph cargo-audit cargo-xbuild @@ -28,7 +21,5 @@ in buildInputs = with pkgs; [ glib pango - cairo ]; - LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath buildInputs}"; }