diff --git a/flake.lock b/flake.lock index 5876116..8f1ca4a 100644 --- a/flake.lock +++ b/flake.lock @@ -119,6 +119,51 @@ "type": "github" } }, + "fenix": { + "inputs": { + "nixpkgs": [ + "himalaya", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1767250179, + "narHash": "sha256-PnQdWvPZqHp+7yaHWDFX3NYSKaOy0fjkwpR+rIQC7AY=", + "owner": "nix-community", + "repo": "fenix", + "rev": "a3eaf682db8800962943a77ab77c0aae966f9825", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "monthly", + "repo": "fenix", + "type": "github" + } + }, + "fenix_2": { + "inputs": { + "nixpkgs": [ + "neverest", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src_2" + }, + "locked": { + "lastModified": 1732405626, + "narHash": "sha256-uDbQrdOyqa2679kKPzoztMxesOV7DG2+FuX/TZdpxD0=", + "owner": "soywod", + "repo": "fenix", + "rev": "c7af381484169a78fb79a11652321ae80b0f92a6", + "type": "github" + }, + "original": { + "owner": "soywod", + "repo": "fenix", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -225,6 +270,26 @@ "type": "github" } }, + "himalaya": { + "inputs": { + "fenix": "fenix", + "nixpkgs": "nixpkgs", + "pimalaya": "pimalaya" + }, + "locked": { + "lastModified": 1771973819, + "narHash": "sha256-91P+AEIpzmhV7PCk4N3Dd5F+6eCSjwSGzNuMTV7pI8Q=", + "owner": "pimalaya", + "repo": "himalaya", + "rev": "f9bc426b8f157e4c10d8be4b8d8ff30be476e2e4", + "type": "github" + }, + "original": { + "owner": "pimalaya", + "repo": "himalaya", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -296,7 +361,7 @@ "jj-starship": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1769370163, @@ -315,7 +380,7 @@ "llm-agents": { "inputs": { "blueprint": "blueprint", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -332,6 +397,26 @@ "type": "github" } }, + "neverest": { + "inputs": { + "fenix": "fenix_2", + "nixpkgs": "nixpkgs_4", + "pimalaya": "pimalaya_2" + }, + "locked": { + "lastModified": 1734595002, + "narHash": "sha256-MXQDy5b/ooSkISEVM9KxHeqkkhPimZJtX3j9jqTP5aU=", + "owner": "pimalaya", + "repo": "neverest", + "rev": "cc5f5214d3bea064ed059116ac81e40a803faa7e", + "type": "github" + }, + "original": { + "owner": "pimalaya", + "repo": "neverest", + "type": "github" + } + }, "nix-github-actions": { "inputs": { "nixpkgs": [ @@ -373,16 +458,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1766840161, - "narHash": "sha256-Ss/LHpJJsng8vz1Pe33RSGIWUOcqM1fjrehjUkdrWio=", - "owner": "NixOS", + "lastModified": 1736437047, + "narHash": "sha256-JJBziecfU+56SUNxeJlDIgixJN5WYuADd+/TVd5sQos=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "3edc4a30ed3903fdf6f90c837f961fa6b49582d1", + "rev": "f17b95775191ea44bc426831235d87affb10faba", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", + "owner": "nixos", + "ref": "staging-next", "repo": "nixpkgs", "type": "github" } @@ -403,6 +488,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1766840161, + "narHash": "sha256-Ss/LHpJJsng8vz1Pe33RSGIWUOcqM1fjrehjUkdrWio=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3edc4a30ed3903fdf6f90c837f961fa6b49582d1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1771423170, "narHash": "sha256-K7Dg9TQ0mOcAtWTO/FX/FaprtWQ8BmEXTpLIaNRhEwU=", @@ -418,7 +519,22 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { + "locked": { + "lastModified": 1732539489, + "narHash": "sha256-EPstM4aUuClDkFdoyno1CSRZIfGdCfZKw/XzMlQB0NY=", + "owner": "soywod", + "repo": "nixpkgs", + "rev": "87b010196489f96e4acdcc804ed3d096476e46ad", + "type": "github" + }, + "original": { + "owner": "soywod", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { "locked": { "lastModified": 1772370856, "narHash": "sha256-OXf9tB+s1EPCzIBR4eIQTm1dbbfVgjPNEGChgwEvvIU=", @@ -434,7 +550,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_6": { "locked": { "lastModified": 1770380644, "narHash": "sha256-P7dWMHRUWG5m4G+06jDyThXO7kwSk46C1kgjEWcybkE=", @@ -450,7 +566,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_7": { "locked": { "lastModified": 1765934234, "narHash": "sha256-pJjWUzNnjbIAMIc5gRFUuKCDQ9S1cuh3b2hKgA7Mc4A=", @@ -469,7 +585,7 @@ "nixvim": { "inputs": { "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_6", "systems": "systems_3" }, "locked": { @@ -502,26 +618,94 @@ "type": "github" } }, + "pimalaya": { + "flake": false, + "locked": { + "lastModified": 1770914484, + "narHash": "sha256-kPxdpg98/EVQKLkUdiFEYWWWI1uTLWfIewyCmb4ZfpE=", + "owner": "pimalaya", + "repo": "nix", + "rev": "23454cd59e2a32199a67f36f3b13cd5145b5ffb3", + "type": "github" + }, + "original": { + "owner": "pimalaya", + "repo": "nix", + "type": "github" + } + }, + "pimalaya_2": { + "flake": false, + "locked": { + "lastModified": 1732869386, + "narHash": "sha256-83tDRVfSBVZgIp6WOb6r/T6cHfP7lNsK1MUTdkGMi14=", + "owner": "pimalaya", + "repo": "nix", + "rev": "be23e0deeb014c6be5232322b892c9bee25dee77", + "type": "github" + }, + "original": { + "owner": "pimalaya", + "repo": "nix", + "type": "github" + } + }, "root": { "inputs": { "colmena": "colmena", "darwin": "darwin", "disko": "disko", "flake-parts": "flake-parts", + "himalaya": "himalaya", "home-manager": "home-manager", "homebrew-cask": "homebrew-cask", "homebrew-core": "homebrew-core", "jj-ryu": "jj-ryu", "jj-starship": "jj-starship", "llm-agents": "llm-agents", + "neverest": "neverest", "nix-homebrew": "nix-homebrew", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_5", "nixvim": "nixvim", "overseer": "overseer", "sops-nix": "sops-nix", "zjstatus": "zjstatus" } }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1767191410, + "narHash": "sha256-cCZGjubgDWmstvFkS6eAw2qk2ihgWkycw55u2dtLd70=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "a9026e6d5068172bf5a0d52a260bb290961d1cb4", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, + "rust-analyzer-src_2": { + "flake": false, + "locked": { + "lastModified": 1732050317, + "narHash": "sha256-G5LUEOC4kvB/Xbkglv0Noi04HnCfryur7dVjzlHkgpI=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "c0bbbb3e5d7d1d1d60308c8270bfd5b250032bb4", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "rust-overlay": { "inputs": { "nixpkgs": [ @@ -664,7 +848,7 @@ "inputs": { "crane": "crane", "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_7", "rust-overlay": "rust-overlay" }, "locked": { diff --git a/flake.nix b/flake.nix index 00deb2d..079379a 100644 --- a/flake.nix +++ b/flake.nix @@ -45,6 +45,8 @@ url = "github:dmmulroy/overseer"; flake = false; }; + himalaya.url = "github:pimalaya/himalaya"; + neverest.url = "github:pimalaya/neverest"; }; outputs = inputs @ {flake-parts, ...}: diff --git a/overlays/himalaya.nix b/overlays/himalaya.nix new file mode 100644 index 0000000..e16052a --- /dev/null +++ b/overlays/himalaya.nix @@ -0,0 +1,3 @@ +{inputs}: final: prev: { + himalaya = inputs.himalaya.packages.${prev.stdenv.hostPlatform.system}.default; +} diff --git a/overlays/neverest.nix b/overlays/neverest.nix new file mode 100644 index 0000000..f64d1fc --- /dev/null +++ b/overlays/neverest.nix @@ -0,0 +1,3 @@ +{inputs}: final: prev: { + neverest = inputs.neverest.packages.${prev.stdenv.hostPlatform.system}.default; +} diff --git a/profiles/neverest.nix b/profiles/neverest.nix new file mode 100644 index 0000000..6d6979d --- /dev/null +++ b/profiles/neverest.nix @@ -0,0 +1,93 @@ +{ + config, + pkgs, + lib, + ... +}: +with lib; let + tomlFormat = pkgs.formats.toml {}; + account = config.accounts.email.accounts.icloud; + maildirPath = account.maildir.absPath; +in { + home.packages = [pkgs.neverest]; + + xdg.configFile."neverest/config.toml".source = tomlFormat.generate "neverest-config.toml" { + accounts.icloud = { + default = true; + + folder.filters = "all"; + + left = { + backend = { + type = "maildir"; + root-dir = maildirPath; + }; + folder = { + aliases = { + inbox = "INBOX"; + drafts = "Drafts"; + sent = "Sent Messages"; + trash = "Deleted Messages"; + }; + permissions = { + create = true; + delete = true; + }; + }; + flag.permissions.update = true; + message.permissions = { + create = true; + delete = true; + }; + }; + + right = { + backend = { + type = "imap"; + host = "imap.mail.me.com"; + port = 993; + encryption = "tls"; + login = account.userName; + auth = { + type = "password"; + cmd = concatStringsSep " " account.passwordCommand; + }; + }; + folder = { + aliases = { + inbox = "INBOX"; + drafts = "Drafts"; + sent = "Sent Messages"; + trash = "Deleted Messages"; + }; + permissions.delete = false; + }; + message.permissions.delete = false; + }; + }; + }; + + systemd.user.services.neverest-sync = { + Unit = { + Description = "Neverest email sync"; + }; + Service = { + Type = "oneshot"; + ExecStart = "${pkgs.neverest}/bin/neverest sync"; + }; + }; + + systemd.user.timers.neverest-sync = { + Unit = { + Description = "Neverest email sync timer"; + }; + Timer = { + OnBootSec = "1min"; + OnUnitActiveSec = "5min"; + Persistent = true; + }; + Install = { + WantedBy = ["timers.target"]; + }; + }; +}