~rjpcasalino/bss

bss/flake.nix -rw-r--r-- 1.1 KiB
b2d1bf07rjpc add some notes and fix formatting in places 8 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
  description = "A flake for building bss";

  inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable-small;
  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, nixpkgs, flake-utils }:
  flake-utils.lib.eachDefaultSystem (system:
    with nixpkgs.legacyPackages.${system};
    let bss = 
        buildPerlPackage {
        pname = "bss";
        version = "0.1";
        src = self;
        propagatedBuildInputs = with perlPackages; [
         TemplateToolkit
         ModuleInstall
         ConfigIniFiles
         YAML
         TextMarkdown
         FilesysNotifySimple
        ];
        buildInputs = [
         makeWrapper
       ] ++ lib.optionals stdenv.isDarwin [ shortenPerlShebang ];
        postInstall = ''
          mkdir -p $out/bin
          ${if stdenv.isDarwin then "shortenPerlShebang $out/lib/perl5/site_perl/${perl.version}/bss.pl" else ""}
          wrapProgram $out/lib/perl5/site_perl/${perl.version}/bss.pl --prefix PATH : ${lib.makeBinPath[ rsync ]}
          ln -fs $out/lib/perl5/site_perl/${perl.version}/bss.pl $out/bin/bss
        '';
      };
    in {
      defaultPackage = bss;
      }
  );
}