From 73e40f81c602536664ac3445b2f2b6d3a7d43bb3 Mon Sep 17 00:00:00 2001 From: Sean Buckley Date: Fri, 11 Jun 2021 16:36:50 -0400 Subject: [PATCH] move mfa to pofiles --- default.nix | 1 - modules/mfa.nix | 24 ------------------------ modules/profiles.nix | 20 ++++++++++++++++++++ 3 files changed, 20 insertions(+), 25 deletions(-) delete mode 100644 modules/mfa.nix diff --git a/default.nix b/default.nix index 6f86c52..30b8a65 100644 --- a/default.nix +++ b/default.nix @@ -5,7 +5,6 @@ ./modules/baseline.nix ./modules/cli.nix ./modules/gnome.nix - ./modules/mfa.nix ./modules/phpipam.nix ./modules/profiles.nix ./modules/scansnap_s1300.nix diff --git a/modules/mfa.nix b/modules/mfa.nix deleted file mode 100644 index 5cd088c..0000000 --- a/modules/mfa.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs, ... }: -let - pkcslib = "${pkgs.opensc}/lib/opensc-pkcs11.so"; -in -{ - services.pcscd.enable = true; - programs.ssh.startAgent = true; - programs.ssh.agentPKCS11Whitelist = pkcslib; - environment.systemPackages = [ - pkgs.opensc - (pkgs.writeShellScriptBin "mfa" "exec ssh-add -s${pkcslib}") - ]; - - nixpkgs.overlays = [ - (self: super: { - gnome = super.gnome // { - gnome-keyring = super.gnome.gnome-keyring.overrideAttrs (old: { - configureFlags = old.configureFlags ++ [ "--disable-ssh-agent" ]; - }); - }; - }) - ]; - -} diff --git a/modules/profiles.nix b/modules/profiles.nix index a50d375..5e6f344 100644 --- a/modules/profiles.nix +++ b/modules/profiles.nix @@ -2,6 +2,9 @@ with lib; let cfg = config.sconfig.profile; + + pkcslib = "${pkgs.opensc}/lib/opensc-pkcs11.so"; + in { options.sconfig.profile = mkOption { @@ -22,6 +25,20 @@ in (mkIf (cfg == "desktop") { + services.pcscd.enable = true; + programs.ssh.startAgent = true; + programs.ssh.agentPKCS11Whitelist = pkcslib; + + nixpkgs.overlays = [ + (self: super: { + gnome = super.gnome // { + gnome-keyring = super.gnome.gnome-keyring.overrideAttrs (old: { + configureFlags = old.configureFlags ++ [ "--disable-ssh-agent" ]; + }); + }; + }) + ]; + environment.systemPackages = with pkgs; [ brave gimp @@ -34,6 +51,9 @@ in glxinfo steam-run + pkgs.opensc + (pkgs.writeShellScriptBin "mfa" "exec ssh-add -s${pkcslib}") + (vscode-with-extensions.override { vscode = vscodium; vscodeExtensions = with pkgs.vscode-extensions; [