diff options
| author | Alejandro Soto <alejandro@34project.org> | 2023-02-11 22:19:37 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2023-02-11 22:33:44 -0600 |
| commit | 0a84e13afc368ceedf08b543de459d163b6c1211 (patch) | |
| tree | 85eed662f4825e14ce60b2eeee76f66cc37bba2f | |
| parent | 9596e0e75c6a49083167ef6e2edca9cc448695e1 (diff) | |
home: enable different users on same host
| -rw-r--r-- | flake.nix | 6 | ||||
| -rw-r--r-- | home/default.nix | 11 | ||||
| -rw-r--r-- | home/mail/default.nix | 24 | ||||
| -rw-r--r-- | home/profiles/README.md | 1 |
4 files changed, 30 insertions, 12 deletions
@@ -78,15 +78,15 @@ ]; }; - platformHome = name: platform: + platformHome = platform: let value = home platform; in { inherit value; - name = "${value.config.home.username}@${name}"; + name = "${value.config.home.username}@${value.config.local.hostname}"; }; in - mapAttrs' platformHome (importAll { root = ./home/platform; }); + mapAttrs' (_: platformHome) (importAll { root = ./home/platform; }); }; } diff --git a/home/default.nix b/home/default.nix index 0afdc7c..975e1b8 100644 --- a/home/default.nix +++ b/home/default.nix @@ -9,8 +9,14 @@ with lib; { ./path.nix ]; - options.local.workstation = with lib.types; mkOption { - type = bool; + options.local = with lib.types; { + hostname = mkOption { + type = str; + }; + + workstation = mkOption { + type = bool; + }; }; config = { @@ -30,7 +36,6 @@ with lib; { # changes in each release. stateVersion = "21.11"; - username = "ale"; homeDirectory = "/home/${config.home.username}"; sessionVariables = { diff --git a/home/mail/default.nix b/home/mail/default.nix index a6fe8ff..c858c29 100644 --- a/home/mail/default.nix +++ b/home/mail/default.nix @@ -1,13 +1,25 @@ { config, lib, pkgs, ... }: with lib; { + options.local.mail = with types; { + address = mkOption { + type = str; + }; + + realName = mkOption { + type = str; + }; + + sieve.enable = mkEnableOption "sieve filter"; + }; + config = mkIf (!config.home.isolation.active) { accounts.email = { maildirBasePath = "mail"; accounts.local = { - address = "alejandro@34project.org"; - userName = "alejandro@34project.org"; - realName = "Alejandro Soto"; + address = "${config.local.mail.address}@34project.org"; + userName = "${config.local.mail.address}@34project.org"; + inherit (config.local.mail) realName; primary = true; @@ -37,8 +49,8 @@ with lib; { vimKeys = true; settings = { - record = "+.Sent"; - postponed = "+.Drafts"; + record = "+.sent"; + postponed = "+.drafts"; use_threads = "flat"; index_format = "'%4C %Z %<[y?%<[m?%<[d?%[%H:%M ]&%[%a %d]>&%[%b %d]>&%[%m/%y ]> %-15.15L (%?l?%4l&%4c?) %s'"; @@ -60,7 +72,7 @@ with lib; { find $out -name '*.sieve' -exec ${pkgs.dovecot_pigeonhole}/bin/sievec -c /dev/null {} \; ''; in - { + mkIf config.local.mail.sieve.enable { file."sieve".source = sieve; activation.sieve = hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] '' diff --git a/home/profiles/README.md b/home/profiles/README.md new file mode 100644 index 0000000..37073ba --- /dev/null +++ b/home/profiles/README.md @@ -0,0 +1 @@ +# This directory has been lustrated. |
