2024-03-17 18:48:49 +00:00
|
|
|
{ self, ... }:
|
|
|
|
{
|
2023-08-26 22:18:17 +00:00
|
|
|
imports = [
|
2023-08-27 08:05:48 +00:00
|
|
|
./impure/flake-module.nix
|
2023-12-16 19:57:39 +00:00
|
|
|
./backups/flake-module.nix
|
2023-12-18 22:37:45 +00:00
|
|
|
./installation/flake-module.nix
|
2024-03-07 12:30:53 +00:00
|
|
|
./flash/flake-module.nix
|
2023-08-26 22:18:17 +00:00
|
|
|
];
|
2024-03-17 18:48:49 +00:00
|
|
|
perSystem =
|
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
self',
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
|
|
|
checks =
|
2023-10-14 13:54:56 +00:00
|
|
|
let
|
2024-03-25 07:44:39 +00:00
|
|
|
# ensure all options can be rendered after importing clan into nixos
|
|
|
|
renderClanOptions =
|
|
|
|
let
|
|
|
|
docs = pkgs.nixosOptionsDoc {
|
2024-04-09 16:04:26 +00:00
|
|
|
options =
|
|
|
|
(pkgs.nixos {
|
|
|
|
imports = [ self.nixosModules.clanCore ];
|
2024-06-17 10:42:28 +00:00
|
|
|
clan.core.clanDir = ./.;
|
2024-04-09 16:04:26 +00:00
|
|
|
}).options;
|
2024-03-25 07:44:39 +00:00
|
|
|
warningsAreErrors = false;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
docs.optionsJSON;
|
2023-10-14 13:54:56 +00:00
|
|
|
nixosTestArgs = {
|
|
|
|
# reference to nixpkgs for the current system
|
|
|
|
inherit pkgs;
|
|
|
|
# this gives us a reference to our flake but also all flake inputs
|
|
|
|
inherit self;
|
|
|
|
};
|
2024-03-17 18:48:49 +00:00
|
|
|
nixosTests = lib.optionalAttrs (pkgs.stdenv.isLinux) {
|
|
|
|
# import our test
|
|
|
|
secrets = import ./secrets nixosTestArgs;
|
|
|
|
container = import ./container nixosTestArgs;
|
|
|
|
deltachat = import ./deltachat nixosTestArgs;
|
2024-03-22 11:14:36 +00:00
|
|
|
matrix-synapse = import ./matrix-synapse nixosTestArgs;
|
2024-03-17 18:48:49 +00:00
|
|
|
zt-tcp-relay = import ./zt-tcp-relay nixosTestArgs;
|
|
|
|
borgbackup = import ./borgbackup nixosTestArgs;
|
|
|
|
syncthing = import ./syncthing nixosTestArgs;
|
2024-05-31 14:36:37 +00:00
|
|
|
postgresql = import ./postgresql nixosTestArgs;
|
2024-03-17 18:48:49 +00:00
|
|
|
wayland-proxy-virtwl = import ./wayland-proxy-virtwl nixosTestArgs;
|
|
|
|
};
|
|
|
|
|
|
|
|
flakeOutputs =
|
|
|
|
lib.mapAttrs' (
|
|
|
|
name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel
|
|
|
|
) self.nixosConfigurations
|
|
|
|
// lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages
|
|
|
|
// lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells
|
|
|
|
// lib.mapAttrs' (name: config: lib.nameValuePair "home-manager-${name}" config.activation-script) (
|
|
|
|
self'.legacyPackages.homeConfigurations or { }
|
|
|
|
);
|
2023-10-14 13:54:56 +00:00
|
|
|
in
|
2024-05-01 21:16:17 +00:00
|
|
|
{ inherit renderClanOptions; } // nixosTests // flakeOutputs;
|
2024-03-17 18:48:49 +00:00
|
|
|
legacyPackages = {
|
|
|
|
nixosTests =
|
|
|
|
let
|
|
|
|
nixosTestArgs = {
|
|
|
|
# reference to nixpkgs for the current system
|
|
|
|
inherit pkgs;
|
|
|
|
# this gives us a reference to our flake but also all flake inputs
|
|
|
|
inherit self;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
lib.optionalAttrs (pkgs.stdenv.isLinux) {
|
|
|
|
# import our test
|
|
|
|
secrets = import ./secrets nixosTestArgs;
|
|
|
|
container = import ./container nixosTestArgs;
|
|
|
|
};
|
|
|
|
};
|
2023-10-14 13:54:56 +00:00
|
|
|
};
|
2023-08-09 16:42:03 +00:00
|
|
|
}
|