1
0
forked from clan/clan-core
clan-core/checks/flake-module.nix

55 lines
2.0 KiB
Nix
Raw Normal View History

{ self, ... }: {
2023-08-26 22:18:17 +00:00
imports = [
./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
];
2023-08-24 12:38:24 +00:00
perSystem = { pkgs, lib, self', ... }: {
checks =
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;
};
2023-09-28 13:57:12 +00:00
nixosTests = lib.optionalAttrs (pkgs.stdenv.isLinux) {
# import our test
secrets = import ./secrets nixosTestArgs;
2023-10-14 13:54:56 +00:00
container = import ./container nixosTestArgs;
2023-11-03 09:26:11 +00:00
deltachat = import ./deltachat nixosTestArgs;
2024-01-12 13:25:31 +00:00
zt-tcp-relay = import ./zt-tcp-relay nixosTestArgs;
borgbackup = import ./borgbackup nixosTestArgs;
syncthing = import ./syncthing nixosTestArgs;
2023-12-15 11:53:53 +00:00
wayland-proxy-virtwl = import ./wayland-proxy-virtwl nixosTestArgs;
};
schemaTests = pkgs.callPackages ./schemas.nix {
inherit self;
};
2023-08-24 12:38:24 +00:00
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 { });
in
2023-08-24 12:38:24 +00:00
nixosTests // schemaTests // flakeOutputs;
2023-10-14 13:54:56 +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;
};
};
};
}