/ flake.nix
flake.nix
 1  {
 2    description = "nbb TUI Habits Tracker compatible with uHabits (android)";
 3  
 4    inputs = {
 5      nixpkgs.url = "github:nixos/nixpkgs";
 6    };
 7  
 8    outputs = { self, nixpkgs }:
 9      let
10        pkgs = nixpkgs.legacyPackages.x86_64-linux;
11      in
12      {
13  
14        packages.x86_64-linux.nbb-habits = pkgs.stdenv.mkDerivation {
15          name = "nbb-habits";
16          src = ./.;
17          # Need node_modules here
18          # Probably need some sort of wrapper of the bin too
19          installPhase = ''
20            mkdir -p $out
21            cp -r src/ $out/
22            cp nbb.edn $out/
23          '';
24        };
25  
26        defaultPackage.x86_64-linux = self.packages.x86_64-linux.nbb-habits;
27        devShell.x86_64-linux = pkgs.mkShell {
28          buildInputs = with pkgs; [
29            jdk11
30            nodejs
31            babashka
32            clojure
33          ];
34          shellHook = ''
35            alias nbb='./node_modules/.bin/nbb'
36            alias run='nbb src/habits/index.cljs'
37          '';
38        };
39      };
40  }
41