Skip to content

Commit

Permalink
Update nixos
Browse files Browse the repository at this point in the history
  • Loading branch information
RitheeshBaradwaj committed Sep 18, 2023
1 parent 4deb4ec commit 5fe6a97
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
9 changes: 5 additions & 4 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/env bash

# Watch & reload direnv on change
watch_file devshell.toml

if [[ $(type -t use_flake) != function ]]; then
echo "ERROR: use_flake function missing."
echo "Please update direnv to v2.30.0 or later."
# Ensure that use_flake function is available
if ! declare -F use_flake &>/dev/null; then
echo "ERROR: The 'use_flake' function is not available."
echo "Please update your 'direnv' to version 2.30.0 or later."
exit 1
fi

# Activate the Nix Flake environment
use flake
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ repos:
hooks:
- id: clang-format
name: Check format of C/C++
exclude: \.proto
entry: clang-format -i

# - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ The above command produces the following output.
```shell
[Cosmos CLI]: Hello from Developers Cosmos!
```

To enter into the flake environment run the below command:

```she
nix shell github:developers-cosmos/cosmos-cli
```
2 changes: 1 addition & 1 deletion devshell.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[env]
FOO = "barh"
FOO = "bar"

[devshell]
packages = [
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "Cosmos CLI";

inputs = {
nixpkgs.url = "https://releases.nixos.org/nixos/23.05/nixos-23.05.861.d3bb401dcfc/nixexprs.tar.xz";
nixpkgs.url = "https://releases.nixos.org/nixos/23.05/nixos-23.05.3580.5d017a8822e0/nixexprs.tar.xz";
flake-utils.url = "git+https://github.com/numtide/flake-utils?ref=main";
};

Expand Down
6 changes: 5 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
(builtins.getFlake ("git+file://" + toString ./.)).devShells.${builtins.currentSystem}.default
let
flake = builtins.getFlake "git+file://${toString ./.}";
currentSystem = builtins.currentSystem;
in
flake.devShells.${currentSystem}.default

0 comments on commit 5fe6a97

Please sign in to comment.