92 lines
2.1 KiB
Nix
92 lines
2.1 KiB
Nix
{
|
|
description = "Arnie's nix flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
|
devenv = {
|
|
url = "github:cachix/devenv";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
devenv,
|
|
...
|
|
}@inputs:
|
|
let
|
|
systems = nixpkgs.lib.genAttrs [
|
|
"x86_64-linux"
|
|
"x86_64-darwin"
|
|
"aarch64-linux"
|
|
"aarch64-darwin"
|
|
];
|
|
in
|
|
{
|
|
lib = {
|
|
forAllSystems =
|
|
function:
|
|
systems (
|
|
system:
|
|
function (
|
|
import nixpkgs {
|
|
inherit system;
|
|
overlays = [
|
|
devenv.overlays.default
|
|
];
|
|
config.allowUnfreePredicate = (pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "terraform" ]);
|
|
}
|
|
)
|
|
);
|
|
|
|
golangci-config-file = ./.golangci.yml;
|
|
|
|
eslint-config-file = ./eslint.config.mjs;
|
|
|
|
cd_root = "cd $DEVENV_ROOT;";
|
|
|
|
control4_env = self.lib.forAllSystems (
|
|
pkgs:
|
|
pkgs.buildEnv {
|
|
name = "control4_env";
|
|
paths = with pkgs; [
|
|
lua5_1
|
|
lua51Packages.busted
|
|
stylua
|
|
nodejs_22
|
|
];
|
|
}
|
|
);
|
|
|
|
mkDevenvShell = devenv.lib.mkShell;
|
|
};
|
|
|
|
formatter = self.lib.forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
|
|
|
|
packages = self.lib.forAllSystems (pkgs: {
|
|
devenv-up = self.devShells.${pkgs.system}.default.config.procfileScript;
|
|
devenv-test = self.devShells.${pkgs.system}.default.config.test;
|
|
});
|
|
|
|
devShells = self.lib.forAllSystems (pkgs: {
|
|
default = self.lib.mkDevenvShell {
|
|
inherit inputs pkgs;
|
|
modules = [
|
|
{
|
|
scripts = {
|
|
fix = {
|
|
exec = ''
|
|
${self.lib.cd_root}
|
|
nix fmt ./*.nix
|
|
'';
|
|
};
|
|
};
|
|
}
|
|
];
|
|
};
|
|
});
|
|
};
|
|
}
|