Create email feature

This commit is contained in:
Sridhar Ratnakumar 2021-04-07 20:00:40 -04:00
parent 3e47c41cdd
commit c0f519099b
5 changed files with 30 additions and 198 deletions

View file

@ -0,0 +1,6 @@
{ pkgs, ... }: {
imports = [
./protonmail-bridge.nix
./himalaya-client.nix
];
}

View file

@ -0,0 +1,17 @@
{ pkgs, lib, ... }: {
environment.systemPackages =
let
# FIXME: This leads to forbidden error
# himalaya = toString inputs.himalaya.defaultApp."${system}".program;
# Wrap himalaya to be aware of ProtonMail's bridge cert.
himalayaWithSslEnv =
pkgs.writeScriptBin "h" ''
#!${pkgs.stdenv.shell}
export SSL_CERT_FILE=~/.config/protonmail/bridge/cert.pem
exec nix run github:srid/himalaya/nixify $*
'';
in
[
himalayaWithSslEnv
];
}

181
flake.lock generated
View file

@ -1,79 +1,8 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1606424373,
"narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1614513358,
"narHash": "sha256-LakhOx3S1dRjnh0b5Dg3mbZyH0ToC9I8Y2wKSkBaTzU=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5466c5bbece17adaab2d82fae80b46e807611bf3",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"flake": false,
"locked": {
"lastModified": 1611672876,
"narHash": "sha256-qHu3uZ/o9jBHiA3MEKHJ06k7w4heOhA+4HCSIvflRxo=",
"owner": "hercules-ci",
"repo": "gitignore",
"rev": "211907489e9f198594c0eb0ca9256a1949c9d412",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore",
"type": "github"
}
},
"himalaya": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"rust-overlay": "rust-overlay",
"utils": "utils"
},
"locked": {
"lastModified": 1617838005,
"narHash": "sha256-i1xwhsAYSJA2/fx5xmX+GXKUJJo3Hqc8jUukj+4wyIc=",
"owner": "srid",
"repo": "himalaya",
"rev": "d84a315274d3b426a24be4266eb696b6524276d7",
"type": "github"
},
"original": {
"owner": "srid",
"ref": "nixify",
"repo": "himalaya",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": "nixpkgs_4"
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1617625716,
@ -89,31 +18,13 @@
"type": "github"
}
},
"naersk": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1614785451,
"narHash": "sha256-TPw8kQvr2UNCuvndtY+EjyXp6Q5GEW2l9UafXXh1XmI=",
"owner": "nmattia",
"repo": "naersk",
"rev": "e0fe990b478a66178a58c69cf53daec0478ca6f9",
"type": "github"
},
"original": {
"owner": "nmattia",
"repo": "naersk",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1617833390,
"narHash": "sha256-puAjU8RcmfqrPYnOuDvESPgA+QtaszUKJZ7jrjnk7iU=",
"owner": "NixOS",
"lastModified": 1617636226,
"narHash": "sha256-iZhBWrOR2DoDs1C+0FlnM9AQLMol/qoGQ+d+S43CKJM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "87df3e15f029f44a3dca474907a3c02bcbe03414",
"rev": "3d1a7716d7f1fccbd7d30ab3b2ed3db831f43bde",
"type": "github"
},
"original": {
@ -137,90 +48,10 @@
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1617325113,
"narHash": "sha256-GksR0nvGxfZ79T91UUtWjjccxazv6Yh/MvEJ82v1Xmw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "54c1e44240d8a527a8f4892608c4bce5440c3ecb",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1617636226,
"narHash": "sha256-iZhBWrOR2DoDs1C+0FlnM9AQLMol/qoGQ+d+S43CKJM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3d1a7716d7f1fccbd7d30ab3b2ed3db831f43bde",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1617636226,
"narHash": "sha256-iZhBWrOR2DoDs1C+0FlnM9AQLMol/qoGQ+d+S43CKJM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3d1a7716d7f1fccbd7d30ab3b2ed3db831f43bde",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"himalaya": "himalaya",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs_5"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1617762447,
"narHash": "sha256-bv1e5VRZnSswnVtBH2Nc1omInZSRgASsS8xO+Fg9whc=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "08263e3fa955acbcb6612c00d920d45e517b242d",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1617631617,
"narHash": "sha256-PARRCz55qN3gy07VJZIlFeOX420d0nGF0RzGI/9hVlw=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b2c27d1a81b0dc266270fa8aeecebbd1807fc610",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
"nixpkgs": "nixpkgs_2"
}
}
},

View file

@ -4,9 +4,6 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
himalaya = {
url = "github:srid/himalaya/nixify";
};
};
outputs = inputs@{ self, home-manager, nixpkgs, ... }:
@ -20,28 +17,9 @@
configurationNix
./features/passwordstore.nix
./features/syncthing.nix
./features/protonmail-bridge.nix
./features/email
./features/monitor-brightness.nix
# Packages from flake inputs
({ pkgs, lib, ... }: {
environment.systemPackages =
let
# FIXME: This leads to forbidden error
# himalaya = toString inputs.himalaya.defaultApp."${system}".program;
# Wrap himalaya to be aware of ProtonMail's bridge cert.
himalayaWithSslEnv =
pkgs.writeScriptBin "h" ''
#!${pkgs.stdenv.shell}
export SSL_CERT_FILE=~/.config/protonmail/bridge/cert.pem
exec nix run github:srid/himalaya/nixify $*
'';
in
[
himalayaWithSslEnv
];
})
# home-manager configuration
home-manager.nixosModules.home-manager
{