aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorRachel Powers <508861+Ryex@users.noreply.github.com>2023-06-26 01:57:23 -0700
committerRachel Powers <508861+Ryex@users.noreply.github.com>2023-07-01 17:03:11 -0700
commit671d3c1c80b7d6fbe8910a2070b156c25962b2c9 (patch)
treee36e0f2a227810fe1d6a4088509b42fb02dcd25b /flake.nix
parentdf18d8560dd4648d21cfdddb463e5e9770a822f7 (diff)
parentc523765c197cf63d6830d205f1554cd73e38109e (diff)
downloadPrismLauncher-671d3c1c80b7d6fbe8910a2070b156c25962b2c9.tar.gz
PrismLauncher-671d3c1c80b7d6fbe8910a2070b156c25962b2c9.tar.bz2
PrismLauncher-671d3c1c80b7d6fbe8910a2070b156c25962b2c9.zip
Merge branch 'develop' into chore/add-compiler-warnings
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix78
1 files changed, 7 insertions, 71 deletions
diff --git a/flake.nix b/flake.nix
index f656703c..c3148fe0 100644
--- a/flake.nix
+++ b/flake.nix
@@ -3,11 +3,12 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
- flake-utils.url = "github:numtide/flake-utils";
+ flake-parts.url = "github:hercules-ci/flake-parts";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
- inputs.flake-utils.follows = "flake-utils";
+ inputs.nixpkgs-stable.follows = "nixpkgs";
+ inputs.flake-compat.follows = "flake-compat";
};
flake-compat = {
url = "github:edolstra/flake-compat";
@@ -19,73 +20,8 @@
};
};
- outputs = {
- self,
- nixpkgs,
- flake-utils,
- pre-commit-hooks,
- libnbtplusplus,
- ...
- }: let
- # User-friendly version number.
- version = builtins.substring 0 8 self.lastModifiedDate;
-
- # Supported systems (qtbase is currently broken for "aarch64-darwin")
- supportedSystems = with flake-utils.lib.system; [
- x86_64-linux
- x86_64-darwin
- aarch64-linux
- ];
-
- packagesFn = pkgs: {
- prismlauncher-qt5 = pkgs.libsForQt5.callPackage ./nix {
- inherit version self libnbtplusplus;
- };
- prismlauncher = pkgs.qt6Packages.callPackage ./nix {
- inherit version self libnbtplusplus;
- };
- };
- in
- flake-utils.lib.eachSystem supportedSystems (system: let
- pkgs = nixpkgs.legacyPackages.${system};
- in {
- checks = {
- pre-commit-check = pre-commit-hooks.lib.${system}.run {
- src = ./.;
- hooks = {
- markdownlint.enable = true;
-
- alejandra.enable = true;
- deadnix.enable = true;
-
- clang-format = {
- enable =
- false; # As most of the codebase is **not** formatted, we don't want clang-format yet
- types_or = ["c" "c++"];
- };
- };
- };
- };
-
- packages = let
- packages = packagesFn pkgs;
- in
- packages // {default = packages.prismlauncher;};
-
- devShells.default = pkgs.mkShell {
- inherit (self.checks.${system}.pre-commit-check) shellHook;
- packages = with pkgs; [
- nodePackages.markdownlint-cli
- alejandra
- deadnix
- clang-tools
- ];
-
- inputsFrom = [self.packages.${system}.default];
- buildInputs = with pkgs; [ccache ninja];
- };
- })
- // {
- overlays.default = final: _: (packagesFn final);
- };
+ outputs = inputs:
+ inputs.flake-parts.lib.mkFlake
+ {inherit inputs;}
+ {imports = [./nix];};
}