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 398bf95da7
commit 2d62c17f13
No known key found for this signature in database

View file

@ -2,11 +2,40 @@
# TODO: use flake-parts and remove snowfall-lib # TODO: use flake-parts and remove snowfall-lib
outputs = outputs =
inputs: inputs:
inputs.snowfall-lib.mkFlake { inputs.flake-parts.lib.mkFlake { inherit inputs; } (
inherit inputs; top@{
src = ./.; config,
snowfall.namespace = "pantheon"; 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 = { inputs = {
# We use nixos-unstable as everything is cached. # We use nixos-unstable as everything is cached.
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";