diff --git a/flake.lock b/flake.lock index 34cf382..5ad96de 100644 --- a/flake.lock +++ b/flake.lock @@ -32,10 +32,27 @@ "type": "github" } }, + "nixpkgs-22_05": { + "locked": { + "lastModified": 1653460991, + "narHash": "sha256-8MgFe84UUKw5k5MybirNH0S+oSluN2cRQGt+ZkW+dxQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0c3bf3a5c3ab6be29138b88900c417660a284fbd", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-22.05", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "nixpkgs": "nixpkgs", - "nixpkgs-21_11": "nixpkgs-21_11" + "nixpkgs-21_11": "nixpkgs-21_11", + "nixpkgs-22_05": "nixpkgs-22_05" } } }, diff --git a/flake.nix b/flake.nix index fb63bcf..f725c36 100644 --- a/flake.nix +++ b/flake.nix @@ -2,12 +2,14 @@ description = "Integrates sops into nixos"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; inputs.nixpkgs-21_11.url = "github:NixOS/nixpkgs/release-21.11"; + inputs.nixpkgs-22_05.url = "github:NixOS/nixpkgs/release-22.05"; nixConfig.extra-substituters = ["https://cache.garnix.io"]; nixConfig.extra-trusted-public-keys = ["cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="]; outputs = { self, nixpkgs, - nixpkgs-21_11 + nixpkgs-21_11, + nixpkgs-22_05 }: let systems = [ "x86_64-linux" @@ -19,7 +21,9 @@ "armv7l-linux" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); - suffix-21_11 = attrs: nixpkgs.lib.mapAttrs' (name: value: nixpkgs.lib.nameValuePair (name + "-21_11") value) attrs; + suffix-version = version: attrs: nixpkgs.lib.mapAttrs' (name: value: nixpkgs.lib.nameValuePair (name + version) value) attrs; + suffix-22_05 = suffix-version "-22_05"; + suffix-21_11 = suffix-version "-21_11"; in { overlay = final: prev: let localPkgs = import ./default.nix {pkgs = final;}; @@ -40,8 +44,16 @@ packages-21_11 = import ./default.nix { pkgs = import nixpkgs-21_11 {inherit system;}; }; + packages-22_05 = import ./default.nix { + pkgs = import nixpkgs-22_05 {inherit system;}; + }; tests-21_11 = packages-21_11.sops-install-secrets.tests; - in tests // (suffix-21_11 tests-21_11) // (suffix-21_11 packages-21_11)); + tests-22_05 = packages-22_05.sops-install-secrets.tests; + in tests // + (suffix-21_11 tests-21_11) // + (suffix-21_11 packages-21_11) // + (suffix-22_05 tests-22_05) // + (suffix-22_05 packages-22_05)); defaultPackage = forAllSystems (system: self.packages.${system}.sops-init-gpg-key); devShell = forAllSystems ( diff --git a/pkgs/sops-install-secrets/nixos-test.nix b/pkgs/sops-install-secrets/nixos-test.nix index 174ac0d..0f2d96a 100644 --- a/pkgs/sops-install-secrets/nixos-test.nix +++ b/pkgs/sops-install-secrets/nixos-test.nix @@ -25,7 +25,7 @@ user-passwords = makeTest { name = "sops-user-passwords"; - machine = { config, ... }: { + nodes.machine = { config, ... }: { imports = [ ../../modules/sops ]; sops = { age.keyFile = ./test-assets/age-keys.txt; @@ -58,7 +58,7 @@ pruning = makeTest { name = "sops-pruning"; - machine = { lib, ... }: { + nodes.machine = { lib, ... }: { imports = [ ../../modules/sops ]; sops = { age.keyFile = ./test-assets/age-keys.txt; @@ -99,7 +99,7 @@ age-keys = makeTest { name = "sops-age-keys"; - machine = { + nodes.machine = { imports = [ ../../modules/sops ]; sops = { age.keyFile = ./test-assets/age-keys.txt; @@ -119,7 +119,7 @@ age-ssh-keys = makeTest { name = "sops-age-ssh-keys"; - machine = { + nodes.machine = { imports = [ ../../modules/sops ]; services.openssh.enable = true; services.openssh.hostKeys = [{ @@ -207,7 +207,7 @@ } // pkgs.lib.optionalAttrs (pkgs.lib.versionAtLeast (pkgs.lib.versions.majorMinor pkgs.lib.version) "22.05") { restart-and-reload = makeTest { name = "sops-restart-and-reload"; - machine = { pkgs, lib, config, ... }: { + nodes.machine = { pkgs, lib, config, ... }: { imports = [ ../../modules/sops ];