69 lines
1.9 KiB
Nix
69 lines
1.9 KiB
Nix
{
|
|
inputs.clan-core.url = "https://git.clan.lol/clan/clan-core/archive/25.11.tar.gz";
|
|
inputs.nixpkgs.follows = "clan-core/nixpkgs";
|
|
inputs.treefmt-nix.url = "github:numtide/treefmt-nix";
|
|
inputs.treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
clan-core,
|
|
nixpkgs,
|
|
...
|
|
}@inputs:
|
|
let
|
|
# Usage see: https://docs.clan.lol
|
|
clan = clan-core.lib.clan {
|
|
inherit self;
|
|
imports = [ ./clan.nix ];
|
|
specialArgs = { inherit inputs; };
|
|
|
|
# Customize nixpkgs
|
|
# pkgsForSystem =
|
|
# system:
|
|
# import nixpkgs {
|
|
# inherit system;
|
|
# config = {
|
|
# allowUnfree = true;
|
|
# };
|
|
# overlays = [];
|
|
# };
|
|
secrets.age.plugins = [
|
|
"age-plugin-yubikey"
|
|
"age-plugin-fido2-hmac"
|
|
];
|
|
};
|
|
|
|
systems = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"aarch64-darwin"
|
|
"x86_64-darwin"
|
|
];
|
|
forAllSystems = nixpkgs.lib.genAttrs systems;
|
|
pkgsFor = system: clan-core.inputs.nixpkgs.legacyPackages.${system};
|
|
treefmtFor = system: inputs.treefmt-nix.lib.evalModule (pkgsFor system) ./fmt.nix;
|
|
in
|
|
{
|
|
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
|
|
clan = clan.config;
|
|
|
|
# `nix fmt` and the `nix flake check` formatting gate.
|
|
formatter = forAllSystems (system: (treefmtFor system).config.build.wrapper);
|
|
checks = forAllSystems (system: {
|
|
formatting = (treefmtFor system).config.build.check self;
|
|
});
|
|
|
|
# Add the Clan cli tool to the dev shell.
|
|
# Use "nix develop" to enter the dev shell.
|
|
devShells = forAllSystems (system: {
|
|
default = (pkgsFor system).mkShell {
|
|
packages = [
|
|
clan-core.packages.${system}.clan-cli
|
|
(treefmtFor system).config.build.wrapper
|
|
];
|
|
};
|
|
});
|
|
};
|
|
}
|