2020-09-03 06:49:24 +03:00
|
|
|
{
|
|
|
|
description = "Secret management with age";
|
2020-09-18 21:59:01 +03:00
|
|
|
|
2023-01-30 01:42:58 +03:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
|
|
darwin = {
|
|
|
|
url = "github:lnl7/nix-darwin/master";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-04-23 13:22:03 +03:00
|
|
|
home-manager = {
|
|
|
|
url = "github:nix-community/home-manager";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-12-20 19:56:05 +03:00
|
|
|
systems.url = "github:nix-systems/default";
|
2023-01-30 01:42:58 +03:00
|
|
|
};
|
2021-12-04 17:49:07 +03:00
|
|
|
|
2023-01-29 19:02:57 +03:00
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
2023-01-30 01:42:58 +03:00
|
|
|
darwin,
|
2023-04-23 13:22:03 +03:00
|
|
|
home-manager,
|
2023-12-20 19:56:05 +03:00
|
|
|
systems,
|
2023-01-29 19:02:57 +03:00
|
|
|
}: let
|
2023-12-20 19:56:05 +03:00
|
|
|
eachSystem = nixpkgs.lib.genAttrs (import systems);
|
2021-05-10 01:29:34 +03:00
|
|
|
in {
|
|
|
|
nixosModules.age = import ./modules/age.nix;
|
2023-01-29 19:02:57 +03:00
|
|
|
nixosModules.default = self.nixosModules.age;
|
2021-05-10 01:29:34 +03:00
|
|
|
|
2023-01-30 01:42:58 +03:00
|
|
|
darwinModules.age = import ./modules/age.nix;
|
|
|
|
darwinModules.default = self.darwinModules.age;
|
|
|
|
|
2023-04-22 22:24:07 +03:00
|
|
|
homeManagerModules.age = import ./modules/age-home.nix;
|
|
|
|
homeManagerModules.default = self.homeManagerModules.age;
|
|
|
|
|
2023-01-29 19:02:57 +03:00
|
|
|
overlays.default = import ./overlay.nix;
|
2021-05-10 01:29:34 +03:00
|
|
|
|
2023-12-20 19:56:05 +03:00
|
|
|
formatter = eachSystem (system: nixpkgs.legacyPackages.${system}.alejandra);
|
2021-05-10 01:29:34 +03:00
|
|
|
|
2023-12-20 19:56:05 +03:00
|
|
|
packages = eachSystem (system: {
|
|
|
|
agenix = nixpkgs.legacyPackages.${system}.callPackage ./pkgs/agenix.nix {};
|
2023-12-21 08:24:28 +03:00
|
|
|
doc = nixpkgs.legacyPackages.${system}.callPackage ./pkgs/doc.nix {inherit self;};
|
2023-12-20 19:56:05 +03:00
|
|
|
default = self.packages.${system}.agenix;
|
|
|
|
});
|
2023-05-04 02:25:54 +03:00
|
|
|
|
|
|
|
checks =
|
|
|
|
nixpkgs.lib.genAttrs ["aarch64-darwin" "x86_64-darwin"] (system: {
|
|
|
|
integration =
|
|
|
|
(darwin.lib.darwinSystem {
|
|
|
|
inherit system;
|
|
|
|
modules = [
|
|
|
|
./test/integration_darwin.nix
|
2023-12-21 23:15:07 +03:00
|
|
|
|
|
|
|
# Allow new-style nix commands in CI
|
|
|
|
{nix.extraOptions = "experimental-features = nix-command flakes";}
|
2023-12-21 08:56:50 +03:00
|
|
|
|
2023-05-04 02:25:54 +03:00
|
|
|
home-manager.darwinModules.home-manager
|
|
|
|
{
|
|
|
|
home-manager = {
|
|
|
|
verbose = true;
|
|
|
|
useGlobalPkgs = true;
|
|
|
|
useUserPackages = true;
|
|
|
|
backupFileExtension = "hmbak";
|
|
|
|
users.runner = ./test/integration_hm_darwin.nix;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
})
|
|
|
|
.system;
|
2023-01-30 01:42:58 +03:00
|
|
|
})
|
2023-05-04 02:25:54 +03:00
|
|
|
// {
|
|
|
|
x86_64-linux.integration = import ./test/integration.nix {
|
|
|
|
inherit nixpkgs home-manager;
|
|
|
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
|
|
|
system = "x86_64-linux";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
darwinConfigurations.integration-x86_64.system = self.checks.x86_64-darwin.integration;
|
|
|
|
darwinConfigurations.integration-aarch64.system = self.checks.aarch64-darwin.integration;
|
2023-01-30 01:42:58 +03:00
|
|
|
|
2023-05-04 02:25:54 +03:00
|
|
|
# Work-around for https://github.com/nix-community/home-manager/issues/3075
|
|
|
|
legacyPackages = nixpkgs.lib.genAttrs ["aarch64-darwin" "x86_64-darwin"] (system: {
|
|
|
|
homeConfigurations.integration-darwin = home-manager.lib.homeManagerConfiguration {
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
modules = [./test/integration_hm_darwin.nix];
|
|
|
|
};
|
|
|
|
});
|
2021-05-10 01:29:34 +03:00
|
|
|
};
|
2020-09-03 06:49:24 +03:00
|
|
|
}
|