2020-07-06 07:44:11 +00:00
|
|
|
{
|
|
|
|
description = "Integrates sops into nixos";
|
2020-11-08 13:23:58 +00:00
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
2024-06-29 09:56:18 +00:00
|
|
|
inputs.nixpkgs-stable.url = "github:NixOS/nixpkgs/release-24.05";
|
2024-02-08 12:18:48 +00:00
|
|
|
nixConfig.extra-substituters = ["https://cache.thalheim.io"];
|
|
|
|
nixConfig.extra-trusted-public-keys = ["cache.thalheim.io-1:R7msbosLEZKrxk/lKxf9BTjOOH7Ax3H0Qj0/6wiHOgc="];
|
2022-05-13 21:24:44 +00:00
|
|
|
outputs = {
|
|
|
|
self,
|
|
|
|
nixpkgs,
|
2022-12-04 09:13:42 +00:00
|
|
|
nixpkgs-stable
|
2022-05-13 21:24:44 +00:00
|
|
|
}: let
|
2020-07-06 07:44:11 +00:00
|
|
|
systems = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"x86_64-darwin"
|
2021-08-28 05:04:18 +00:00
|
|
|
"aarch64-darwin"
|
2020-07-06 07:44:11 +00:00
|
|
|
"aarch64-linux"
|
|
|
|
];
|
|
|
|
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
|
2022-05-25 06:40:52 +00:00
|
|
|
suffix-version = version: attrs: nixpkgs.lib.mapAttrs' (name: value: nixpkgs.lib.nameValuePair (name + version) value) attrs;
|
2024-06-29 09:56:18 +00:00
|
|
|
suffix-stable = suffix-version "-24_05";
|
2020-07-06 07:44:11 +00:00
|
|
|
in {
|
2023-03-18 14:54:42 +00:00
|
|
|
overlays.default = final: prev: let
|
2022-05-13 21:24:44 +00:00
|
|
|
localPkgs = import ./default.nix {pkgs = final;};
|
|
|
|
in {
|
|
|
|
inherit (localPkgs) sops-install-secrets sops-init-gpg-key sops-pgp-hook sops-import-keys-hook sops-ssh-to-age;
|
|
|
|
# backward compatibility
|
|
|
|
inherit (prev) ssh-to-pgp;
|
|
|
|
};
|
2023-03-18 15:10:04 +00:00
|
|
|
nixosModules = {
|
2024-10-31 01:02:43 +00:00
|
|
|
sops = ./modules/sops;
|
2023-03-18 15:10:04 +00:00
|
|
|
default = self.nixosModules.sops;
|
|
|
|
};
|
2024-10-31 01:02:43 +00:00
|
|
|
homeManagerModules.sops = ./modules/home-manager/sops.nix;
|
2022-08-04 07:58:45 +00:00
|
|
|
homeManagerModule = self.homeManagerModules.sops;
|
2022-05-13 21:24:44 +00:00
|
|
|
packages = forAllSystems (system:
|
|
|
|
import ./default.nix {
|
|
|
|
pkgs = import nixpkgs {inherit system;};
|
|
|
|
});
|
2022-05-15 06:09:09 +00:00
|
|
|
checks = nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux"]
|
|
|
|
(system: let
|
|
|
|
tests = self.packages.${system}.sops-install-secrets.tests;
|
2022-12-04 09:13:42 +00:00
|
|
|
packages-stable = import ./default.nix {
|
|
|
|
pkgs = import nixpkgs-stable {inherit system;};
|
2022-05-25 06:40:52 +00:00
|
|
|
};
|
2022-12-04 09:13:42 +00:00
|
|
|
tests-stable = packages-stable.sops-install-secrets.tests;
|
2022-05-25 06:40:52 +00:00
|
|
|
in tests //
|
2022-12-04 09:13:42 +00:00
|
|
|
(suffix-stable tests-stable) //
|
|
|
|
(suffix-stable packages-stable));
|
2022-05-15 06:09:09 +00:00
|
|
|
|
2023-03-18 14:54:42 +00:00
|
|
|
devShells = forAllSystems (system: let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
in {
|
|
|
|
unit-tests = pkgs.callPackage ./pkgs/unit-tests.nix {};
|
|
|
|
default = pkgs.callPackage ./shell.nix {};
|
2022-05-13 21:24:44 +00:00
|
|
|
});
|
2020-07-06 07:44:11 +00:00
|
|
|
};
|
|
|
|
}
|