refactor(nix): use flake-utils
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
9dff1bac83
commit
950f921c09
16
flake.lock
16
flake.lock
@ -16,6 +16,21 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-utils": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1676283394,
|
||||||
|
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"libnbtplusplus": {
|
"libnbtplusplus": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
@ -51,6 +66,7 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
"libnbtplusplus": "libnbtplusplus",
|
"libnbtplusplus": "libnbtplusplus",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
39
flake.nix
39
flake.nix
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
flake-compat = {
|
flake-compat = {
|
||||||
url = "github:edolstra/flake-compat";
|
url = "github:edolstra/flake-compat";
|
||||||
flake = false;
|
flake = false;
|
||||||
@ -16,6 +17,7 @@
|
|||||||
outputs = {
|
outputs = {
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
libnbtplusplus,
|
libnbtplusplus,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
@ -23,26 +25,29 @@
|
|||||||
version = builtins.substring 0 8 self.lastModifiedDate;
|
version = builtins.substring 0 8 self.lastModifiedDate;
|
||||||
|
|
||||||
# Supported systems (qtbase is currently broken for "aarch64-darwin")
|
# Supported systems (qtbase is currently broken for "aarch64-darwin")
|
||||||
supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux"];
|
supportedSystems = with flake-utils.lib.system; [
|
||||||
|
x86_64-linux
|
||||||
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
x86_64-darwin
|
||||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
aarch64-linux
|
||||||
|
];
|
||||||
# Nixpkgs instantiated for supported systems.
|
|
||||||
pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
|
|
||||||
|
|
||||||
packagesFn = pkgs: rec {
|
packagesFn = pkgs: rec {
|
||||||
prismlauncher-qt5 = pkgs.libsForQt5.callPackage ./nix {inherit version self libnbtplusplus;};
|
prismlauncher-qt5 = pkgs.libsForQt5.callPackage ./nix {
|
||||||
prismlauncher = pkgs.qt6Packages.callPackage ./nix {inherit version self libnbtplusplus;};
|
inherit version self libnbtplusplus;
|
||||||
|
};
|
||||||
|
prismlauncher = pkgs.qt6Packages.callPackage ./nix {
|
||||||
|
inherit version self libnbtplusplus;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
packages = forAllSystems (
|
flake-utils.lib.eachSystem supportedSystems (system: let
|
||||||
system: let
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
packages = packagesFn pkgs.${system};
|
in {
|
||||||
|
packages = let
|
||||||
|
packages = packagesFn pkgs;
|
||||||
in
|
in
|
||||||
packages // {default = packages.prismlauncher;}
|
packages // {default = packages.prismlauncher;};
|
||||||
);
|
|
||||||
|
|
||||||
overlay = final: packagesFn;
|
overlay = final: packagesFn;
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user