neomutt and secrets

This commit is contained in:
joy 2024-10-12 21:12:58 +02:00
parent 620839c418
commit 9fef15263a
17 changed files with 344 additions and 33 deletions

7
.sops.yaml Normal file
View file

@ -0,0 +1,7 @@
keys:
- &primary age18duqdfl29gdtgddzh22sd7xz2ngjjcdn8lzwu5k0c4zjkz0unp4s8q98cu
creation_rules:
- path_regex: modules/secrets/secrets.yaml$
key_groups:
- age:
- *primary

View file

@ -96,11 +96,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1728596790, "lastModified": 1728728052,
"narHash": "sha256-RTWhRczv04uFJzGf6thqvJ90sL3dTX9hoteu0VGMcB4=", "narHash": "sha256-c3a3lFl+dscjyQHgTwZ8cxmn3ZL2haU6pBEpWdYSMcA=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "610a9c92c573bf57959ffd371cb4921dd681b272", "rev": "8f2c44880171bdb4ddf3d2ab55227259b02e61e2",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -202,11 +202,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1728597384, "lastModified": 1728660969,
"narHash": "sha256-vMAPqOkEgXlTSFXtb9wCNQrsNp9QZu/nZ8D9UtHgSYc=", "narHash": "sha256-V/2veQnsNM/vJL5iALPyaJ6Y8PE7l0ITSEjPeXkr5HE=",
"owner": "joygnu", "owner": "joygnu",
"repo": "home-manager", "repo": "home-manager",
"rev": "18f8d4d0d39f36efb4fbc036cff168ef28b5f8f2", "rev": "bab6334f3d26731ae74a084de1aea5a3cbbe571d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -373,6 +373,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1728156290,
"narHash": "sha256-uogSvuAp+1BYtdu6UWuObjHqSbBohpyARXDWqgI12Ss=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "17ae88b569bb15590549ff478bab6494dde4a907",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "release-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nmd": { "nmd": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -418,6 +434,7 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-on-droid": "nix-on-droid", "nix-on-droid": "nix-on-droid",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"sops": "sops",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"stylix": "stylix" "stylix": "stylix"
} }
@ -438,7 +455,7 @@
"type": "github" "type": "github"
} }
}, },
"sops-nix": { "sops": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
@ -459,6 +476,27 @@
"type": "github" "type": "github"
} }
}, },
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable_2"
},
"locked": {
"lastModified": 1728345710,
"narHash": "sha256-lpunY1+bf90ts+sA2/FgxVNIegPDKCpEoWwOPu4ITTQ=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "06535d0e3d0201e6a8080dd32dbfde339b94f01b",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
},
"stylix": { "stylix": {
"inputs": { "inputs": {
"base16": "base16", "base16": "base16",
@ -478,11 +516,11 @@
"tinted-tmux": "tinted-tmux" "tinted-tmux": "tinted-tmux"
}, },
"locked": { "locked": {
"lastModified": 1728487226, "lastModified": 1728640680,
"narHash": "sha256-gTOUdO94Y24QgnPVnHTQ/Kch0eM6pHEk/c1WoIxg+qE=", "narHash": "sha256-JH2+RXJNooFtZIN6ZhaGZWn2KChMrso4H7Fkp1Ujrdo=",
"owner": "danth", "owner": "danth",
"repo": "stylix", "repo": "stylix",
"rev": "5699ba97c60455ebafde0fd4e78ca0a2e5a58282", "rev": "f95022bb6e74f726a87975aec982a5aa9fad8691",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -540,16 +578,17 @@
"tinted-kitty": { "tinted-kitty": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1727867815, "lastModified": 1716423189,
"narHash": "sha256-cghdwzPyve13JFeW+Mpqy/sDswlJ4DTffY24R0R7r/U=", "narHash": "sha256-2xF3sH7UIwegn+2gKzMpFi3pk5DlIlM18+vj17Uf82U=",
"owner": "tinted-theming", "owner": "tinted-theming",
"repo": "tinted-kitty", "repo": "tinted-kitty",
"rev": "81b15cb9eb696247af857808d37122188423f73b", "rev": "eb39e141db14baef052893285df9f266df041ff8",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "tinted-theming", "owner": "tinted-theming",
"repo": "tinted-kitty", "repo": "tinted-kitty",
"rev": "eb39e141db14baef052893285df9f266df041ff8",
"type": "github" "type": "github"
} }
}, },

View file

@ -6,12 +6,13 @@
ags, ags,
stylix, stylix,
home-manager, home-manager,
sops-nix,
... ...
} @ inputs: let } @ inputs: let
systemConfig = {modules}: systemConfig = {modules}:
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;}; specialArgs = {inherit inputs;};
modules = modules ++ [home-manager.nixosModules.default]; modules = modules ++ [home-manager.nixosModules.default sops-nix.nixosModules.sops];
}; };
in { in {
nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration { nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration {
@ -56,5 +57,9 @@
url = "github:Mic92/sops-nix"; url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
sops = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
} }

View file

@ -6,5 +6,6 @@
./hardware ./hardware
./services ./services
./programs ./programs
./secrets
]; ];
} }

