feat: add devenv

This commit is contained in:
kolaente
2024-09-17 13:31:13 +02:00
parent 459171d41a
commit 7df3e0321d
7 changed files with 60 additions and 111 deletions
+3 -1
View File
@@ -1 +1,3 @@
use flake
source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="
use devenv
+10
View File
@@ -98,4 +98,14 @@ app.*.map.json
# VS Code
.vscode/settings.json
# Devenv
.devenv*
devenv.local.nix
.android/
local.properties
# direnv
.direnv
# pre-commit
.pre-commit-config.yaml
+1 -1
View File
@@ -13,7 +13,7 @@
"request": "launch",
"type": "dart",
"flutterMode": "debug",
"args": ["--flavor", "main"]
"args": ["--flavor", "unsigend"]
}
]
}
+31
View File
@@ -0,0 +1,31 @@
{ pkgs, lib, config, inputs, ... }:
{
enterShell = ''
export CHROME_EXECUTABLE=`which chromium`
'';
scripts = {
create-emulator.exec = "avdmanager create avd --force --name android-32 --package 'system-images;android-32;google_apis_playstore;x86_64'";
run-app.exec = "flutter run --flavor unsigned";
build-apk-unsigned.exec = "flutter build apk --flavor unsigned";
};
android = {
enable = true;
flutter.enable = true;
platforms.version = [ "31" "33" "34" ];
cmake.version = [ "3.18.1" "3.22.1" ];
googleTVAddOns.enable = false;
ndk = {
enable = true;
version = [ "23.1.7779620" "26.1.10909125" ];
};
extras = [ ];
emulator = {
enable = true;
version = "34.1.9";
};
};
}
+15
View File
@@ -0,0 +1,15 @@
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
nixpkgs:
url: github:NixOS/nixpkgs/nixpkgs-unstable
# If you're using non-OSS software, you can set allowUnfree to true.
allowUnfree: true
# If you're willing to use a package that's vulnerable
# permittedInsecurePackages:
# - "openssl-1.1.1w"
# If you have more than one devenv you can merge them
#imports:
# - ./backend
Generated
-59
View File
@@ -1,59 +0,0 @@
{
"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
}
-50
View File
@@ -1,50 +0,0 @@
{
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
];
};
});
}