-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
338 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{ | ||
outputs = { self, ...}: let | ||
versions = builtins.fromJSON (builtins.readFile ./versions.json); | ||
nixpkgs = let | ||
inherit (versions.nixpkgs) owner repo rev; | ||
in builtins.getFlake "github:${owner}/${repo}/${rev}"; | ||
|
||
inherit (nixpkgs) lib; | ||
nixpkgsConfig = import ./nixpkgs-config.nix; | ||
|
||
testConfigFor = system: let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
overlays = [ | ||
self.overlays.default | ||
]; | ||
}; | ||
testlib = import ./tests/testlib.nix { inherit lib; }; | ||
versions = import ./versions.nix { inherit pkgs; }; | ||
in lib.nixosSystem { | ||
inherit pkgs system; | ||
specialArgs.nixos-mailserver = versions.nixos-mailserver; | ||
|
||
modules = [ | ||
({ lib, ... }: | ||
{ | ||
options.virtualisation.vlans = lib.mkOption { | ||
type = lib.types.anything; | ||
default = []; | ||
}; | ||
config = { | ||
networking.domain = "gocept.net"; | ||
|
||
mailserver.domains = [ "example.com" ]; | ||
mailserver.dmarcReporting = { | ||
domain = lib.mkDefault "example.com"; | ||
organizationName = lib.mkDefault "ACME Corp."; | ||
}; | ||
}; | ||
}) | ||
(testlib.fcConfig { | ||
extraEncParameters.environment_url = "example.com"; | ||
}) | ||
]; | ||
}; | ||
|
||
forAllSystems = lib.genAttrs lib.systems.flakeExposed; | ||
in { | ||
overlays.default = import ./pkgs/overlay.nix; | ||
nixosModules.default = import ./nixos/default.nix; | ||
|
||
legacyPackages = forAllSystems (system: import ./. { | ||
inherit nixpkgs system; | ||
overlays = [ self.overlays.default ]; | ||
config = { | ||
inherit (nixpkgsConfig) permittedInsecurePackages; | ||
}; | ||
}); | ||
|
||
options = forAllSystems (system: let | ||
rawOpts = lib.optionAttrSetToDocList (testConfigFor system).options; | ||
|
||
substSpecial = x: | ||
if lib.isDerivation x then { _type = "derivation"; name = x.name; } | ||
else if builtins.isAttrs x then lib.mapAttrs (name: substSpecial) x | ||
else if builtins.isList x then map substSpecial x | ||
else if lib.isFunction x then "<function>" | ||
else x; | ||
|
||
filteredOpts = lib.filter (opt: opt.visible && !opt.internal) rawOpts; | ||
optionsList = lib.flip map filteredOpts | ||
(opt: opt | ||
// lib.optionalAttrs (opt ? example) { example = substSpecial opt.example; } | ||
// lib.optionalAttrs (opt ? default) { default = substSpecial opt.default; } | ||
// lib.optionalAttrs (opt ? type) { type = substSpecial opt.type; } | ||
); | ||
|
||
optionsNix = builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList); | ||
finalOptions = lib.mapAttrsToList (name: option: option // { inherit name; }) optionsNix; | ||
in builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON finalOptions))); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.