refactor: use flake-parts, keep snowfall-lib for compatibility

This commit is contained in:
Mohammad Rafiq 2025-07-02 19:49:24 +08:00
parent 66396761aa
commit 670af2b207
No known key found for this signature in database

View file

@ -2,11 +2,40 @@
# TODO: use flake-parts and remove snowfall-lib
outputs =
inputs:
inputs.snowfall-lib.mkFlake {
inherit inputs;
src = ./.;
snowfall.namespace = "pantheon";
};
inputs.flake-parts.lib.mkFlake { inherit inputs; } (
top@{
config,
withSystem,
moduleWithSystem,
...
}:
{
imports = [
# Optional: use external flake logic, e.g.
# inputs.foo.flakeModules.default
];
flake = inputs.snowfall-lib.mkFlake {
inherit inputs;
src = ./.;
snowfall.namespace = "pantheon";
};
systems = [
# systems for which you want to build the `perSystem` attributes
"x86_64-linux"
# ...
];
perSystem =
{ config, pkgs, ... }:
{
# Recommended: move all package definitions here.
# e.g. (assuming you have a nixpkgs input)
# packages.foo = pkgs.callPackage ./foo/package.nix { };
# packages.bar = pkgs.callPackage ./bar/package.nix {
# foo = config.packages.foo;
# };
};
}
);
inputs = {
# We use nixos-unstable as everything is cached.
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";