daily-tracker

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

flake.nix (1510B)


      1 {
      2   inputs = {
      3     nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
      4   };
      5 
      6   outputs =
      7     { nixpkgs, ... }:
      8     let
      9       system = "x86_64-linux";
     10       pkgs = import nixpkgs { inherit system; };
     11       beamPackages = pkgs.beamPackages;
     12 
     13       heroicons = pkgs.fetchFromGitHub {
     14         owner = "tailwindlabs";
     15         repo = "heroicons";
     16         rev = "v2.2.0";
     17         sha256 = "sha256-Jcxr1fSbmXO9bZKeg39Z/zVN0YJp17TX3LH5Us4lsZU=";
     18       };
     19     in
     20     {
     21       packages.${system}.default = beamPackages.mixRelease {
     22         pname = "daily_tracker";
     23         version = "0.1.0";
     24         src = ./.;
     25 
     26         removeCookie = false;
     27 
     28         mixFodDeps = beamPackages.fetchMixDeps {
     29           pname = "daily_tracker-deps";
     30           version = "0.1.0";
     31           src = ./.;
     32           sha256 = "sha256-UnNtgwAkJDF77MmtkC0Cy/aZ0J7jx/8fZEX2uVNhLNY=";
     33         };
     34 
     35         # Replace heroicons git dep with a path dep before any mix phase runs
     36         postPatch = ''
     37           sed -i '/heroicons/d' mix.lock
     38           sed -i '/:heroicons/,/depth: 1}/c\      {:heroicons, path: "${heroicons}/optimized", app: false, compile: false},' mix.exs
     39         '';
     40 
     41         # Build assets before release
     42         preBuild = ''
     43           export MIX_ESBUILD_PATH="${pkgs.esbuild}/bin/esbuild"
     44           export TAILWIND_PATH="${pkgs.tailwindcss_4}/bin/tailwindcss"
     45 
     46           # Compile first so colocated hooks are generated
     47           mix compile --no-deps-check
     48 
     49           mix assets.deploy --no-deps-check
     50         '';
     51       };
     52     };
     53 }