View file

@ -12,5 +12,6 @@
./bat ./bat
./cmus ./cmus
./tmux ./tmux
./mail
]; ];
} }

View file

@ -0,0 +1,34 @@
{
accounts.email = {
maildirBasePath = ".local/share/mail";
accounts = {
"mail@joygnu.org" = {
primary = true;
address = "mail@joygnu.org";
userName = "mail";
realName = "Joy";
passwordCommand = "cat /run/secrets/mail";
imap.host = "mail.joygnu.org";
smtp.host = "mail.joygnu.org";
};
"spyware@joygnu.org" = {
address = "spyware@joygnu.org";
userName = "spyware";
realName = "Joy";
passwordCommand = "cat /run/secrets/spyware";
imap.host = "mail.joygnu.org";
smtp.host = "mail.joygnu.org";
};
"contact@joygnu.org" = {
address = "contact@joygnu.org";
userName = "contact";
realName = "Joy";
passwordCommand = "cat /run/secrets/contact";
# passwordCommand = "sh /home/joy/nix/modules/programs/home/mail/contact.sh";
imap.host = "mail.joygnu.org";
smtp.host = "mail.joygnu.org";
};
};
};
}

View file

@ -0,0 +1,58 @@
let
muttrc = builtins.readFile (./. + "/muttrc");
in {
accounts.email.accounts = {
"mail@joygnu.org" = {
imap.port = 993;
mbsync.enable = true;
mbsync.create = "both";
neomutt = {
enable = true;
extraMailboxes = [
{mailbox = "Sent";}
{mailbox = "Junk";}
{mailbox = "Trash";}
{mailbox = "Drafts";}
];
};
};
"spyware@joygnu.org" = {
imap.port = 993;
mbsync.enable = true;
mbsync.create = "both";
neomutt = {
enable = true;
extraMailboxes = [
{mailbox = "Sent";}
{mailbox = "Junk";}
{mailbox = "Trash";}
{mailbox = "Drafts";}
];
};
};
"contact@joygnu.org" = {
imap.port = 993;
mbsync.enable = true;
mbsync.create = "both";
neomutt = {
enable = true;
extraMailboxes = [
{mailbox = "Sent";}
{mailbox = "Junk";}
{mailbox = "Trash";}
{mailbox = "Drafts";}
];
};
};
};
programs.mbsync = {
enable = true;
};
programs.neomutt = {
enable = true;
extraConfig = muttrc;
};
imports = [./accounts.nix];
}

View file

