Skip to content

Commit e219e6f

Browse files
committed
New working flake?
1 parent 81b8233 commit e219e6f

2 files changed

Lines changed: 57 additions & 121 deletions

File tree

flake.lock

Lines changed: 23 additions & 83 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,55 @@
11
{
2+
description = "A start menu for Wayland-based window managers";
3+
24
inputs = {
3-
naersk.url = "github:nmattia/naersk/master";
4-
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5-
utils.url = "github:numtide/flake-utils";
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
crane.url = "github:ipetkov/crane";
68
};
79

810
outputs =
911
{
1012
self,
1113
nixpkgs,
12-
utils,
13-
naersk,
14+
crane,
15+
flake-utils,
1416
...
1517
}:
16-
utils.lib.eachDefaultSystem (
18+
flake-utils.lib.eachDefaultSystem (
1719
system:
1820
let
19-
pkgs = import nixpkgs { inherit system; };
20-
naersk-lib = pkgs.callPackage naersk { };
21+
pkgs = nixpkgs.legacyPackages.${system};
22+
craneLib = crane.mkLib pkgs;
2123
libPath = with pkgs; lib.makeLibraryPath [ wayland vulkan-loader ];
22-
in
23-
{
24-
defaultPackage = naersk-lib.buildPackage {
25-
src = ./.;
26-
doCheck = true;
27-
pname = "waystart";
28-
nativeBuildInputs = [ pkgs.makeWrapper ];
29-
buildInputs = with pkgs; [
30-
libxkbcommon
31-
];
32-
postInstall = ''
33-
wrapProgram "$out/bin/sixty-two" --prefix LD_LIBRARY_PATH : "${libPath}"
34-
'';
24+
25+
commonArgs = {
26+
src = craneLib.cleanCargoSource ./.;
27+
strictDeps = true;
28+
29+
buildInputs = with pkgs; [ libxkbcommon ];
3530
};
3631

37-
defaultApp = utils.lib.mkApp {
38-
drv = self.defaultPackage."${system}";
32+
my-crate = craneLib.buildPackage (
33+
commonArgs
34+
// {
35+
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
36+
LD_LIBRARY_PATH = libPath;
37+
}
38+
);
39+
in
40+
{
41+
checks = { inherit my-crate; };
42+
packages.default = my-crate;
43+
apps.default = flake-utils.lib.mkApp {
44+
drv = my-crate;
3945
};
4046

41-
devShell =
42-
with pkgs;
43-
mkShell {
44-
buildInputs = [
45-
cargo
46-
rust-analyzer
47-
rustc
48-
rustfmt
49-
tokei
50-
libxkbcommon
51-
];
47+
devShells.default = craneLib.devShell {
48+
checks = self.checks.${system};
5249

53-
RUST_SRC_PATH = rustPlatform.rustLibSrc;
54-
LD_LIBRARY_PATH = libPath;
55-
GIT_EXTERNAL_DIFF = "${difftastic}/bin/difft";
56-
};
50+
packages = with pkgs; [ libxkbcommon ];
51+
LD_LIBRARY_PATH = libPath;
52+
};
5753
}
5854
);
5955
}

0 commit comments

Comments
 (0)