Get rid of neomutt and neovim

This commit is contained in:
Charlotte Van Petegem 2021-03-20 21:29:18 +01:00
parent afa2c88f6a
commit 18ec940162
No known key found for this signature in database
GPG key ID: 019E764B7184435A
13 changed files with 10 additions and 3158 deletions

View file

@ -40,10 +40,6 @@ let
};
msmtp.enable = true;
mu.enable = true;
neomutt = {
enable = true;
sendMailCommand = "msmtpq --read-envelope-from --read-recipients --account ${name}";
};
passwordCommand = "${passwordScript} ${passFile}";
realName = "Charlotte Van Petegem";
signature = {
@ -96,9 +92,6 @@ in
host = "mail.vanpetegem.me";
passFile = "mail/Personal";
extraConfig = {
neomutt.extraConfig = ''
alternates '^.*@cvpetegem.be$' '^charlotte\+.*@vanpetegem.me'
'';
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Trash"; };
primary = true;
};
@ -113,9 +106,6 @@ in
extraConfig = {
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Deleted Items"; };
mbsync.extraConfig.account.PipelineDepth = "1";
neomutt.extraConfig = ''
alternates dodona@ugent.be
'';
};
};
work-aap-we-fr = makeAccount {
@ -137,9 +127,6 @@ in
host = "posteo.de";
passFile = "mail/Posteo";
extraConfig = {
neomutt.extraConfig = ''
alternates '^chvp\+.*posteo.net'
'';
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Trash"; };
};
};
@ -151,9 +138,6 @@ in
passFile = "jonggroen/GoogleAppMail";
useStartTls = true;
extraConfig = {
neomutt.extraConfig = ''
alternates it@jonggroen.be rvb@jonggroen.be
'';
flavor = "gmail.com";
folders = {
drafts = "[Gmail].Drafts";
@ -169,9 +153,6 @@ in
host = "mail.vanpetegem.me";
passFile = "mail/Postbot";
extraConfig = {
neomutt.extraConfig = ''
alternates '.*@vanpetegem.me$'
'';
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Trash"; };
};
};
@ -181,9 +162,6 @@ in
host = "mail.vanpetegem.me";
passFile = "mail/Webmaster";
extraConfig = {
neomutt.extraConfig = ''
alternates root@vanpetegem.me
'';
folders = { drafts = "Drafts"; inbox = "INBOX"; sent = "INBOX"; trash = "Trash"; };
};
};
@ -225,8 +203,8 @@ in
general = {
debug = "no";
default_action = "list";
editor = "nvim";
merge_editor = "nvim, -d";
editor = "emacs";
merge_editor = "${pkgs.writeShellScript "ediff" ''emacs --eval "(ediff-merge-files \"$1\" \"$2\")"''}";
};
"contact table" = {
display = "formatted_name";
@ -285,43 +263,6 @@ in
mbsync.enable = true;
msmtp.enable = true;
mu.enable = true;
neomutt = {
enable = true;
sidebar = {
enable = true;
};
extraConfig = ''
auto_view text/html
set mail_check_stats
set query_command = "${pkgs.khard}/bin/khard email -p %s"
set send_charset="utf-8"
set print_command = "${pkgs.wl-clipboard}/bin/wl-copy"
color normal black white
color error red white
color status white blue
color indicator white blue
color quoted yellow default
color header blue white "^(Subject)"
color header brightblue white "^(From)"
color index white red "~D" # deleted messages
color attachment green white
'';
macros = [
{
map = "index";
key = "\\Ck";
action = "<sidebar-prev><sidebar-open>";
}
{
map = "index";
key = "\\Cj";
action = "<sidebar-next><sidebar-open>";
}
];
vimKeys = true;
};
};
services = {
imapnotify.enable = true;

View file

@ -132,10 +132,8 @@ in
workspace 1
exec ${pkgs.firefox}/bin/firefox
workspace 3
exec ${pkgs.kitty}/bin/kitty -e ${pkgs.tmuxinator}/bin/tmuxinator start mail
workspace 4
exec ${pkgs.gomuks}/bin/gomuks
workspace 4
workspace 3
exec ${pkgs.teams}/bin/teams
workspace 2

View file

@ -12,7 +12,6 @@
./global-mailer.nix
./gomuks.nix
./minecraft.nix
./neovim.nix
./nix.nix
./nginx.nix
./ovh.nix

View file

@ -22,9 +22,12 @@
];
};
};
home.file = {
".emacs.d/early-init.el".source = ./emacs/early-init.el;
".emacs.d/init.el".source = ./emacs/init.el;
home = {
file = {
".emacs.d/early-init.el".source = ./emacs/early-init.el;
".emacs.d/init.el".source = ./emacs/init.el;
};
sessionVariables = { EDITOR = "emacs"; };
};
};
};

