Skip to content

Commit

Permalink
Add Devenv/Nix Enviroment (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
catrielmuller authored Oct 2, 2024
1 parent a0519d3 commit 1daa3c2
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_url "https://raw.githubusercontent.com/cachix/devenv/95f329d49a8a5289d31e0982652f7058a189bfca/direnvrc" "sha256-d+8cBpDfDBj41inrADaJt+bDWhOktwslgoP5YiGJ1v0="

use devenv
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Next
.next
out
node_modules

# Devenv
.devenv*
devenv.local.nix

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml
116 changes: 116 additions & 0 deletions devenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1727779147,
"owner": "cachix",
"repo": "devenv",
"rev": "eb86c60fc04a8be6a544b2647cc0ca8dc611533e",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1716977621,
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1727672256,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1719f27dd95fd4206afb9cec9f415b539978827e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1727854478,
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "5f58871c9657b5fc0a7f65670fe2ba99c26c1d79",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
}
},
"root": "root",
"version": 7
}
53 changes: 53 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{ pkgs, lib, config, inputs, ... }:

{
# https://devenv.sh/basics/
env.PROJECT = "devs-arg/faq";

# https://devenv.sh/packages/
packages = [
pkgs.git
];

# https://devenv.sh/languages/
languages = {
javascript = {
enable = true;
npm = {
enable = true;
};
};
typescript = {
enable = true;
};
};

# https://devenv.sh/processes/
# processes.cargo-watch.exec = "cargo-watch";

# https://devenv.sh/services/
# services.postgres.enable = true;

# https://devenv.sh/scripts/
scripts.hello.exec = ''
echo $PROJECT
'';

enterShell = ''
hello
'';

# https://devenv.sh/tasks/
# tasks = {
# "myproj:setup".exec = "mytool build";
# "devenv:enterShell".after = [ "myproj:setup" ];
# };

# https://devenv.sh/tests/
enterTest = "";

# https://devenv.sh/pre-commit-hooks/
# pre-commit.hooks.shellcheck.enable = true;

# See full reference at https://devenv.sh/reference/options/
}
15 changes: 15 additions & 0 deletions devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling

# 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

0 comments on commit 1daa3c2

Please sign in to comment.