build: packaged for a flake
This commit is contained in:
parent
4d4d9a91df
commit
c9f5f7d3ea
96
flake.lock
96
flake.lock
|
@ -1,6 +1,47 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"fenix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-analyzer-src": "rust-analyzer-src"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709965418,
|
||||||
|
"narHash": "sha256-xsKCrFDU6rU3oIqMP3IbuAGiJvsVeBTRqZvwN1p1q4c=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "fenix",
|
||||||
|
"rev": "24002092be13b2efe87700229d143b0d1eaa5d12",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "fenix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": [
|
||||||
|
"systems"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709126324,
|
||||||
|
"narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "d465f4819400de7c8d874d50b982301f28a84605",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils_10": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1653893745,
|
"lastModified": 1653893745,
|
||||||
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
|
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
|
||||||
|
@ -157,7 +198,7 @@
|
||||||
},
|
},
|
||||||
"nixago": {
|
"nixago": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils_2",
|
||||||
"nixago-exts": "nixago-exts",
|
"nixago-exts": "nixago-exts",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"mfgames-project-setup",
|
"mfgames-project-setup",
|
||||||
|
@ -180,7 +221,7 @@
|
||||||
},
|
},
|
||||||
"nixago-exts": {
|
"nixago-exts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils_3",
|
||||||
"nixago": "nixago_2",
|
"nixago": "nixago_2",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"mfgames-project-setup",
|
"mfgames-project-setup",
|
||||||
|
@ -204,7 +245,7 @@
|
||||||
},
|
},
|
||||||
"nixago-exts_2": {
|
"nixago-exts_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_4",
|
"flake-utils": "flake-utils_5",
|
||||||
"nixago": "nixago_3",
|
"nixago": "nixago_3",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"mfgames-project-setup",
|
"mfgames-project-setup",
|
||||||
|
@ -230,7 +271,7 @@
|
||||||
},
|
},
|
||||||
"nixago-exts_3": {
|
"nixago-exts_3": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_6",
|
"flake-utils": "flake-utils_7",
|
||||||
"nixago": "nixago_4",
|
"nixago": "nixago_4",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"mfgames-project-setup",
|
"mfgames-project-setup",
|
||||||
|
@ -253,7 +294,7 @@
|
||||||
},
|
},
|
||||||
"nixago-exts_4": {
|
"nixago-exts_4": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_8",
|
"flake-utils": "flake-utils_9",
|
||||||
"nixago": "nixago_5",
|
"nixago": "nixago_5",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"mfgames-project-setup",
|
"mfgames-project-setup",
|
||||||
|
@ -278,7 +319,7 @@
|
||||||
},
|
},
|
||||||
"nixago_2": {
|
"nixago_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_3",
|
"flake-utils": "flake-utils_4",
|
||||||
"nixago-exts": "nixago-exts_2",
|
"nixago-exts": "nixago-exts_2",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"mfgames-project-setup",
|
"mfgames-project-setup",
|
||||||
|
@ -304,7 +345,7 @@
|
||||||
},
|
},
|
||||||
"nixago_3": {
|
"nixago_3": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_5",
|
"flake-utils": "flake-utils_6",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"mfgames-project-setup",
|
"mfgames-project-setup",
|
||||||
"nixago",
|
"nixago",
|
||||||
|
@ -330,7 +371,7 @@
|
||||||
},
|
},
|
||||||
"nixago_4": {
|
"nixago_4": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_7",
|
"flake-utils": "flake-utils_8",
|
||||||
"nixago-exts": "nixago-exts_4",
|
"nixago-exts": "nixago-exts_4",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"mfgames-project-setup",
|
"mfgames-project-setup",
|
||||||
|
@ -355,7 +396,7 @@
|
||||||
},
|
},
|
||||||
"nixago_5": {
|
"nixago_5": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_9",
|
"flake-utils": "flake-utils_10",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"mfgames-project-setup",
|
"mfgames-project-setup",
|
||||||
"nixago-exts",
|
"nixago-exts",
|
||||||
|
@ -408,8 +449,43 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"fenix": "fenix",
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
"mfgames-project-setup": "mfgames-project-setup",
|
"mfgames-project-setup": "mfgames-project-setup",
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_2",
|
||||||
|
"systems": "systems"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rust-analyzer-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1709904211,
|
||||||
|
"narHash": "sha256-Vv29QP5eIn9ZEapQzXHqwhjm46sddetiZScTWY0/dlA=",
|
||||||
|
"owner": "rust-lang",
|
||||||
|
"repo": "rust-analyzer",
|
||||||
|
"rev": "2397e7a887252aa995d3790164b34b6c76ed94b4",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "rust-lang",
|
||||||
|
"ref": "nightly",
|
||||||
|
"repo": "rust-analyzer",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1680978846,
|
||||||
|
"narHash": "sha256-Gtqg8b/v49BFDpDetjclCYXm8mAnTrUzR0JnE2nv5aw=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "x86_64-linux",
|
||||||
|
"rev": "2ecfcac5e15790ba6ce360ceccddb15ad16d08a8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "x86_64-linux",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
110
flake.nix
110
flake.nix
|
@ -2,48 +2,80 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
|
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
|
||||||
mfgames-project-setup.url = "git+https://src.mfgames.com/nixos-contrib/mfgames-project-setup-flake.git";
|
mfgames-project-setup.url = "git+https://src.mfgames.com/nixos-contrib/mfgames-project-setup-flake.git";
|
||||||
|
|
||||||
|
systems.url = "github:nix-systems/x86_64-linux";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
flake-utils.inputs.systems.follows = "systems";
|
||||||
|
|
||||||
|
fenix = {
|
||||||
|
url = "github:nix-community/fenix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs @ { self, nixpkgs, mfgames-project-setup, ... }:
|
outputs = inputs @ { self, nixpkgs, mfgames-project-setup, flake-utils, fenix, ... }:
|
||||||
let
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
# Helpers for producing system-specific outputs
|
let
|
||||||
supportedSystems = [ "x86_64-linux" ];
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
|
||||||
inherit system;
|
|
||||||
pkgs = import nixpkgs { inherit system; };
|
|
||||||
});
|
|
||||||
in
|
|
||||||
rec
|
|
||||||
{
|
|
||||||
# Set up the developer shell.
|
|
||||||
devShells = forEachSupportedSystem ({ system, pkgs }:
|
|
||||||
let
|
|
||||||
project-config = mfgames-project-setup.lib.mkConfig {
|
|
||||||
inherit system pkgs;
|
|
||||||
contributorCovenant.enable = true;
|
|
||||||
contributorCovenant.contact = "contact@mfgames.com";
|
|
||||||
developerCertificateOfOrigin.enable = true;
|
|
||||||
rust.enable = true;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
# Shell
|
|
||||||
default = pkgs.mkShell {
|
|
||||||
packages = [
|
|
||||||
# Rust
|
|
||||||
pkgs.rustup
|
|
||||||
|
|
||||||
# git2 crate
|
rustPlatform = (pkgs.makeRustPlatform {
|
||||||
pkgs.pkg-config
|
inherit (fenix.packages.${system}.minimal) cargo rustc;
|
||||||
pkgs.openssl
|
|
||||||
]
|
|
||||||
++ project-config.packages;
|
|
||||||
|
|
||||||
shellHook = project-config.shellHook;
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# Create a binary for the project.
|
||||||
|
packages = rec {
|
||||||
|
mfgames-conventional-commit = rustPlatform.buildRustPackage {
|
||||||
|
pname = "mfgames-conventional-commit";
|
||||||
|
version = "0.0.1";
|
||||||
|
src = ./.;
|
||||||
|
#cargoBuildFlags = "-p app";
|
||||||
|
|
||||||
# Formatting for the Nix files
|
cargoLock = {
|
||||||
formatter = forEachSupportedSystem ({ pkgs, ... }: pkgs.nixpkgs-fmt);
|
lockFile = ./Cargo.lock;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ pkgs.pkg-config ];
|
||||||
|
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
|
||||||
|
};
|
||||||
|
|
||||||
|
default = mfgames-conventional-commit;
|
||||||
|
};
|
||||||
|
|
||||||
|
apps = rec {
|
||||||
|
mfgames-conventional-commit = flake-utils.lib.mkApp { drv = self.packages.${system}.mfgames-conventional-commit; };
|
||||||
|
default = mfgames-conventional-commit;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Set up the developer shell.
|
||||||
|
devShells =
|
||||||
|
let
|
||||||
|
project-config = mfgames-project-setup.lib.mkConfig {
|
||||||
|
inherit system pkgs;
|
||||||
|
contributorCovenant.enable = true;
|
||||||
|
contributorCovenant.contact = "contact@mfgames.com";
|
||||||
|
developerCertificateOfOrigin.enable = true;
|
||||||
|
rust.enable = true;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# Shell
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
packages = [
|
||||||
|
# Rust
|
||||||
|
pkgs.rustup
|
||||||
|
|
||||||
|
# git2 crate
|
||||||
|
pkgs.pkg-config
|
||||||
|
pkgs.openssl
|
||||||
|
]
|
||||||
|
++ project-config.packages;
|
||||||
|
|
||||||
|
shellHook = project-config.shellHook;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Formatting for the Nix files
|
||||||
|
formatter = pkgs.nixpkgs-fmt;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue