-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
25 lines (23 loc) · 861 Bytes
/
flake.nix
File metadata and controls
25 lines (23 loc) · 861 Bytes
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
{
description = "A simple webserver";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
my-name = "netcow";
my-buildInputs = with pkgs; [ cowsay netcat tini ];
my-script = (pkgs.writeScriptBin my-name (builtins.readFile ./moo.sh)).overrideAttrs(old: {
buildCommand = "${old.buildCommand}\n patchShebangs $out";
});
in rec {
defaultPackage = packages.my-script;
packages.my-script = pkgs.symlinkJoin {
name = my-name;
paths = [ my-script ] ++ my-buildInputs;
buildInputs = [ pkgs.makeWrapper ];
postBuild = "wrapProgram $out/bin/${my-name} --prefix PATH : $out/bin";
};
}
);
}