clean up hardening

This commit is contained in:
Grimmauld 2025-01-10 12:50:01 +01:00
parent 28e5a83716
commit 68529879d2
No known key found for this signature in database
14 changed files with 15 additions and 26 deletions

View file

@ -8,7 +8,6 @@ let
inherit (config.grimmShared) inherit (config.grimmShared)
enable enable
firefox firefox
tooling
locale locale
sway sway
; ;
@ -28,9 +27,6 @@ in
programs.firefox = { programs.firefox = {
# package = pkgs.firefox-beta; # package = pkgs.firefox-beta;
enable = true; enable = true;
nativeMessagingHosts.packages =
[ ]
++ lib.optionals (tooling.enable && tooling.pass) [ pkgs.passff-host ];
languagePacks = optionals locale [ languagePacks = optionals locale [
"de" "de"
"en-US" "en-US"

View file

@ -17,7 +17,6 @@ in
imports = [ imports = [
# ./lilypond.nix # ./lilypond.nix
./nix.nix ./nix.nix
./security.nix
./python.nix ./python.nix
./rust.nix ./rust.nix
./lsp.nix ./lsp.nix
@ -25,10 +24,8 @@ in
# ./wine.nix # ./wine.nix
./c.nix ./c.nix
./java.nix ./java.nix
./opensnitch
./ranger.nix ./ranger.nix
# ./defaultProtectHome.nix # ./defaultProtectHome.nix
./apparmor
]; ];
config = mkIf (enable && tooling.enable) { config = mkIf (enable && tooling.enable) {

View file

@ -3,6 +3,9 @@
imports = [ imports = [
./systemd ./systemd
./ssh-as-sudo.nix ./ssh-as-sudo.nix
./apparmor
./opensnitch
./security.nix
]; ];
specialisation.unhardened.configuration = { }; specialisation.unhardened.configuration = { };

View file

@ -7,22 +7,17 @@
... ...
}: }:
let let
inherit (config.grimmShared) enable tooling graphical;
inherit (lib) inherit (lib)
optional optional
optionals
filterAttrs filterAttrs
mkForce
mkDefault mkDefault
mkIf
attrNames attrNames
mkEnableOption
; ;
age_plugins = with pkgs; [ age-plugin-yubikey ]; age_plugins = with pkgs; [ age-plugin-yubikey ];
in in
{ {
config = mkIf enable { config = {
security.polkit.enable = mkDefault true; security.polkit.enable = mkDefault true;
security.rtkit.enable = true; security.rtkit.enable = true;
@ -61,7 +56,7 @@ in
in in
lib.getExe' rage_wrapped "rage"; lib.getExe' rage_wrapped "rage";
programs.yubikey-touch-detector.enable = graphical; programs.yubikey-touch-detector.enable = config.programs.sway.enable;
services.yubikey-agent.enable = true; services.yubikey-agent.enable = true;
environment.systemPackages = environment.systemPackages =
@ -75,16 +70,13 @@ in
yubikey-manager yubikey-manager
yubico-pam yubico-pam
yubikey-personalization yubikey-personalization
pkgs.pass
]) ])
++ age_plugins ++ age_plugins
++ (optionals (tooling.enable && tooling.pass) [ ++ (optional config.security.doas.enable pkgs.sudo-doas-shim);
pkgs.pass # ++ (optional graphical pkgs.lxqt.lxqt-policykit);
(pkgs.writeShellScriptBin "passw" "pass $@")
])
++ (optional config.security.doas.enable pkgs.sudo-doas-shim)
++ (optional graphical pkgs.lxqt.lxqt-policykit);
services.passSecretService.enable = mkIf (tooling.enable && tooling.pass) true; services.passSecretService.enable = true;
services.openssh.settings.LoginGraceTime = 0; services.openssh.settings.LoginGraceTime = 0;
# programs.gnupg.agent = { # programs.gnupg.agent = {
@ -96,10 +88,10 @@ in
# enableSSHSupport = true; # enableSSHSupport = true;
# }; # };
grimmShared.firefox.plugins = mkIf (tooling.enable && tooling.pass) { grimmShared.firefox.plugins = {
"passff@invicem.pro" = "passff"; "passff@invicem.pro" = "passff";
}; };
};
options.grimmShared.tooling.pass = mkEnableOption "Enables password-store, gnupg and such secret handling"; programs.firefox.nativeMessagingHosts.packages = [ pkgs.passff-host ];
};
} }

View file

@ -29,7 +29,8 @@
grimmShared = { grimmShared = {
tooling = { tooling = {
pass = true; enable = true;
# pass = true;
}; };
gaming = true; gaming = true;
portals = true; portals = true;