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

split out flake overrides into a separate module

This commit is contained in:
Daiderd Jordan 2020-10-25 12:55:55 +01:00
parent dfe84e9203
commit 1216e9e0aa
No known key found for this signature in database
GPG key ID: D02435D05B810C96
2 changed files with 24 additions and 20 deletions

View file

@ -2,35 +2,22 @@
# WARNING this is very much still experimental.
description = "A collection of darwin modules";
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
{
outputs = { self, nixpkgs }: {
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;
modules = modules ++ [ versionsModule ];
modules = modules ++ [ self.darwinModules.flakeOverrides ];
});
};
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;
darwinModules.flakeOverrides = ./modules/system/flake-overrides.nix;
darwinModules.hydra = ./modules/examples/hydra.nix;
darwinModules.lnl = ./modules/examples/lnl.nix;
darwinModules.ofborg = ./modules/examples/ofborg.nix;
darwinModules.simple = ./modules/examples/simple.nix;
checks.x86_64-darwin.simple = (self.lib.darwinSystem {
modules = [ self.darwinModules.simple ];

View file

@ -0,0 +1,17 @@
{ lib, inputs, ... }:
with lib;
let
inherit (inputs) darwin nixpkgs;
in
{
config = {
system.darwinVersionSuffix = ".${darwin.shortRev or "dirty"}";
system.darwinRevision = mkIf (darwin ? rev) darwin.rev;
system.nixpkgsVersionSuffix = ".${substring 0 8 (nixpkgs.lastModifiedDate or nixpkgs.lastModified or "19700101")}.${nixpkgs.shortRev or "dirty"}";
system.nixpkgsRevision = mkIf (nixpkgs ? rev) nixpkgs.rev;
};
}