-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
36 lines (29 loc) · 1.52 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
{
description = "Nix library to allow downloading files from the internet without using FODs";
inputs.nixpkgs.url = "nixpkgs/nixpkgs-unstable";
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; overlays = [ self.overlay ]; });
in
{
overlay = final: prev:
import ./nix/overlay.nix final prev //
{
evilExample =
let
# This is a very short 5-byte example file.
# url = "https://raw.githubusercontent.com/cdepillabout/small-example-text-files/177c95e490cf44bcc42860bf0652203d3dc87900/hello.txt";
# This is a short 12-byte example file.
url = "https://raw.githubusercontent.com/cdepillabout/small-example-text-files/177c95e490cf44bcc42860bf0652203d3dc87900/hello-world.txt";
# This is a longer 52-byte example file.
# url = "https://raw.githubusercontent.com/cdepillabout/small-example-text-files/177c95e490cf44bcc42860bf0652203d3dc87900/short-sentence.txt";
in
final.evilDownloadUrl url;
};
evilDownloadUrl = forAllSystems (system: nixpkgsFor.${system}.evilDownloadUrl);
packages = forAllSystems (system: { inherit (nixpkgsFor.${system}) evilExample; });
defaultPackage = forAllSystems (system: self.packages.${system}.evilExample);
};
}