Last active
June 7, 2023 12:11
-
-
Save tennox/9d3e875bf1c2583c1604b22ac62f8e8c to your computer and use it in GitHub Desktop.
devenv reproduction - exit code
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
#!/usr/bin/env bash | |
set -euo pipefail | |
# Docs: https://direnv.net/ | |
if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then | |
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8=" | |
fi | |
nix_direnv_watch_file devenv.nix | |
if ! use flake . --impure; then | |
echo "devenv could not be build. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 | |
fi |
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
# Docs: https://devenv.sh/basics/ | |
{ pkgs, ... }: { | |
BROKEN | |
} |
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
{ | |
inputs = { | |
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; # or use /nixos-unstable to get latest packages, but maybe less caching | |
systems.url = "github:nix-systems/default"; # (i) allows overriding systems easily, see https://github.com/nix-systems/nix-systems#consumer-usage | |
devenv.url = "github:cachix/devenv"; | |
}; | |
outputs = { self, nixpkgs, devenv, systems, flake-parts, ... } @ inputs: ( | |
flake-parts.lib.mkFlake { inherit inputs; } { | |
systems = (import systems); | |
imports = [ | |
inputs.devenv.flakeModule | |
]; | |
perSystem = { config, self', inputs', pkgs, system, ... }: # perSystem docs: https://flake.parts/module-arguments.html#persystem-module-parameters | |
let | |
pkgs = nixpkgs.legacyPackages.${system}; | |
in | |
{ | |
devenv.shells.default = (import ./devenv.nix { inherit pkgs inputs; }); | |
}; | |
} | |
); | |
nixConfig = { | |
extra-substituters = [ "https://devenv.cachix.org" ]; | |
extra-trusted-public-keys = [ "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" ]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment