-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: split devenv.nix into 2 files, one for backend and another for…
… non-essential services
- Loading branch information
Showing
6 changed files
with
207 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
inputs: | ||
nixpkgs-unstable: | ||
url: github:NixOS/nixpkgs/nixos-unstable | ||
imports: | ||
- ./tololo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
{ | ||
"nodes": { | ||
"devenv": { | ||
"locked": { | ||
"dir": "src/modules", | ||
"lastModified": 1736426010, | ||
"owner": "cachix", | ||
"repo": "devenv", | ||
"rev": "1c384bc4be3ee571511fbbc6fdc94fe47d60f6cf", | ||
"type": "github" | ||
}, | ||
"original": { | ||
"dir": "src/modules", | ||
"owner": "cachix", | ||
"repo": "devenv", | ||
"type": "github" | ||
} | ||
}, | ||
"flake-compat": { | ||
"flake": false, | ||
"locked": { | ||
"lastModified": 1733328505, | ||
"owner": "edolstra", | ||
"repo": "flake-compat", | ||
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", | ||
"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": 1733477122, | ||
"owner": "cachix", | ||
"repo": "devenv-nixpkgs", | ||
"rev": "7bd9e84d0452f6d2e63b6e6da29fe73fac951857", | ||
"type": "github" | ||
}, | ||
"original": { | ||
"owner": "cachix", | ||
"ref": "rolling", | ||
"repo": "devenv-nixpkgs", | ||
"type": "github" | ||
} | ||
}, | ||
"nixpkgs-unstable": { | ||
"locked": { | ||
"lastModified": 1736798957, | ||
"owner": "NixOS", | ||
"repo": "nixpkgs", | ||
"rev": "9abb87b552b7f55ac8916b6fc9e5cb486656a2f3", | ||
"type": "github" | ||
}, | ||
"original": { | ||
"owner": "NixOS", | ||
"ref": "nixos-unstable", | ||
"repo": "nixpkgs", | ||
"type": "github" | ||
} | ||
}, | ||
"pre-commit-hooks": { | ||
"inputs": { | ||
"flake-compat": "flake-compat", | ||
"gitignore": "gitignore", | ||
"nixpkgs": [ | ||
"nixpkgs" | ||
] | ||
}, | ||
"locked": { | ||
"lastModified": 1735882644, | ||
"owner": "cachix", | ||
"repo": "pre-commit-hooks.nix", | ||
"rev": "a5a961387e75ae44cc20f0a57ae463da5e959656", | ||
"type": "github" | ||
}, | ||
"original": { | ||
"owner": "cachix", | ||
"repo": "pre-commit-hooks.nix", | ||
"type": "github" | ||
} | ||
}, | ||
"root": { | ||
"inputs": { | ||
"devenv": "devenv", | ||
"nixpkgs": "nixpkgs", | ||
"nixpkgs-unstable": "nixpkgs-unstable", | ||
"pre-commit-hooks": "pre-commit-hooks" | ||
} | ||
} | ||
}, | ||
"root": "root", | ||
"version": 7 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ pkgs, lib, inputs, ... }: | ||
|
||
# backend devenv.nix. contains only the essential dependencies to run the project | ||
let | ||
pkgs-unstable = import inputs.nixpkgs-unstable { system = pkgs.stdenv.system; }; | ||
in | ||
{ | ||
languages.elixir = { | ||
enable = true; | ||
package = pkgs-unstable.beamMinimal26Packages.elixir; | ||
}; | ||
enterShell = '' | ||
export PATH="$HOME/.mix/escripts:$PATH" | ||
''; | ||
|
||
tasks = { | ||
"mix:deps" = { | ||
exec = '' | ||
mix deps.get | ||
''; | ||
# runs before entering shell and before testing | ||
before = [ "devenv:enterShell" "devenv:enterTest" ]; | ||
}; | ||
"mix:format" = { | ||
exec = '' | ||
mix format --check-formatted | ||
''; | ||
}; | ||
}; | ||
|
||
enterTest = '' | ||
mix test | ||
mix credo | ||
''; | ||
|
||
# https://devenv.sh/common-patterns/#configure-the-shell-based-on-the-current-machine | ||
packages = # Linux only | ||
lib.optionals pkgs.stdenv.isLinux [ | ||
# for ExUnit notifier | ||
pkgs.libnotify | ||
|
||
# for package - file_system | ||
pkgs.inotify-tools | ||
] ++ | ||
# Darwin only | ||
lib.optionals pkgs.stdenv.isDarwin [ | ||
# for ExUnit notifier | ||
pkgs.terminal-notifier | ||
|
||
# for package - file_system | ||
pkgs.darwin.apple_sdk.frameworks.CoreFoundation | ||
pkgs.darwin.apple_sdk.frameworks.CoreServices | ||
]; | ||
|
||
services.postgres = { | ||
enable = true; | ||
initialScript = '' | ||
CREATE ROLE postgres WITH SUPERUSER LOGIN PASSWORD 'postgres'; | ||
''; | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
inputs: | ||
nixpkgs-unstable: | ||
url: github:NixOS/nixpkgs/nixos-unstable |