-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial commit * Improve flake.nix * Remove hello-world print in flake.nix * Improve flake * Add default package
- Loading branch information
1 parent
1d76996
commit 573e6f6
Showing
10 changed files
with
134 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/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." | ||
exit 1 | ||
fi | ||
|
||
use flake |
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 |
---|---|---|
|
@@ -33,3 +33,4 @@ | |
|
||
/build/ | ||
/bazel-* | ||
/.direnv |
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 @@ | ||
workspace(name = "cosmos-cli") |
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,7 @@ | ||
[env] | ||
FOO = "barh" | ||
|
||
[devshell] | ||
packages = [ | ||
"bazel", | ||
] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,48 @@ | ||
{ | ||
description = "Cosmos CLI"; | ||
|
||
inputs = { | ||
nixpkgs.url = "https://releases.nixos.org/nixos/23.05/nixos-23.05.861.d3bb401dcfc/nixexprs.tar.xz"; | ||
flake-utils.url = "git+https://github.com/numtide/flake-utils?ref=main"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, ... }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
}; | ||
nativeBuildInputs = with pkgs; | ||
[ | ||
bazel_6 | ||
bazel-buildtools | ||
]; | ||
cosmos = pkgs.stdenv.mkDerivation { | ||
name = "cosmos"; | ||
version = "0.0.1"; | ||
src = self; | ||
nativeBuildInputs = nativeBuildInputs; | ||
buildPhase = '' | ||
bazel build //src:hello-world; | ||
''; | ||
|
||
installPhase = '' | ||
mkdir -p $out/bin; | ||
cp -r bazel-bin/src/hello-world $out/bin; | ||
''; | ||
}; | ||
in rec | ||
{ | ||
defaultPackage = cosmos; | ||
devShells.default = pkgs.mkShell { | ||
nativeBuildInputs = nativeBuildInputs ++ [ | ||
cosmos | ||
]; | ||
}; | ||
|
||
# default = pkgs.devshell.mkShell { | ||
# imports = [ (pkgs.devshell.importTOML ./devshell.toml) ]; | ||
# }; | ||
|
||
}); | ||
} |
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 @@ | ||
/nix/store/922i6v34m2r5r8q2qhb8gqflav3zry87-cosmos |
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 @@ | ||
(builtins.getFlake ("git+file://" + toString ./.)).devShells.${builtins.currentSystem}.default |
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,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
nix flake lock --update-input nixpkgs | ||
nix flake update |
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