View file

@ -1,216 +0,0 @@
{ config, lib, pkgs, ... }:
let
customPlugins = {
snow-color-theme = pkgs.vimUtils.buildVimPlugin {
name = "snow";
src = pkgs.fetchFromGitHub {
owner = "nightsense";
repo = "snow";
rev = "f9800e987e404efed4748fe8098e04ddbec9770b";
sha256 = "099fky1bpppac5785bhx1jc26gfpm8n837p8487j1rf1lwq83q33";
};
};
};
jdtls = import ../packages/jdtls/default.nix { inherit pkgs; stdenv = pkgs.stdenv; };
kotlinls = import ../packages/kotlin-language-server/default.nix { inherit pkgs; };
base = home: {
home.sessionVariables = { EDITOR = "nvim"; };
programs.neovim = {
enable = true;
extraConfig = ''
set autoread
"" Theming
set termguicolors
set background=light
colorscheme snow
"" General settings
" Undo over sessions
set undofile
set undodir=${config.chvp.cachePrefix}${home}/.cache/nvim/undo
" Automatically save sessions on exit and load them on start
function! MakeSession()
let b:sessiondir = "${config.chvp.cachePrefix}${home}/.local/share/nvim/sessions" . getcwd()
if (filewritable(b:sessiondir) != 2)
exe 'silent !mkdir -p ' b:sessiondir
redraw!
endif
let b:filename = b:sessiondir . '/session.vim'
exe "mksession! " . b:filename
endfunction
function! LoadSession()
let b:sessiondir = "${config.chvp.cachePrefix}${home}/.local/share/nvim/sessions" . getcwd()
let b:sessionfile = b:sessiondir . "/session.vim"
if (filereadable(b:sessionfile))
exe 'source ' b:sessionfile
else
echo "No session loaded."
endif
endfunction
if(argc() == 0)
au VimEnter * nested :call LoadSession()
au VimLeave * :call MakeSession()
endif
"" Filetype configuration
" Base settings for all files
syntax enable
set number
set showcmd
set scrolloff=8
set expandtab
set tabstop=4
set shiftwidth=4
set linebreak
set list
set listchars=tab:·\ ,trail:·
set inccommand=split
set clipboard=unnamedplus
filetype plugin indent on
"" Fuzzy search in vim
function! s:completedFiles(winid, filename, ...) abort
bdelete!
call win_gotoid(a:winid)
if filereadable(a:filename)
let lines = readfile(a:filename)
if !empty(lines)
exe ':e ' . lines[0]
endif
call delete(a:filename)
endif
endfunction
function! FzyFiles()
let file = tempname()
let winid = win_getid()
let cmd = split(&shell) + split(&shellcmdflag) + ["${pkgs.ripgrep.out}/bin/rg --files --hidden -g '!/.git' --smart-case | ${pkgs.fzy.out}/bin/fzy > " . file]
let F = function('s:completedFiles', [winid, file])
botright 10 new
call termopen(cmd, {'on_exit': F})
startinsert
endfunction
function! s:completedGrep(winid, filename, ...) abort
bdelete!
call win_gotoid(a:winid)
if filereadable(a:filename)
let lines = readfile(a:filename)
if !empty(lines)
let list = split(lines[0], ':')
let file = list[0]
let line = list[1]
exe ':e ' . file
exe line
endif
call delete(a:filename)
endif
endfunction
function! FzyGrep()
let file = tempname()
let winid = win_getid()
let cmd = split(&shell) + split(&shellcmdflag) + ["${pkgs.ripgrep.out}/bin/rg --vimgrep --hidden -g '!/.git' '^' | ${pkgs.fzy.out}/bin/fzy > " . file]
let F = function('s:completedGrep', [winid, file])
botright 10 new
call termopen(cmd, {'on_exit': F})
startinsert
endfunction
nnoremap <C-f> :call FzyFiles()<CR>
nnoremap <C-g> :call FzyGrep()<CR>
'';
plugins = with pkgs.vimPlugins // customPlugins; [
{
plugin = ale;
config = ''
let g:ale_fix_on_save = 1
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
'' + (lib.optionalString config.chvp.graphical ''
\ 'javascript': ['eslint', 'remove_trailing_lines', 'trim_whitespace'],
\ 'ledger': ['trim_whitespace'],
\ 'nix': ['nixpkgs-fmt', 'remove_trailing_lines', 'trim_whitespace'],
\ 'ruby': ['rubocop', 'remove_trailing_lines', 'trim_whitespace'],
\ 'typescript': ['eslint', 'remove_trailing_lines', 'trim_whitespace'],
\ 'vue': ['prettier', 'remove_trailing_lines', 'trim_whitespace'],
'') + ''
\}
'';
}
auto-pairs
{
plugin = deoplete-nvim;
config = ''
let g:deoplete#enable_at_startup = 1
set completeopt+=noselect
'' + lib.optionalString config.chvp.graphical ''
au VimEnter * call deoplete#custom#option('omni_patterns', {
\ 'ledger': ['[a-zA-Z][a-zA-Z: ]*'],
\})
'';
}
editorconfig-vim
snow-color-theme
vim-nix
] ++ lib.optionals config.chvp.graphical [
kotlin-vim
{
plugin = LanguageClient-neovim;
config = ''
" Required for operations modifying multiple buffers like rename
set hidden
let g:LanguageClient_serverCommands = {
\ 'java': ['${jdtls}/bin/jdtls'],
\ 'javascript': ['${pkgs.nodePackages.javascript-typescript-langserver}/bin/javascript-typescript-stdio'],
\ 'kotlin': ['${kotlinls}/bin/kotlin-language-server'],
\ 'ruby': ['${pkgs.solargraph}/bin/solargraph', 'stdio'],
\ 'typescript': ['${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server', '--stdio'],
\ 'vue': ['${pkgs.nodePackages.vue-language-server}/bin/vls'],
\ }
function LC_maps()
if has_key(g:LanguageClient_serverCommands, &filetype)
nnoremap <buffer> <silent> K :call LanguageClient#textDocument_hover()<cr>
nnoremap <buffer> <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <buffer> <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
endif
endfunction
autocmd FileType * call LC_maps()
'';
}
vim-ledger
vim-ruby
vim-vue
yats-vim
];
extraPackages = with pkgs; [
nixpkgs-fmt
];
};
};
in
{
options.chvp.neovim = {
enable = lib.mkOption {
default = true;
example = false;
};
};
config = lib.mkIf config.chvp.neovim.enable {
home-manager.users.charlotte = { ... }: (base "/home/charlotte");
home-manager.users.root = { ... }: (base "/root");
};
}

