nix: add standalone project flake
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
{
|
||||
description = "macOS-style application switching and hiding for Hyprland";
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
outputs =
|
||||
{ self, nixpkgs }:
|
||||
let
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
pkgsFor = system: import nixpkgs { inherit system; };
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = pkgsFor system;
|
||||
in
|
||||
rec {
|
||||
hypr-switcher = pkgs.rustPlatform.buildRustPackage {
|
||||
pname = "hypr-switcher";
|
||||
version = "0.1.0";
|
||||
src = pkgs.lib.cleanSource ./.;
|
||||
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
pkg-config
|
||||
wrapGAppsHook4
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
gtk4
|
||||
gtk4-layer-shell
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "macOS-style application switcher for Hyprland";
|
||||
homepage = "https://code.buzzert.dev/buzzert/hypr-switcher";
|
||||
mainProgram = "hypr-switcher";
|
||||
platforms = pkgs.lib.platforms.linux;
|
||||
};
|
||||
};
|
||||
|
||||
default = hypr-switcher;
|
||||
}
|
||||
);
|
||||
|
||||
apps = forAllSystems (system: {
|
||||
hypr-switcher = {
|
||||
type = "app";
|
||||
program = "${self.packages.${system}.hypr-switcher}/bin/hypr-switcher";
|
||||
};
|
||||
default = self.apps.${system}.hypr-switcher;
|
||||
});
|
||||
|
||||
checks = forAllSystems (system: {
|
||||
default = self.packages.${system}.hypr-switcher;
|
||||
});
|
||||
|
||||
devShells = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = pkgsFor system;
|
||||
in
|
||||
{
|
||||
default = pkgs.mkShell {
|
||||
inputsFrom = [ self.packages.${system}.hypr-switcher ];
|
||||
packages = with pkgs; [
|
||||
cargo
|
||||
clippy
|
||||
rustc
|
||||
rustfmt
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
formatter = forAllSystems (system: (pkgsFor system).nixfmt);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user