Derivation in seperate file

This commit is contained in:
Nox Sluijtman 2023-11-30 16:24:19 +01:00
parent c87cb405d4
commit 1bd76ea8e1
3 changed files with 33 additions and 28 deletions

28
default.nix Normal file
View file

@ -0,0 +1,28 @@
{ pkgs
, scdoc
, xclip
, stdenvNoCC
, ...
}:
stdenvNoCC.mkDerivation rec {
pname = "irs";
version = "0.3";
src = ./src;
nativeBuildInputs = with pkgs; [
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/
'';
}

View file

@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1697655685,
"narHash": "sha256-79Kuv+QdgsVc+rkibuAgWHnh8IXrLBTOKg5nM0Qvux0=",
"lastModified": 1701053011,
"narHash": "sha256-8QQ7rFbKFqgKgLoaXVJRh7Ik5LtI3pyBBCfOnNOGkF0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "80c1aab725151632ddc2a20caeb914e76dd0673c",
"rev": "5b528f99f73c4fad127118a8c1126b5e003b01a9",
"type": "github"
},
"original": {

View file

@ -7,31 +7,8 @@
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/
'';
};
packages = {
default = pkgs.callPackage ./default.nix {};
};
});
}