From da0ae1646be2a5975c271761c040cb9c7ff41c74 Mon Sep 17 00:00:00 2001 From: Roy Dumblauskas Date: Thu, 6 Nov 2025 00:11:07 -0600 Subject: [PATCH] first pass of nix flake --- flake.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..591edc1 --- /dev/null +++ b/flake.nix @@ -0,0 +1,37 @@ +{ + description = "Flake to build TS React App and run as a systemd service"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; + + outputs = { self, nixpkgs }: let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + + reactApp = pkgs.buildNpmPackage { + name = "react frontend"; + version = "0.1.0"; + + # TODO: Configure npm building of frontend + + }; + + nixosModule = {config, lib, pkgs, ...}: + let opts = config.services.blog-service; in + { + # TODO: Write out options for frontend service (port hosting, nginx, backend ports?) + }; + + in { + packages.${system}.default = reactApp; + + apps.${system}.default = { + type = "app"; + program = "${self.packages.${system}.default}/bin/blog-service"; + }; + + nixosModules.${system}.default = nixosModule; + + }; +}