This repository has been archived on 2023-10-26. You can view files and clone it, but cannot push or open issues or pull requests.
nix-dev-envs/flake.nix

76 lines
2.2 KiB
Nix
Raw Permalink Normal View History

2023-10-21 18:10:11 +00:00
{
description = "Generic development environment for my projects";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }:
let
# overlays = [
# (final: prev:
# let
# exec = pkg: "${prev.${pkg}}/bin/${pkg}";
# in
# {
# format = prev.writeScriptBin "format" ''
# ${exec "nixpkgs-fmt"} **/*.nix
# '';
# dvt = prev.writeScriptBin "dvt" ''
# if [ -z $1 ]; then
# echo "no template specified"
# exit 1
# fi
# TEMPLATE=$1
# ${exec "nix"} \
# --experimental-features 'nix-command flakes' \
# flake init \
# --template \
# "github:the-nix-way/dev-templates#''${TEMPLATE}"
# '';
# update = prev.writeScriptBin "update" ''
# for dir in `ls -d */`; do # Iterate through all the templates
# (
# cd $dir
# ${exec "nix"} flake update # Update flake.lock
# ${exec "nix"} flake check # Make sure things work after the update
# )
# done
# '';
# })
# ];
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
2023-10-26 13:11:06 +00:00
pkgs = import nixpkgs { inherit system; config.allowUnfree = true; }; #overlays
2023-10-21 18:10:11 +00:00
});
in
{
devShells = forEachSupportedSystem ({ pkgs }: {
2023-10-26 12:49:46 +00:00
terraform = pkgs.mkShell {
packages = with pkgs; [
terraform
];
2023-10-21 18:10:11 +00:00
};
2023-10-26 12:49:46 +00:00
# default = pkgs.mkShell {
# packages = with pkgs; [ format update ];
# };
2023-10-21 18:10:11 +00:00
});
2023-10-26 12:49:46 +00:00
# packages = forEachSupportedSystem ({ pkgs }: rec {
# default = dvt;
# inherit (pkgs) dvt;
# });
};
2023-10-21 18:10:11 +00:00
2023-10-26 12:49:46 +00:00
# //
2023-10-21 18:10:11 +00:00
2023-10-26 12:49:46 +00:00
# {
# templates = {
# terraform = {
# path = ./terraform;
# description = "Terraform development environment";
# };
# };
# };
2023-10-21 18:10:11 +00:00
}