diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 65812a0..9080c12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Miscellaneous *.class *.lock +!flake.lock *.log *.pyc *.swp @@ -96,3 +97,5 @@ app.*.map.json # VS Code .vscode/settings.json + +.direnv diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..95f5ad6 --- /dev/null +++ b/flake.lock @@ -0,0 +1,59 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1717459389, + "narHash": "sha256-I8/plBsua4/NZ5bKgj+z7/ThiWuud1YFwLsn1QQ5PgE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3b01abcc24846ae49957b30f4345bab4b3f1d14b", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3951a16 --- /dev/null +++ b/flake.nix @@ -0,0 +1,50 @@ +{ + description = "Vikunja Flutter app dev environment"; + + inputs.flake-utils.url = "github:numtide/flake-utils"; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let pkgs = import nixpkgs { system = system; config.allowUnfree = true; }; + in { + defaultPackage = pkgs.mkShell { + buildInputs = with pkgs; [ + # Originally copied from https://github.com/zulip/zulip-flutter/blob/d882f50bf7d917ce7e040d7ee1f66f1d803ef988/shell.nix + clang + cmake + ninja + pkg-config + + gtk3 # Curiously `nix-env -i` can't handle this one adequately. + # But `nix-shell` on this shell.nix does fine. + pcre + epoxy + + flutter + + # This group all seem not strictly necessary -- commands like + # `flutter run -d linux` seem to *work* fine without them, but + # the build does print messages about missing packages, like: + # Package mount was not found in the pkg-config search path. + # Perhaps you should add the directory containing `mount.pc' + # to the PKG_CONFIG_PATH environment variable + # To add to this list on NixOS upgrades, the Nix package + # `nix-index` is handy: then `nix-locate mount.pc`. + libuuid # for mount.pc + xorg.libXdmcp.dev + libsepol.dev + libthai.dev + libdatrie.dev + libxkbcommon.dev + dbus.dev + at-spi2-core.dev + xorg.libXtst.out + pcre2.dev + + jdk11 + android-studio + android-tools + ]; + }; + }); +}