66 lines
1.5 KiB
Nix
66 lines
1.5 KiB
Nix
{
|
|
description = "Arnie's nix flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
|
devshell = {
|
|
url = "github:numtide/devshell";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs = { self, nixpkgs, devshell }:
|
|
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 = [
|
|
devshell.overlays.default
|
|
];
|
|
config.allowUnfreePredicate = (pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "terraform" ]);
|
|
})
|
|
);
|
|
|
|
golangci-config-file = ./.golangci.yml;
|
|
|
|
cd_root = "cd $PRJ_ROOT;";
|
|
|
|
control4_env = self.lib.forAllSystems (pkgs: pkgs.buildEnv {
|
|
name = "control4_env";
|
|
paths = [
|
|
pkgs.lua5_1
|
|
pkgs.lua51Packages.busted
|
|
pkgs.nodejs_22
|
|
];
|
|
});
|
|
};
|
|
|
|
formatter = self.lib.forAllSystems (pkgs: pkgs.nixpkgs-fmt);
|
|
|
|
devShells = self.lib.forAllSystems (pkgs: {
|
|
default = pkgs.devshell.mkShell {
|
|
name = "nix";
|
|
|
|
packages = [
|
|
pkgs.nix-tree
|
|
pkgs.golangci-lint
|
|
];
|
|
|
|
commands = [
|
|
{
|
|
name = "fix";
|
|
command = ''
|
|
${self.lib.cd_root}
|
|
nix fmt .
|
|
'';
|
|
}
|
|
];
|
|
};
|
|
});
|
|
};
|
|
}
|