Skip to content

Commit

Permalink
add devenv for quick development on nixos
Browse files Browse the repository at this point in the history
  • Loading branch information
aetaric committed Sep 29, 2024
1 parent 4e4a528 commit 2f8ff8c
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 1 deletion.
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ checkrr
badfiles.csv
checkrr.log
webserver/build
webserver/node_modules
webserver/node_modules
.devenv/
.direnv/
.devenv.flake.nix
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": 1727457166,
"owner": "cachix",
"repo": "devenv",
"rev": "6090da46bfb53e358b818cee491df1a25daa85e0",
"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": 1727540905,
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "fbca5e745367ae7632731639de5c21f29c8744ed",
"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": 1727514110,
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "85f7a7177c678de68224af3402ab8ee1bcee25c8",
"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
}
43 changes: 43 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{ pkgs, lib, config, inputs, ... }:

{
# https://devenv.sh/basics/
env.GREET = "devenv";

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

languages = {
go.enable = true;
javascript = {
enable = true;
npm = {
enable = true;
install.enable = true;
};
yarn = {
enable = true;
install.enable = true;
};
};
};

enterShell = ''
go version
node --version
yarn --version
'';

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

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

# See full reference at https://devenv.sh/reference/options/
}

0 comments on commit 2f8ff8c

Please sign in to comment.