"type": "github"
}
},
+ "flake-compat": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1767039857,
+ "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
+ "owner": "NixOS",
+ "repo": "flake-compat",
+ "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "repo": "flake-compat",
+ "type": "github"
+ }
+ },
+ "git-hooks": {
+ "inputs": {
+ "flake-compat": "flake-compat",
+ "gitignore": "gitignore",
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1778507602,
+ "narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=",
+ "owner": "cachix",
+ "repo": "git-hooks.nix",
+ "rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a",
+ "type": "github"
+ },
+ "original": {
+ "owner": "cachix",
+ "repo": "git-hooks.nix",
+ "type": "github"
+ }
+ },
+ "gitignore": {
+ "inputs": {
+ "nixpkgs": [
+ "git-hooks",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1709087332,
+ "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "type": "github"
+ }
+ },
"nixpkgs": {
"inputs": {
"nixpkgs-src": "nixpkgs-src"
"root": {
"inputs": {
"devenv": "devenv",
+ "git-hooks": "git-hooks",
"nixpkgs": "nixpkgs"
}
}
...
}:
-let
- user = builtins.getEnv "USER";
-in
{
# https://devenv.sh/basics/
env.GREET = "devenv";
packages = with pkgs; [
git
jujutsu
+ google-java-format
];
# https://devenv.sh/processes/
};
# for taran's computer, should not run for anyone else
- # env.JAVA_HOME = lib.mkForce "/usr/lib/jvm/java-21-openjdk";
- env.JAVA_HOME = if user == "moo" then lib.mkForce "/usr/lib/jvm/java-21-openjdk" else lib.mkDefault "";
+ profiles.user.moo.module = {
+ env.JAVA_HOME = lib.mkForce "/usr/lib/jvm/java-21-openjdk";
+ };
# https://devenv.sh/git-hooks/
# git-hooks.hooks.shellcheck.enable = true;
+ git-hooks.hooks.formatting = {
+ enable = true;
+ name = "Formatting";
+ entry = "google-java-format";
+ types = ["java"];
+ };
+
# See full reference at https://devenv.sh/reference/options/
}
-# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
+ git-hooks:
+ url: github:cachix/git-hooks.nix
+ inputs:
+ nixpkgs:
+ follows: nixpkgs
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling
-
-# If you're using non-OSS software, you can set allow_unfree to true.
allow_unfree: true
-
-# If you're not willing to allow unsupported packages:
-# allow_unsupported_system: false
-
-# If you're willing to use a package that's vulnerable
-# permitted_insecure_packages:
-# - "openssl-1.1.1w"
-
-# If you have more than one devenv you can merge them
-#imports:
-# - ./backend