hyprman/flake.nix

48 lines
1.2 KiB
Nix

{
description = "hyprman";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs =
inputs@{
nixpkgs,
self,
...
}:
let
inherit (nixpkgs.lib) genAttrs cleanSource;
supportedSystems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
forAllSystems = f: genAttrs supportedSystems (system: f nixpkgs.legacyPackages.${system});
in
{
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [go];
};
});
packages = forAllSystems (pkgs: {
default = self.packages.${pkgs.system}.hyprman;
hyprman = pkgs.buildGoModule {
pname = "hyprman";
version = "unstable";
src = cleanSource ./.;
vendorHash = "sha256-bv087tnyoFJmHwrTn0GQ5xDD1r1nYVKBsKSIvcif2bc=";
nativeBuildInputs = with pkgs; [installShellFiles];
postInstall = ''
installShellCompletion --cmd hyprman \
--zsh <($out/bin/hyprman completion zsh)
'';
};
});
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
};
}