Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 3 additions & 42 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 3 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,28 @@
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);

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;
Expand Down
4 changes: 2 additions & 2 deletions libwaysip/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
33 changes: 10 additions & 23 deletions nix/package.nix
Original file line number Diff line number Diff line change
@@ -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}
'';
}
29 changes: 10 additions & 19 deletions nix/shell.nix
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -28,7 +21,5 @@ in
buildInputs = with pkgs; [
glib
pango
cairo
];
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath buildInputs}";
}