systems/flake.nix

81 lines
2.2 KiB
Nix

{
description = "monologiq's systems";
inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*";
nix-darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-25.11";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
lanzaboote.url = "github:nix-community/lanzaboote/v1.0.0";
lanzaboote.inputs.nixpkgs.follows = "nixpkgs";
apple-fonts.url = "github:Lyndeno/apple-fonts.nix";
apple-fonts.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{ self, ... }@inputs:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
forEachSupportedSystem =
f:
inputs.nixpkgs.lib.genAttrs supportedSystems (
system:
f {
inherit system;
pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
};
}
);
in
{
nixosConfigurations."hermes" = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
{ nixpkgs.overlays = [ self.overlays.default ]; }
./machines/hermes
./users/pml.nix
];
};
darwinConfigurations."mercure" = inputs.nix-darwin.lib.darwinSystem {
modules = [
{ system.configurationRevision = self.rev or self.dirtyRev or null; }
./machines/mercure
];
};
overlays.default = import ./overlays;
devShells = forEachSupportedSystem (
{ pkgs, system }:
{
default = pkgs.mkShellNoCC {
packages = with pkgs; [
self.formatter.${system}
nixd
];
};
}
);
# Nix formatter
# This applies the formatter that follows RFC 166, which defines a standard format:
# https://github.com/NixOS/rfcs/pull/166
# To format all Nix files:
# git ls-files -z '*.nix' | xargs -0 -r nix fmt
# To check formatting:
# git ls-files -z '*.nix' | xargs -0 -r nix develop --command nixfmt --check
formatter = forEachSupportedSystem ({ pkgs, ... }: pkgs.nixfmt-rfc-style);
};
}