Files
nixos/common/flakes/czkawka-master/flake.nix

86 lines
1.8 KiB
Nix
Raw Normal View History

2025-12-21 12:48:55 +01:00
{
2026-02-01 12:56:42 +01:00
description = "Krokiet (Czkawka Slint GUI)";
2025-12-21 12:48:55 +01:00
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
czkawka-src = {
2026-02-01 12:56:42 +01:00
url = "github:qarmin/czkawka";
2026-01-05 15:16:09 +01:00
flake = false;
2025-12-21 12:48:55 +01:00
};
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
};
2025-12-26 02:35:27 +01:00
outputs =
{
self,
nixpkgs,
czkawka-src,
naersk,
}:
2025-12-21 12:48:55 +01:00
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
nativeBuildInputs = with pkgs; [
pkg-config
2026-02-01 12:56:42 +01:00
cmake
makeWrapper
2025-12-21 12:48:55 +01:00
cargo
rustc
];
2026-02-01 12:56:42 +01:00
runtimeLibs = with pkgs; [
wayland
libxkbcommon
libglvnd
fontconfig
2026-02-09 13:37:07 +01:00
libX11
libXcursor
libXi
libXrandr
2025-12-21 12:48:55 +01:00
];
2025-12-26 02:35:27 +01:00
in
{
2025-12-21 12:48:55 +01:00
packages.${system}.default = naersk-lib.buildPackage {
2026-02-01 12:56:42 +01:00
pname = "krokiet";
2025-12-21 12:48:55 +01:00
version = "master";
src = czkawka-src;
2026-02-01 12:56:42 +01:00
nativeBuildInputs = nativeBuildInputs;
buildInputs = runtimeLibs;
cargoBuildOptions =
x:
x
++ [
"-p"
"krokiet"
];
buildAndCheckFeatures = [
"winit_wayland"
"winit_x11"
];
2025-12-21 12:48:55 +01:00
2026-01-05 15:16:09 +01:00
RUSTFLAGS = "-C target-cpu=native";
NIX_CFLAGS_COMPILE = "-march=native -mtune=native";
2025-12-21 12:48:55 +01:00
postInstall = ''
2026-02-01 12:56:42 +01:00
wrapProgram $out/bin/krokiet \
--prefix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath runtimeLibs}
install -Dm444 -t $out/share/applications data/io.github.qarmin.krokiet.desktop
2026-02-01 19:47:19 +01:00
2026-02-17 20:02:25 +01:00
install -Dm444 -t $out/share/icons/hicolor/scalable/apps data/icons/io.github.qarmin.krokiet.svg \
2026-02-01 19:47:19 +01:00
install -Dm444 -t $out/share/metainfo data/io.github.qarmin.krokiet.metainfo.xml
2025-12-21 12:48:55 +01:00
'';
};
};
2025-12-26 02:35:27 +01:00
}