-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
58 lines (53 loc) · 1.72 KB
/
flake.nix
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
description = "openbsd.app: a tool to search OpenBSD packages";
inputs.nixpkgs.url = "github:nixos/nixpkgs";
outputs = { self, nixpkgs }:
let
supportedSystems =
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in {
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
thing = pkgs.stdenv.mkDerivation {
pname = "openbsd.app";
version = "v0.0.1";
src = ./.;
nativeBuildInputs = with pkgs.perlPackages; [
perl
Mojolicious
MojoSQLite
pkgs.outils
HTMLEscape
];
buildInputs = with pkgs; [ perl ];
installPhase = ''
mkdir -p $out/bin
install -t openbsd.app.pl $out/bin
'';
};
});
defaultPackage = forAllSystems (system: self.packages.${system}.thing);
devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
default = pkgs.mkShell {
shellHook = ''
PS1='\u@\h:\@; '
nix run github:qbit/xin#flake-warn
echo "Perl `${pkgs.perl}/bin/perl --version`"
'';
buildInputs = with pkgs.perlPackages; [ PerlTidy pkgs.sqlite PerlLanguageServer ];
nativeBuildInputs = with pkgs.perlPackages; [
perl
Mojolicious
MojoSQLite
pkgs.outils
HTMLEscape
] ++ [ pkgs.rlwrap ];
};
});
};
}