From 385b5d5512e7fc70709c2162b7dd49886e5d603a Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Wed, 11 Feb 2026 12:00:08 -0500 Subject: [PATCH] added nix flake --- .gitignore | 3 ++- flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 39 ++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore index 76add87..f07449b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -dist \ No newline at end of file +dist +result/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..98cd8d9 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1769996383, + "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1770562336, + "narHash": "sha256-ub1gpAONMFsT/GU2hV6ZWJjur8rJ6kKxdm9IlCT0j84=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d6c71932130818840fc8fe9509cf50be8c64634f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1769909678, + "narHash": "sha256-cBEymOf4/o3FD5AZnzC3J9hLbiZ+QDT/KDuyHXVJOpM=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "72716169fe93074c333e8d0173151350670b824c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c3b70b0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "A fast, minimal TUI for Todoist."; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + }; + + outputs = inputs @ {flake-parts, ...}: + flake-parts.lib.mkFlake {inherit inputs;} { + systems = [ + "aarch64-darwin" + "x86_64-linux" + ]; + + perSystem = {pkgs, ...}: { + packages.default = pkgs.buildNpmPackage { + pname = "dewy"; + version = "0.0.0"; + src = ./.; + npmDepsHash = "sha256-87WINB2MVHkBRcDiV8Sm9lEWrQR0N3QtzEcX3/Vb9Zg="; + nodejs = pkgs.nodejs_20; + + buildPhase = '' + npm run build + ''; + + installPhase = '' + mkdir -p $out/lib/dewy $out/bin + cp -r dist node_modules package.json $out/lib/dewy/ + makeWrapper ${pkgs.nodejs_20}/bin/node $out/bin/dewy \ + --add-flags "$out/lib/dewy/dist/cli.js" + ''; + + nativeBuildInputs = [pkgs.makeWrapper]; + }; + }; + }; +} -- 2.51.2