From 358bc130408c0eae8dbdc06c84328166f3b82b21 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Sat, 31 Dec 2022 09:01:50 -0700 Subject: [PATCH] modules: remove mu module in favor of env var --- hosts/europa/default.nix | 5 +--- modules/default.nix | 2 +- modules/mu.nix | 60 ---------------------------------------- 3 files changed, 2 insertions(+), 65 deletions(-) delete mode 100644 modules/mu.nix diff --git a/hosts/europa/default.nix b/hosts/europa/default.nix index 7ad0599..67f7e01 100644 --- a/hosts/europa/default.nix +++ b/hosts/europa/default.nix @@ -113,10 +113,6 @@ in { }; }; - muInit = { - enable = true; - }; - services = { pcscd.enable = true; vnstat.enable = true; @@ -163,6 +159,7 @@ in { STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d"; PATH = [ "\${XDG_BIN_HOME}" ]; + MUHOME = "\${HOME}/.config/mu"; }; environment.systemPackages = with pkgs; [ diff --git a/modules/default.nix b/modules/default.nix index c12ef22..b83e511 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,2 +1,2 @@ -{ config, lib, pkgs, ... }: { imports = [ ./ssh-fido-agent.nix ./mu.nix ]; } +{ config, lib, pkgs, ... }: { imports = [ ./ssh-fido-agent.nix ]; } diff --git a/modules/mu.nix b/modules/mu.nix deleted file mode 100644 index 83b0dd7..0000000 --- a/modules/mu.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ config, lib, pkgs, ... }: -let - cfg = config.muInit; - mu = "${pkgs.mu}/bin/mu"; - muInitScript = pkgs.writeScriptBin "mu-init-script" '' - #!${pkgs.runtimeShell} - - set -eu - - MU_HOME=~/.cache/mu - - if [ "${cfg.muHome}" != "mudefault" ]; then - MU_HOME="${cfg.muHome}" - fi - - while true; do - if [ ! -d $MU_HOME ]; then - echo "MU home directory missing: $MU_HOME. Creating it." - ${mu} init ${ - if cfg.muHome != "mudefault" then "--muhome=${cfg.muHome}" else "" - } ${if cfg.mailDir != "" then "--maildir=${cfg.mailDir}" else ""} ${ - if cfg.emailAddress != "" then - "--my-address=${cfg.emailAddress}" - else - "" - } - fi - sleep 5; - done - ''; -in { - options = with lib; { - muInit = { - enable = lib.mkEnableOption "Enable mu server"; - muHome = lib.mkOption { - type = types.str; - default = "mudefault"; - }; - mailDir = lib.mkOption { - type = types.str; - default = "~/Maildir"; - }; - emailAddress = lib.mkOption { - type = types.str; - default = ""; - }; - }; - }; - - config = lib.mkIf config.muInit.enable { - environment.systemPackages = [ muInitScript ]; - systemd.user.services.mu-init = { - script = "${muInitScript}/bin/mu-init-script"; - wantedBy = [ "graphical-session.target" ]; - partOf = [ "graphical-session.target" ]; - after = [ "graphical-session.target" ]; - serviceConfig = { Restart = "on-failure"; }; - }; - }; -}