@ -0,0 +1,127 @@
bind index i noop
bind pager i noop
macro index,pager i1 '<sync-mailbox><enter-command>source /home/joy/.config/neomutt/contact@joygnu.org<enter><change-folder>!<enter>;<check-stats>' "switch to contact@joygnu.org"
macro index,pager i2 '<sync-mailbox><enter-command>source /home/joy/.config/neomutt/mail@joygnu.org<enter><change-folder>!<enter>;<check-stats>' "switch to mail@joygnu.org"
macro index,pager i3 '<sync-mailbox><enter-command>source /home/joy/.config/neomutt/spyware@joygnu.org<enter><change-folder>!<enter>;<check-stats>' "switch to spyware@joygnu.org"
# Sidebar mappings
set sidebar_visible = yes
set sidebar_width = 20
set sidebar_short_path = yes
set sidebar_next_new_wrap = yes
set mail_check_stats
set sidebar_format = '%D%?F? [%F]?%* %?N?%N/? %?S?%S?'
bind index,pager \Ck sidebar-prev
bind index,pager \Cj sidebar-next
bind index,pager \Co sidebar-open
bind index,pager \Cp sidebar-prev-new
bind index,pager \Cn sidebar-next-new
bind index,pager B sidebar-toggle-visible
color normal white black
color error brightwhite default
color status white brightblack
color sidebar_highlight blue default
# Default index colors
color index white black '.*'
color index_author blue default '.*'
color index_number blue default
color index_subject white default '.*'
# New mail
color index brightwhite brightblack "~N"
color index_author brightblue brightblack "~N"
color index_subject brightwhite brightblack "~N"
# Tagged mail
color index brightwhite blue "~T"
color index_author brightblue blue "~T"
color index_subject brightwhite blue "~T"
# Other colors and aesthetic settings
mono bold bold
mono underline underline
mono indicator reverse
mono error bold
color indicator brightblack white
color sidebar_divider brightblack black
color sidebar_flagged blue black
color sidebar_new white black
color normal white default
color message cyan default
color markers brightwhite white
color attachment white default
color search cyan default
color hdrdefault brightgreen default
# Quoted text
color quoted white default
color quoted1 blue default
color quoted2 cyan default
color quoted3 brightwhite default
color quoted4 brightblue default
color quoted5 brightcyan default
# Signature
color signature brightgreen default
# Bold and Underline
color bold black default
color underline black default
bind index,pager g noop
bind index \Cf noop
bind index,pager M noop
bind index,pager C noop
# General rebindings
bind index gg first-entry
bind index j next-entry
bind index k previous-entry
bind attach <return> view-mailcap
bind attach l view-mailcap
bind editor <space> noop
bind index G last-entry
bind index gg first-entry
bind pager,attach h exit
bind pager j next-line
bind pager k previous-line
bind pager l view-attachments
bind index D delete-message
bind index U undelete-message
bind index L limit
bind index h noop
bind index l display-message
bind index,query <space> tag-entry
#bind browser h goto-parent
macro browser h '<change-dir><kill-line>..<enter>' "Go to parent folder"
bind index,pager H view-raw-message
bind browser l select-entry
bind pager,browser gg top-page
bind pager,browser G bottom-page
bind index,pager,browser d half-down
bind index,pager,browser u half-up
bind index,pager S sync-mailbox
bind index,pager R group-reply
bind editor <Tab> complete-query
macro index,pager gi "<change-folder>=Inbox<enter>" "go to inbox"
macro index,pager Mi ";<save-message>=Inbox<enter>" "move mail to inbox"
macro index,pager Ci ";<copy-message>=Inbox<enter>" "copy mail to inbox"
macro index,pager gd "<change-folder>=Drafts<enter>" "go to drafts"
macro index,pager Md ";<save-message>=Drafts<enter>" "move mail to drafts"
macro index,pager Cd ";<copy-message>=Drafts<enter>" "copy mail to drafts"
macro index,pager gj "<change-folder>=Junk<enter>" "go to junk"
macro index,pager Mj ";<save-message>=Junk<enter>" "move mail to junk"
macro index,pager Cj ";<copy-message>=Junk<enter>" "copy mail to junk"
macro index,pager gt "<change-folder>=Trash<enter>" "go to trash"
macro index,pager Mt ";<save-message>=Trash<enter>" "move mail to trash"
macro index,pager Ct ";<copy-message>=Trash<enter>" "copy mail to trash"
macro index,pager gs "<change-folder>=Sent<enter>" "go to sent"
macro index,pager Ms ";<save-message>=Sent<enter>" "move mail to sent"
macro index,pager Cs ";<copy-message>=Sent<enter>" "copy mail to sent"
macro index,pager ga "<change-folder>=Archive<enter>" "go to archive"
macro index,pager Ma ";<save-message>=Archive<enter>" "move mail to archive"
macro index,pager Ca ";<copy-message>=Archive<enter>" "copy mail to archive"

View file

@ -4,7 +4,6 @@
./gpg ./gpg
./nemo ./nemo
./misc ./misc
./mutt
./code ./code
]; ];
} }

View file

@ -1,16 +0,0 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
mutt-wizard
neomutt
msmtp
curl
isync
pass
lynx
notmuch
abook
mpop
urlscan
vim
];
}

View file

@ -0,0 +1,24 @@
{
sops.defaultSopsFile = ./secrets.yaml;
sops.defaultSopsFormat = "yaml";
sops.age.keyFile = "/home/joy/.config/age/keys.txt";
sops.secrets.mail = {
owner = "joy";
};
sops.secrets.spyware = {
owner = "joy";
};
sops.secrets.contact = {
owner = "joy";
};
users.users.sometestservice = {
home = "/var/lib/sometestservice";
createHome = true;
isSystemUser = true;
group = "sometestservice";
};
users.groups.sometestservice = {};
}

