irs/flake.nix
2023-10-21 00:31:58 +02:00

38 lines
944 B
Nix

{ description = "A few random scripts";
inputs = {
nixpkgs.url = github:nixos/nixpkgs/nixos-23.05;
flake-utils.url = github:numtide/flake-utils;
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem ( system:
let pkgs = import nixpkgs { inherit system; };
in{
packages = rec {
default = pkgs.stdenvNoCC.mkDerivation rec {
pname = "irs";
version = "0.2";
src = ./src;
buildInputs = with pkgs; [
coreutils
scdoc
];
buildPhase = ''
for page in $(find manpages -type f); do
scdoc < $page > $(basename $page .scd)
done
'';
installPhase = ''
mkdir -p $out/{share/man/man1,bin,share/zsh/site-functions}
cp bin/* $out/bin/
cp completions/* $out/share/zsh/site-functions/
cp *.1 $out/share/man/man1/
'';
};
};
});
}