View file

@ -13,7 +13,6 @@ let
set -sg escape-time 10
'';
keyMode = "vi";
tmuxinator.enable = lib.mkIf config.chvp.graphical true;
};
};
in
@ -24,13 +23,7 @@ in
};
config = lib.mkIf config.chvp.tmux.enable {
home-manager.users.charlotte = { ... }: base // lib.optionalAttrs config.chvp.graphical {
xdg.configFile = {
"tmuxinator/accentor.yml".source = ./tmux/accentor.yml;
"tmuxinator/dodona.yml".source = ./tmux/dodona.yml;
"tmuxinator/mail.yml".source = ./tmux/mail.yml;
};
};
home-manager.users.charlotte = { ... }: base;
home-manager.users.root = { ... }: base;
};
}

View file

@ -1,36 +0,0 @@
name: accentor
project_root: "/home/charlotte/repos/accentor"
windows:
- api:
root: "/home/charlotte/repos/accentor/api"
layout: main-vertical
panes:
- nvim
- git status
- web:
root: "/home/charlotte/repos/accentor/web"
layout: main-vertical
panes:
- nvim
- git status
- android:
root: "/home/charlotte/repos/accentor/android"
layout: main-vertical
panes:
- nvim
- git status
- run:
layout: even-horizontal
panes:
- rails:
- cd api
- bundle exec rails s
- delayed_job:
- cd api
- bundle exec rails jobs:work
- vue:
- cd web
- yarn run serve
- postgres:
- cd api
- start-db

