aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2024-10-24 10:15:57 -0500
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2024-10-24 10:15:57 -0500
commitad0bbbc109ae8aeb7559cdbecf3c66b900f7e885 (patch)
tree6cd0b37563338a6a9366cb0e2b80df6031627736 /flake.nix
parent56ef5d80e70e8301e150317d57428c87514c01bd (diff)
initial commit
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..2eb2de1
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,42 @@
+{
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
+ };
+
+ outputs = { nixpkgs, ... }: let
+ system = "x86_64-linux";
+ pkgs = import nixpkgs { inherit system; };
+ in {
+ packages.${system}.default = with pkgs; stdenv.mkDerivation {
+ name = "papa_stories";
+ src = ./src;
+ buildInputs = with pkgs; [
+ gnumake pandoc http-server
+ ];
+
+ buildPhase = ''
+ make BUILD_DIR=$out/build all
+ '';
+
+ installPhase = ''
+ mkdir -p $out/bin
+ cat <<EOF > $out/bin/start-server
+ #!/usr/bin/env bash
+ ${http-server}/bin/http-server $out/build -p 8001 -d false
+ EOF
+ chmod +x $out/bin/start-server
+ '';
+ };
+
+ devShells.${system}.default = pkgs.mkShell {
+ buildInputs = with pkgs; [
+ pandoc
+ ripgrep
+ http-server
+ shellcheck
+ gnumake
+ ];
+ };
+ };
+}
+