nix: drop flake parts

This commit is contained in:
pengo 2026-06-08 17:13:07 -06:00
parent 36398a1af2
commit bb86ea12ca
2 changed files with 52 additions and 76 deletions

34
flake.lock generated
View file

@ -1,23 +1,5 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1749398372,
"narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1778274207,
@ -34,24 +16,8 @@
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1748740939,
"narHash": "sha256-rQaysilft1aVMwF14xIdGS3sj1yHlI6oKQNBRTF40cc=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "656a64127e9d791a334452c6b6606d17539476e2",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs",
"scenefx": "scenefx"
}

100
flake.nix
View file

@ -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
];
flake = {
hmModules.mango = import ./nix/hm-modules.nix self;
nixosModules.mango = import ./nix/nixos-modules.nix self;
};
perSystem = {
config,
pkgs,
...
nixpkgs,
scenefx,
}: let
inherit (pkgs) callPackage ;
mango = callPackage ./nix {
inherit (inputs.scenefx.packages.${pkgs.stdenv.hostPlatform.system}) scenefx;
};
shellOverride = old: {
nativeBuildInputs = old.nativeBuildInputs ++ [];
buildInputs = old.buildInputs ++ [];
};
in {
packages.default = mango;
overlayAttrs = {
inherit (config.packages) 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.";
};
};
devShells.default = mango.overrideAttrs shellOverride;
formatter = pkgs.alejandra;
};
inherit (nixpkgs.lib) genAttrs;
# Systems mangowm supports. Options that call `forEachSystem` will generate an attribute for each of these options.
systems = [
"x86_64-linux"
"aarch64-linux"
];
# 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;
mango = callPackage ./nix {
inherit (scenefx.packages.${system}) scenefx;
};
in {
inherit mango;
default = mango;
hm-options-json = callPackage (import ./nix/generate-options.nix self) {
module = ./nix/hm-modules.nix;
optionPrefix = "wayland.windowManager.mango.";
};
nixos-options-json = callPackage (import ./nix/generate-options.nix self) {
module = ./nix/nixos-modules.nix;
optionPrefix = "programs.mango.";
};
}
);
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
);
};
}