2023-08-23 09:58:12 +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-08-26 22:18:17 +00:00
|
|
|
];
|
2023-08-24 12:38:24 +00:00
|
|
|
perSystem = { pkgs, lib, self', ... }: {
|
2023-08-23 09:58:12 +00:00
|
|
|
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) {
|
2023-08-23 09:58:12 +00:00
|
|
|
# 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;
|
2023-11-14 11:58:15 +00:00
|
|
|
meshnamed = import ./meshnamed nixosTestArgs;
|
2023-11-23 14:43:25 +00:00
|
|
|
borgbackup = import ./borgbackup nixosTestArgs;
|
2023-08-23 09:58:12 +00:00
|
|
|
};
|
|
|
|
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 { });
|
2023-08-23 09:58:12 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
2023-08-23 09:58:12 +00:00
|
|
|
};
|
2023-08-09 16:42:03 +00:00
|
|
|
}
|