-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f2a4d4
commit 238fb08
Showing
5 changed files
with
258 additions
and
46 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 |
---|---|---|
@@ -1,11 +1 @@ | ||
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" | ||
fi | ||
|
||
watch_file devenv.nix | ||
watch_file devenv.lock | ||
watch_file devenv.yaml | ||
if ! use flake . --impure | ||
then | ||
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 | ||
fi | ||
use flake . --no-pure-eval |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
helmfile-nix | ||
result | ||
.direnv | ||
.devenv |
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 |
---|---|---|
@@ -1,27 +1,55 @@ | ||
{ | ||
description = "helmfile-nix"; | ||
|
||
inputs.devenv.url = "github:cachix/devenv"; | ||
inputs.devenv.inputs.nixpkgs.follows = "nixpkgs"; | ||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
inputs.gomod2nix.url = "github:nix-community/gomod2nix"; | ||
inputs.gomod2nix.inputs.nixpkgs.follows = "nixpkgs"; | ||
inputs.gomod2nix.inputs.flake-utils.follows = "flake-utils"; | ||
|
||
outputs = { self, nixpkgs, flake-utils, gomod2nix }: | ||
(flake-utils.lib.eachDefaultSystem (system: | ||
outputs = | ||
{ | ||
devenv, | ||
flake-utils, | ||
gomod2nix, | ||
nixpkgs, | ||
self, | ||
}@inputs: | ||
(flake-utils.lib.eachDefaultSystem ( | ||
system: | ||
let | ||
pkgs = nixpkgs.legacyPackages.${system}; | ||
|
||
# The current default sdk for macOS fails to compile go projects, so we use a newer one for now. | ||
# This has no effect on other platforms. | ||
callPackage = | ||
pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage; | ||
in { | ||
callPackage = pkgs.darwin.apple_sdk_11_0.callPackage or pkgs.callPackage; | ||
in | ||
{ | ||
packages.default = callPackage ./. { | ||
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication; | ||
}; | ||
devShells.default = callPackage ./shell.nix { | ||
inherit (gomod2nix.legacyPackages.${system}) mkGoEnv gomod2nix; | ||
devShells.default = devenv.lib.mkShell { | ||
inherit inputs pkgs; | ||
modules = [ | ||
( | ||
{ pkgs, ... }: | ||
let | ||
goEnv = gomod2nix.legacyPackages.${system}.mkGoEnv { pwd = ./.; }; | ||
in | ||
{ | ||
packages = with pkgs; [ | ||
goEnv | ||
gomod2nix.legacyPackages.${system}.gomod2nix | ||
docker | ||
helmfile | ||
kubernetes-helm | ||
]; | ||
} | ||
) | ||
]; | ||
}; | ||
})); | ||
} | ||
)); | ||
} |