View file

@ -1,55 +0,0 @@
# /home/charlotte/.config/tmuxinator/dodona.yml
name: dodona
root: ~/repos/dodona/dodona
# Optional tmux socket
# socket_name: foo
# Note that the pre and post options have been deprecated and will be replaced by
# project hooks.
# Project hooks
# Runs on project start, always
# on_project_start: command
# Run on project start, the first time
# on_project_first_start: command
# Run on project start, after the first time
# on_project_restart: command
# Run on project exit ( detaching from tmux session )
# on_project_exit: command
# Run on project stop
# on_project_stop: command
# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions.
# pre_window: rbenv shell 2.0.0-p247
# Pass command line options to tmux. Useful for specifying a different tmux.conf.
# tmux_options: -f ~/.tmux.mac.conf
# Change the command to call tmux. This can be used by derivatives/wrappers like byobu.
# tmux_command: byobu
# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used.
# startup_window: editor
# Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used.
# startup_pane: 1
# Controls whether the tmux session should be attached to automatically. Defaults to true.
# attach: false
windows:
- editor:
layout: main-vertical
panes:
- nvim
- git status
- server:
layout: even-horizontal
panes:
- bundle exec rails s
- bundle exec rails jobs:work
- ./bin/webpack-dev-server
- logs: tail -f log/development.log
- db: start-dockers

View file

@ -1,47 +0,0 @@
# /home/charlotte/.config/tmuxinator/mail.yml
name: mail
root: ~/mail
# Optional tmux socket
# socket_name: foo
# Note that the pre and post options have been deprecated and will be replaced by
# project hooks.
# Project hooks
# Runs on project start, always
# on_project_start: command
# Run on project start, the first time
# on_project_first_start: command
# Run on project start, after the first time
# on_project_restart: command
# Run on project exit ( detaching from tmux session )
# on_project_exit: command
# Run on project stop
# on_project_stop: command
# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions.
# pre_window: rbenv shell 2.0.0-p247
# Pass command line options to tmux. Useful for specifying a different tmux.conf.
# tmux_options: -f ~/.tmux.mac.conf
# Change the command to call tmux. This can be used by derivatives/wrappers like byobu.
# tmux_command: byobu
# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used.
# startup_window: editor
# Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used.
# startup_pane: 1
# Controls whether the tmux session should be attached to automatically. Defaults to true.
# attach: false
windows:
- main:
layout: main-vertical
panes:
- neomutt
- khal interactive

View file

@ -1,36 +0,0 @@
{ stdenv, pkgs, ... }:
stdenv.mkDerivation rec {
pname = "jdtls";
version = "0.57.0";
src = pkgs.fetchurl {
url = "http://download.eclipse.org/${pname}/milestones/${version}/jdt-language-server-${version}-202006172108.tar.gz";
sha256 = "1yvk6pby5ylvnhcax6da86dzrx76iym3jc25mnvfv4krpfcl8zl9";
};
sourceRoot = ".";
buildPhase = "true";
installPhase = ''
mkdir -p $out/share/java/jdtls
mv config_* features plugins $out/share/java/jdtls
mkdir $out/bin
cat >$out/bin/jdtls <<HERE
#!${pkgs.bash}/bin/bash
tmp_dir=\$(mktemp -d /tmp/jdtls.XXXXX)
cp -R $out/share/java/jdtls/config_linux \$tmp_dir
chmod -R u=rwX \$tmp_dir
trap "{ rm -rf \$tmp_dir; }" 0
${pkgs.jdk11}/bin/java \
-Declipse.application=org.eclipse.jdt.ls.core.id1 \
-Dosgi.bundles.defaultStartLevel=4 \
-Declipse.product=org.eclipse.jdt.ls.core.product \
-noverify \
-Xms1G \
-jar $out/share/java/jdtls/plugins/org.eclipse.equinox.launcher_*.jar \
-configuration "\$tmp_dir/config_linux" \
"\$@"
HERE
chmod +x $out/bin/jdtls
'';
}