View file

@ -0,0 +1,23 @@
mail: ENC[AES256_GCM,data:fczs+TGhEprQIq90Mj6b+7YMcdc=,iv:VDPWXJ4j0lCB/lGPEav7tc2UyDSeP4pWjwc1GdJaRvc=,tag:dcegyG0iWTNHWwiok9LeCw==,type:str]
spyware: ENC[AES256_GCM,data:qMIq9wxQEWQ12yv3TS5L+vKJ7k0=,iv:4CcYjHu5P/NG2TJHIQGrHxGLpvJkJQwi43vEUTuHzcc=,tag:IkEBbib9sCEYvplLSK6FaQ==,type:str]
contact: ENC[AES256_GCM,data:Ar1oEaGVJrzk2tZjjC1oJevP3ms=,iv:W0ZZe1Okk2DgTRsNaDfwpdUhkXZHdVdENOudUZarhm0=,tag:xUgtoxMkO4WBVn2Ly2ADtA==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age18duqdfl29gdtgddzh22sd7xz2ngjjcdn8lzwu5k0c4zjkz0unp4s8q98cu
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBYaHpVR29HM2NtY3ZyZWt5
YXVtcC9KVjRMMkp1ell3U2s2SElOK29QODFjCk5CWC85cU85L3JLQWhzQ3RWVzU2
SytsaEVoNHNGdlRQZkpCODlJOEhhcncKLS0tIG4yZGdPeG5uOEhLM1M0a0dTUStV
OFFGTHdpNmpvU0NxRkZKakp6d1ZQOHcKlyLSgKBK3W6uRlkFpTTrbClwAmEx7DPL
KpxncKiz0MoFsnlIP2evqPrxS/K9RP3EYRmdSKKr9VuLeWTIg+/nJA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2024-10-12T18:25:06Z"
mac: ENC[AES256_GCM,data:MizKpqos6NOhBMmph5FldnaluqOm/9FBqjexacgmFW+H+3ApyCWSMY85gezXPTkGOPrP1Ic8DIc/ioYH7IlI84KX9fSJ+zbOEqb/mhS1NraSDxo9IC2Xckct/lYfPiOWXmwU6d45oEgCuV9XkrWuZUE6CuaLeAPIYa5RYfFDy4o=,iv:TB7NwNzsXYkEmyEloy4YDfE5GptLSZOny9R6j5dv4wY=,tag:C7FikIcMIBFcoOkHIwcnrw==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.1

View file

@ -7,6 +7,7 @@
./syncthing ./syncthing
./docker ./docker
./invidious ./invidious
./forgejo
./misc ./misc
]; ];
} }

View file

@ -0,0 +1,4 @@
{
services.forgejo.enable = true;
services.forgejo.settings.server.HTTP_PORT = 2000;
}

View file

@ -8,4 +8,8 @@
}; };
}; };
}; };
# services.invidious.domain = "yt.joygnu.org";
# services.invidious.nginx.enable = true;
# security.acme.defaults.email = "mail@joygnu.org";
# security.acme.acceptTerms = true;
} }

View file

@ -72,7 +72,7 @@
"$mod, E, exec, nemo" "$mod, E, exec, nemo"
"$mod, S, exec, firefox" "$mod, S, exec, firefox"
"$mod, X, exec, keepassxc" "$mod, X, exec, keepassxc"
"$mod, M, exec, mw -Y && alacritty -e neomutt" "$mod, M, exec, mbsync -a && alacritty -e neomutt"
"$mod, N, exec, alacritty -e newsboat" "$mod, N, exec, alacritty -e newsboat"
"$mod, A, exec, rofi -show drun" "$mod, A, exec, rofi -show drun"
"$mod, F, exec, freetube" "$mod, F, exec, freetube"

View file

@ -2,7 +2,7 @@
home-manager.users.joy = { home-manager.users.joy = {
home.file.".config/swappy/config".text = '' home.file.".config/swappy/config".text = ''
[Default] [Default]
save_dir=$HOME/media/pic/screen save_dir=$HOME/media/pics/screen
''; '';
home.packages = with pkgs; [ home.packages = with pkgs; [