1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00
nix-darwin/flake.nix

41 lines
1.3 KiB
Nix
Raw Normal View History

2020-10-18 10:46:59 +00:00
{
# WARNING this is very much still experimental.
description = "A collection of darwin modules";
2020-10-18 10:57:15 +00:00
outputs = { self, nixpkgs }:
let
versionsModule = { lib, ... }: {
_file = ./flake.nix;
config = {
system.darwinVersionSuffix = ".${nixpkgs.shortRev or "dirty"}";
system.darwinRevision = lib.mkIf (self ? rev) self.rev;
system.nixpkgsVersionSuffix = ".${lib.substring 0 8 (nixpkgs.lastModifiedDate or nixpkgs.lastModified or "19700101")}.${nixpkgs.shortRev or "dirty"}";
system.nixpkgsRevision = lib.mkIf (nixpkgs ? rev) nixpkgs.rev;
};
};
in
{
2020-10-18 10:46:59 +00:00
lib = {
# TODO handle multiple architectures.
evalConfig = import ./eval-config.nix { inherit (nixpkgs) lib; };
darwinSystem = { modules, inputs ? {}, ... }@args: self.lib.evalConfig (args // {
inputs = { inherit nixpkgs; darwin = self; } // inputs;
2020-10-18 10:57:15 +00:00
modules = modules ++ [ versionsModule ];
2020-10-18 10:46:59 +00:00
});
};
darwinModules.lnl = import ./modules/examples/lnl.nix;
darwinModules.simple = import ./modules/examples/simple.nix;
darwinModules.ofborg = import ./modules/examples/ofborg.nix;
darwinModules.hydra = import ./modules/examples/hydra.nix;
checks.x86_64-darwin.simple = (self.lib.darwinSystem {
modules = [ self.darwinModules.simple ];
}).system;
};
}