View file

@ -1,18 +0,0 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
let
buildGradle = callPackage ./gradle-env.nix { };
in
buildGradle {
envSpec = ./gradle-env.json;
src = fetchTarball {
url = "https://github.com/fwcd/kotlin-language-server/archive/0.7.0.tar.gz";
sha256 = "0by07h2ly84dzmwzjf3fsgghm3fwhyhhbnnv3kl7dy1iajhl4shj";
};
gradleFlags = [ "server:installDist" ];
installPhase = ''
mkdir -p $out
cp -r server/build/install/server/* $out/
'';
}

File diff suppressed because it is too large Load diff

View file

@ -1,278 +0,0 @@
# This file is generated by gradle2nix.
#
# Example usage (e.g. in default.nix):
#
# with (import <nixpkgs> {});
# let
# buildGradle = callPackage ./gradleEnv.nix {};
# in
# buildGradle {
# envSpec = ./gradle-env.json;
#
# src = ./.;
#
# gradleFlags = [ "installDist" ];
#
# installPhase = ''
# mkdir -p $out
# cp -r app/build/install/myproject $out
# '';
# }
{ stdenv, buildEnv, fetchurl, gradleGen, writeText, writeTextDir }:
{ envSpec
, pname ? null
, version ? null
, enableParallelBuilding ? true
, gradleFlags ? [ "build" ]
, gradlePackage ? null
, enableDebug ? false
, ...
} @ args:
let
inherit (builtins)
filter sort replaceStrings attrValues match fromJSON
concatStringsSep
;
inherit (stdenv.lib)
versionOlder unique mapAttrs last concatMapStringsSep removeSuffix
optionalString groupBy' readFile hasSuffix
;
mkDep = depSpec: stdenv.mkDerivation {
inherit (depSpec) name;
src = fetchurl {
inherit (depSpec) urls sha256;
};
phases = "installPhase";
installPhase = ''
mkdir -p $out/${depSpec.path}
ln -s $src $out/${depSpec.path}/${depSpec.name}
'';
};
mkModuleMetadata = deps:
let
ids = filter
(id: id.type == "pom")
(map (dep: dep.id) deps);
modules = groupBy'
(
meta: id:
let
isNewer = versionOlder meta.latest id.version;
isNewerRelease =
!(hasSuffix "-SNAPSHOT" id.version)
&& versionOlder meta.release id.version;
in
{
groupId = id.group;
artifactId = id.name;
latest = if isNewer then id.version else meta.latest;
release = if isNewerRelease then id.version else meta.release;
versions = meta.versions ++ [ id.version ];
}
)
{
latest = "";
release = "";
versions = [ ];
}
(id: "${replaceStrings [ "." ] [ "/" ] id.group}/${id.name}/maven-metadata.xml")
ids;
in
attrValues (
mapAttrs
(
path: meta:
let
versions' = sort versionOlder (unique meta.versions);
in
with meta; writeTextDir path ''
<?xml version="1.0" encoding="UTF-8"?>
<metadata modelVersion="1.1">
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<versioning>
${optionalString (latest != "") "<latest>${latest}</latest>"}
${optionalString (release != "") "<release>${release}</release>"}
<versions>
${concatMapStringsSep "\n " (v: "<version>${v}</version>") versions'}
</versions>
</versioning>
</metadata>
''
)
modules
);
mkSnapshotMetadata = deps:
let
snapshotDeps = filter (dep: dep ? build && dep ? timestamp) deps;
modules = groupBy'
(
meta: dep:
let
id = dep.id;
isNewer = dep.build > meta.buildNumber;
# Timestamp values can be bogus, e.g. jitpack.io
updated =
if (match "[0-9]{8}\.[0-9]{6}" dep.timestamp) != null
then replaceStrings [ "." ] [ "" ] dep.timestamp
else "";
in
{
groupId = id.group;
artifactId = id.name;
version = id.version;
timestamp = if isNewer then dep.timestamp else meta.timestamp;
buildNumber = if isNewer then dep.build else meta.buildNumber;
lastUpdated = if isNewer then updated else meta.lastUpdated;
versions = meta.versions or [ ] ++ [
{
classifier = id.classifier or "";
extension = id.extension;
value = "${removeSuffix "-SNAPSHOT" id.version}-${dep.timestamp}-${toString dep.build}";
updated = updated;
}
];
}
)
{
timestamp = "";
buildNumber = -1;
lastUpdated = "";
}
(dep: "${replaceStrings [ "." ] [ "/" ] dep.id.group}/${dep.id.name}/${dep.id.version}/maven-metadata.xml")
snapshotDeps;
mkSnapshotVersion = version: ''
<snapshotVersion>
${optionalString (version.classifier != "") "<classifier>${version.classifier}</classifier>"}
<extension>${version.extension}</extension>
<value>${version.value}</value>
${optionalString (version.updated != "") "<updated>${version.updated}</updated>"}
</snapshotVersion>
'';
in
attrValues (
mapAttrs
(
path: meta:
with meta; writeTextDir path ''
<?xml version="1.0" encoding="UTF-8"?>
<metadata modelVersion="1.1">
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
<versioning>
<snapshot>
${optionalString (timestamp != "") "<timestamp>${timestamp}</timestamp>"}
${optionalString (buildNumber != -1) "<buildNumber>${toString buildNumber}</buildNumber>"}
</snapshot>
${optionalString (lastUpdated != "") "<lastUpdated>${lastUpdated}</lastUpdated>"}
<snapshotVersions>
${concatMapStringsSep "\n " mkSnapshotVersion versions}
</snapshotVersions>
</versioning>
</metadata>
''
)
modules
);
mkRepo = project: type: deps: buildEnv {
name = "${project}-gradle-${type}-env";
paths = map mkDep deps ++ mkModuleMetadata deps ++ mkSnapshotMetadata deps;
};
mkInitScript = projectSpec:
let
repos = mapAttrs (mkRepo projectSpec.name) projectSpec.dependencies;
in
writeText "init.gradle" ''
static def offlineRepo(RepositoryHandler repositories, String env, String path) {
repositories.clear()
repositories.maven {
name "Nix''${env.capitalize()}MavenOffline"
url path
metadataSources {
it.gradleMetadata()
it.mavenPom()
it.artifact()
}
}
repositories.ivy {
name "Nix''${env.capitalize()}IvyOffline"
url path
layout "maven"
metadataSources {
it.gradleMetadata()
it.ivyDescriptor()
it.artifact()
}
}
}
gradle.settingsEvaluated {
offlineRepo(it.pluginManagement.repositories, "plugin", "${repos.plugin}")
}
gradle.projectsLoaded {
allprojects {
buildscript {
offlineRepo(repositories, "buildscript", "${repos.buildscript}")
}
offlineRepo(repositories, "project", "${repos.project}")
}
}
'';
mkGradle = gradleSpec:
gradleGen.gradleGen {
inherit (gradleSpec) nativeVersion;
name = "gradle-${gradleSpec.version}-${gradleSpec.type}";
src = fetchurl {
inherit (gradleSpec) url sha256;
};
};
mkProjectEnv = projectSpec: {
inherit (projectSpec) name version;
initScript = mkInitScript projectSpec;
gradle = args.gradlePackage or mkGradle projectSpec.gradle;
};
gradleEnv = mapAttrs
(_: p: mkProjectEnv p)
(fromJSON (readFile envSpec));
projectEnv = gradleEnv."";
pname = args.pname or projectEnv.name;
version = args.version or projectEnv.version;
in
stdenv.mkDerivation (
args // {
inherit pname version;
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ projectEnv.gradle ];
buildPhase = args.buildPhase or ''
runHook preBuild
(
set -x
env \
"GRADLE_USER_HOME=$(mktemp -d)" \
gradle --offline --no-daemon --no-build-cache \
--info --full-stacktrace --warning-mode=all \
${optionalString enableParallelBuilding "--parallel"} \
${optionalString enableDebug "-Dorg.gradle.debug=true"} \
--init-script ${projectEnv.initScript} \
${concatStringsSep " " gradleFlags}
)
runHook postBuild
'';
dontStrip = true;
}
)