mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-06-19 14:33:16 -04:00
nix: drop flake parts
This commit is contained in:
parent
36398a1af2
commit
bb86ea12ca
2 changed files with 52 additions and 76 deletions
94
flake.nix
94
flake.nix
|
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
scenefx = {
|
||||
url = "github:wlrfx/scenefx";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
|
@ -10,54 +9,65 @@
|
|||
|
||||
outputs = {
|
||||
self,
|
||||
flake-parts,
|
||||
...
|
||||
} @ inputs:
|
||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
imports = [
|
||||
inputs.flake-parts.flakeModules.easyOverlay
|
||||
];
|
||||
nixpkgs,
|
||||
scenefx,
|
||||
}: let
|
||||
inherit (nixpkgs.lib) genAttrs;
|
||||
|
||||
flake = {
|
||||
hmModules.mango = import ./nix/hm-modules.nix self;
|
||||
nixosModules.mango = import ./nix/nixos-modules.nix self;
|
||||
};
|
||||
# Systems mangowm supports. Options that call `forEachSystem` will generate an attribute for each of these options.
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
|
||||
perSystem = {
|
||||
config,
|
||||
# Helper function that generates an attribute set by calling the provided `perSystem` function for each system in `systems` defined above.
|
||||
forEachSystem = perSystem:
|
||||
genAttrs systems (
|
||||
system:
|
||||
perSystem {
|
||||
inherit system;
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
}
|
||||
);
|
||||
in {
|
||||
overlays.default = final: prev: {
|
||||
inherit (self.packages.${final.stdenv.hostPlatform.system}) mango;
|
||||
};
|
||||
|
||||
packages = forEachSystem (
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
system,
|
||||
}: let
|
||||
inherit (pkgs) callPackage ;
|
||||
inherit (pkgs) callPackage;
|
||||
mango = callPackage ./nix {
|
||||
inherit (inputs.scenefx.packages.${pkgs.stdenv.hostPlatform.system}) scenefx;
|
||||
};
|
||||
shellOverride = old: {
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [];
|
||||
buildInputs = old.buildInputs ++ [];
|
||||
inherit (scenefx.packages.${system}) scenefx;
|
||||
};
|
||||
in {
|
||||
packages.default = mango;
|
||||
overlayAttrs = {
|
||||
inherit (config.packages) mango;
|
||||
inherit mango;
|
||||
default = mango;
|
||||
hm-options-json = callPackage (import ./nix/generate-options.nix self) {
|
||||
module = ./nix/hm-modules.nix;
|
||||
optionPrefix = "wayland.windowManager.mango.";
|
||||
};
|
||||
packages = {
|
||||
inherit mango;
|
||||
hm-options-json = pkgs.callPackage (import ./nix/generate-options.nix self) {
|
||||
module = ./nix/hm-modules.nix;
|
||||
optionPrefix = "wayland.windowManager.mango.";
|
||||
};
|
||||
nixos-options-json = pkgs.callPackage (import ./nix/generate-options.nix self) {
|
||||
module = ./nix/nixos-modules.nix;
|
||||
optionPrefix = "programs.mango.";
|
||||
};
|
||||
nixos-options-json = callPackage (import ./nix/generate-options.nix self) {
|
||||
module = ./nix/nixos-modules.nix;
|
||||
optionPrefix = "programs.mango.";
|
||||
};
|
||||
devShells.default = mango.overrideAttrs shellOverride;
|
||||
formatter = pkgs.alejandra;
|
||||
};
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
nixosModules.mango = import ./nix/nixos-modules.nix self;
|
||||
hmModules.mango = import ./nix/hm-modules.nix self;
|
||||
|
||||
devShells = forEachSystem (
|
||||
{system, ...}: {
|
||||
default = self.packages.${system}.mango;
|
||||
}
|
||||
);
|
||||
|
||||
formatter = forEachSystem (
|
||||
{pkgs, ...}: pkgs.alejandra
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue