refactor: update Nix flake to be consistent with the quickgui flake

This commit is contained in:
Martin Wimpress 2024-07-02 02:23:22 +01:00 committed by Martin Wimpress
parent 1cf80e7d81
commit f7861a6e7f
2 changed files with 27 additions and 22 deletions

View File

@ -16,16 +16,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1719506693, "lastModified": 1717952948,
"narHash": "sha256-C8e9S7RzshSdHB7L+v9I51af1gDM5unhJ2xO1ywxNH8=", "narHash": "sha256-mJi4/gjiwQlSaxjA6AusXBN/6rQRaPCycR7bd8fydnQ=",
"rev": "b2852eb9365c6de48ffb0dc2c9562591f652242a", "rev": "2819fffa7fa42156680f0d282c60d81e8fb185b7",
"revCount": 644565, "revCount": 631440,
"type": "tarball", "type": "tarball",
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.644565%2Brev-b2852eb9365c6de48ffb0dc2c9562591f652242a/01906511-d0fc-7244-b596-2d790f5bfdb0/source.tar.gz" "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2405.631440%2Brev-2819fffa7fa42156680f0d282c60d81e8fb185b7/0190034c-678d-7039-b45c-fa38168f2500/source.tar.gz"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz" "url": "https://flakehub.com/f/NixOS/nixpkgs/%2A.tar.gz"
} }
}, },
"root": { "root": {

View File

@ -2,7 +2,7 @@
description = "Quickemu flake"; description = "Quickemu flake";
inputs = { inputs = {
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz"; flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz";
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
}; };
outputs = { outputs = {
@ -10,28 +10,33 @@
flake-schemas, flake-schemas,
nixpkgs, nixpkgs,
}: let }: let
forAllSystems = function: # Define supported systems and a helper function for generating system-specific outputs
nixpkgs.lib.genAttrs [ supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ];
"x86_64-linux"
"aarch64-linux" forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
"x86_64-darwin" system = system;
"aarch64-darwin" pkgs = import nixpkgs { inherit system; };
] (system: function nixpkgs.legacyPackages.${system}); });
in { in {
# Schemas tell Nix about the structure of your flake's outputs # Define schemas for the flake's outputs
schemas = flake-schemas.schemas; schemas = flake-schemas.schemas;
overlays.default = final: prev: { # Define overlays for each supported system
quickemu = final.callPackage ./package.nix {}; overlays = forEachSupportedSystem ({pkgs, system, ...}: {
}; default = final: prev: {
quickemu = final.callPackage ./package.nix { };
};
});
packages = forAllSystems (pkgs: rec { # Define packages for each supported system
quickemu = pkgs.callPackage ./package.nix {}; packages = forEachSupportedSystem ({pkgs, system, ...}: rec {
quickemu = pkgs.callPackage ./package.nix { };
default = quickemu; default = quickemu;
}); });
devShells = forAllSystems (pkgs: { # Define devShells for each supported system
default = pkgs.callPackage ./devshell.nix {}; devShells = forEachSupportedSystem ({pkgs, system, ...}: {
default = pkgs.callPackage ./devshell.nix { };
}); });
}; };
} }