aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix31
1 files changed, 27 insertions, 4 deletions
diff --git a/flake.nix b/flake.nix
index f1f3456..2384dcd 100644
--- a/flake.nix
+++ b/flake.nix
@@ -17,7 +17,10 @@
17 ]; 17 ];
18 }); 18 });
19 in { 19 in {
20 overlays.default = final: prev: { 20 overlays.default = final: prev: let
21 pname = "lurker";
22 version = "0.1.0";
23 in {
21 node_modules = with final; 24 node_modules = with final;
22 stdenv.mkDerivation { 25 stdenv.mkDerivation {
23 pname = "lurker-node-modules"; 26 pname = "lurker-node-modules";
@@ -44,8 +47,7 @@
44 }; 47 };
45 lurker = with final; 48 lurker = with final;
46 stdenv.mkDerivation { 49 stdenv.mkDerivation {
47 pname = "lurker"; 50 inherit pname version;
48 version = "0.0.1";
49 src = ./.; 51 src = ./.;
50 nativeBuildInputs = [makeBinaryWrapper]; 52 nativeBuildInputs = [makeBinaryWrapper];
51 buildInputs = [bun]; 53 buildInputs = [bun];
@@ -71,6 +73,27 @@
71 73
72 ''; 74 '';
73 }; 75 };
76 dockerImage = with final;
77 final.dockerTools.buildImage {
78 name = pname;
79 tag = "latest";
80
81 copyToRoot = final.buildEnv {
82 name = "image-root";
83 paths = [ final.lurker ];
84 pathsToLink = [ "/bin" ];
85 };
86
87 runAsRoot = ''
88 mkdir -p /data
89 '';
90
91 config = {
92 Cmd = ["/bin/${pname}"];
93 WorkingDir = "/data";
94 Volumes = {"/data" = {};};
95 };
96 };
74 }; 97 };
75 98
76 devShell = forAllSystems (system: let 99 devShell = forAllSystems (system: let
@@ -84,7 +107,7 @@
84 }); 107 });
85 108
86 packages = forAllSystems (system: { 109 packages = forAllSystems (system: {
87 inherit (nixpkgsFor."${system}") lurker node_modules; 110 inherit (nixpkgsFor."${system}") lurker node_modules dockerImage;
88 }); 111 });
89 112
90 defaultPackage = forAllSystems (system: nixpkgsFor."${system}".lurker); 113 defaultPackage = forAllSystems (system: nixpkgsFor."${system}".lurker);