dot

NixOS dotfiles
git clone https://git.echoz.io/dot.git
Log | Files | Refs

default.nix (1283B)


      1 {
      2   lib,
      3   pkgs,
      4 
      5   user,
      6   ...
      7 }:
      8 {
      9   environment.persistence."/fix".users.${user}.directories = [
     10     {
     11       directory = ".local/state/oama";
     12       mode = "0700";
     13     }
     14   ];
     15 
     16   home-manager.users.${user} =
     17     { config, ... }:
     18     {
     19       options.programs.oama = {
     20         settings = lib.mkOption {
     21           type =
     22             with lib.types;
     23             let
     24               jsonValue = nullOr (oneOf [
     25                 (attrsOf jsonValue)
     26                 (listOf jsonValue)
     27                 number
     28                 str
     29                 bool
     30               ]);
     31             in
     32             jsonValue;
     33           default = null;
     34         };
     35       };
     36 
     37       config =
     38         let
     39           cfg = config.programs.oama;
     40         in
     41         {
     42           home.packages = [ pkgs.oama ];
     43 
     44           xdg.configFile."oama/config.yaml" = lib.mkIf (cfg.settings != null) {
     45             text = builtins.toJSON cfg.settings;
     46           };
     47 
     48           programs.oama.settings = {
     49             encryption.tag = "GPG";
     50             services.google = {
     51               client_id = "406964657835-aq8lmia8j95dhl1a2bvharmfk3t1hgqj.apps.googleusercontent.com";
     52               client_secret = "kSmqreRr0qwBWJgbf5Y-PjSU";
     53               auth_scopes = "https://mail.google.com/";
     54             };
     55           };
     56         };
     57     };
     58 }