55 lines
1.7 KiB
Nix
55 lines
1.7 KiB
Nix
{
|
|
description = "Common setup for many projects that use a variety of languages.";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
|
|
|
|
nixago.url = "github:jmgilman/nixago";
|
|
nixago.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
nixago-exts.url = "github:nix-community/nixago-extensions";
|
|
nixago-exts.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs = inputs @ { self, nixpkgs, nixago, nixago-exts, ... }:
|
|
let
|
|
# Helpers for producing system-specific outputs
|
|
supportedSystems = [ "x86_64-linux" ];
|
|
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
|
inherit system;
|
|
pkgs = import nixpkgs { inherit system; };
|
|
});
|
|
in
|
|
{
|
|
# Expose the configuration options for setup.
|
|
nixosModules = {
|
|
mfgames-project-setup = import ./src/modules/default.nix;
|
|
default = self.nixosModules.mfgames-project-setup;
|
|
};
|
|
|
|
# Expose the configuration information.
|
|
lib = forEachSupportedSystem ({ system, pkgs }:
|
|
let
|
|
configs = import ./src/configs/default.nix { inherit system pkgs nixago nixago-exts; };
|
|
in
|
|
configs);
|
|
|
|
# Set up the developer shell.
|
|
devShells = forEachSupportedSystem ({ system, pkgs }:
|
|
let
|
|
configs = import ./src/configs/default.nix { inherit system pkgs nixago nixago-exts; };
|
|
in
|
|
{
|
|
# Shell
|
|
default = pkgs.mkShell {
|
|
shellHook = ''
|
|
${configs.shellHook}
|
|
lefthook install
|
|
'';
|
|
};
|
|
});
|
|
|
|
# Formatting for the Nix files
|
|
formatter = forEachSupportedSystem ({ pkgs, ... }: pkgs.nixpkgs-fmt);
|
|
};
|
|
}
|