diff --git a/nix/nixos-modules/allCommon.nix b/nix/nixos-modules/allCommon.nix index 1e42cc3..69a29b4 100644 --- a/nix/nixos-modules/allCommon.nix +++ b/nix/nixos-modules/allCommon.nix @@ -3,6 +3,7 @@ { config , lib +, options , pkgs , ... }: diff --git a/nix/nixos-modules/frontend/default.nix b/nix/nixos-modules/frontend/default.nix index 0ea842f..96f5033 100644 --- a/nix/nixos-modules/frontend/default.nix +++ b/nix/nixos-modules/frontend/default.nix @@ -62,6 +62,8 @@ in powerOnBoot = true; }; + gpgSmartcards.enable = true; # scdaemon + graphics.required = true; opengl = { diff --git a/nix/nixos-modules/frontend/home.nix b/nix/nixos-modules/frontend/home.nix index d69df81..97e2cea 100644 --- a/nix/nixos-modules/frontend/home.nix +++ b/nix/nixos-modules/frontend/home.nix @@ -18,6 +18,24 @@ in { + # TODO exclude in own home-manager module + assertions = + let + hwSmartcards = nixosConfig.hardware.gpgSmartcards.enable; + scDaemon = with config.services.gpg-agent; enable && enableScDaemon; + in + [ + { + assertion = hwSmartcards -> scDaemon; + message = "hardware.gpgSmartcards is enabled on system side but gpg-agent’s scDaemon is disabled"; + } + { + assertion = scDaemon -> hwSmartcards; + message = "gpg-agent’s scDaemon is enabled but hardware.gpgSmartcards is disabled on system side"; + } + ]; + + home = { stateVersion = nixosConfig.system.stateVersion;