Skip to content

Instantly share code, notes, and snippets.

@tennox
Last active June 7, 2023 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tennox/9d3e875bf1c2583c1604b22ac62f8e8c to your computer and use it in GitHub Desktop.
Save tennox/9d3e875bf1c2583c1604b22ac62f8e8c to your computer and use it in GitHub Desktop.
devenv reproduction - exit code
#!/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
# Docs: https://devenv.sh/basics/
{ pkgs, ... }: {
BROKEN
}
{
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