Compare commits
No commits in common. "5658f13955e13117d920c848636c16b7c7b10a72" and "9df249c52d85a8bcd0c17287734b994ebaabc6c0" have entirely different histories.
5658f13955
...
9df249c52d
12 changed files with 72 additions and 104 deletions
11
flake.lock
generated
11
flake.lock
generated
|
@ -675,15 +675,16 @@
|
||||||
"osx-kvm": "osx-kvm"
|
"osx-kvm": "osx-kvm"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1727105240,
|
"lastModified": 1708168451,
|
||||||
"narHash": "sha256-FEuqbcZ4TDUMwCpTA/E3J5L7pLD4U+zXPnZbmXSmaJo=",
|
"narHash": "sha256-loWlwexnfQGFsEHeJbXpWbnmeDFkBwZB38+4BkUcGhM=",
|
||||||
"owner": "MatthewCroughan",
|
"owner": "aciceri",
|
||||||
"repo": "NixThePlanet",
|
"repo": "NixThePlanet",
|
||||||
"rev": "2f622af217807da78e44a5a15f620743dac57f46",
|
"rev": "e8c91035d01f5082ccf30e351dcd993a5b480a72",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "MatthewCroughan",
|
"owner": "aciceri",
|
||||||
|
"ref": "nix-in-darwin",
|
||||||
"repo": "NixThePlanet",
|
"repo": "NixThePlanet",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
};
|
};
|
||||||
dream2nix.url = "github:nix-community/dream2nix";
|
dream2nix.url = "github:nix-community/dream2nix";
|
||||||
nixThePlanet = {
|
nixThePlanet = {
|
||||||
url = "github:MatthewCroughan/NixThePlanet/";
|
url = "github:aciceri/NixThePlanet/nix-in-darwin";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
nixDarwin = {
|
nixDarwin = {
|
||||||
|
|
|
@ -10,4 +10,30 @@
|
||||||
platformTheme.name = lib.mkForce "kvantum";
|
platformTheme.name = lib.mkForce "kvantum";
|
||||||
style.name = lib.mkForce "kvantum";
|
style.name = lib.mkForce "kvantum";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# TODO move away
|
||||||
|
programs.alacritty = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
font = {
|
||||||
|
normal = {
|
||||||
|
family = "Fira Code";
|
||||||
|
style = "Regular";
|
||||||
|
};
|
||||||
|
bold = {
|
||||||
|
family = "Fira Code";
|
||||||
|
style = "Bold";
|
||||||
|
};
|
||||||
|
italic = {
|
||||||
|
family = "Cascadia Code";
|
||||||
|
style = "Italic";
|
||||||
|
};
|
||||||
|
bold_italic = {
|
||||||
|
family = "Fira Code";
|
||||||
|
style = "Bold Italic";
|
||||||
|
};
|
||||||
|
size = 13;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
secrets,
|
secrets,
|
||||||
fleetFlake,
|
|
||||||
lib,
|
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
@ -177,6 +175,9 @@
|
||||||
compose = {
|
compose = {
|
||||||
no-attachment-warning = "^[^>]*attach(ed|ment)";
|
no-attachment-warning = "^[^>]*attach(ed|ment)";
|
||||||
};
|
};
|
||||||
|
triggers = {
|
||||||
|
email-received = ''exec notify-send "New email from %n" "%s"'';
|
||||||
|
};
|
||||||
filters = {
|
filters = {
|
||||||
"text/plain" = "colorize";
|
"text/plain" = "colorize";
|
||||||
"text/html" = "html";
|
"text/html" = "html";
|
||||||
|
@ -187,18 +188,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services.emails-watcher = {
|
|
||||||
Unit.Description = "Send notifications when new emails arrive";
|
|
||||||
Install = {
|
|
||||||
WantedBy = [ "default.target" ];
|
|
||||||
};
|
|
||||||
Service = {
|
|
||||||
ExecStart = "${lib.getExe fleetFlake.packages.${pkgs.system}.emails-watcher}";
|
|
||||||
Environment = [ "INBOX_NEW=~/Maildir/autistici/Inbox/new" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
accounts.email = {
|
accounts.email = {
|
||||||
accounts.autistici = {
|
accounts.autistici = {
|
||||||
aerc.enable = true;
|
aerc.enable = true;
|
||||||
|
|
|
@ -16,9 +16,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = ''
|
ExecStart = "sleep 5 && ${lib.getExe pkgs.zmkBATx}";
|
||||||
${pkgs.runtimeShell} -l -c "${lib.getExe' pkgs.busybox "sleep"} 5 && ${lib.getExe pkgs.zmkBATx}"
|
|
||||||
'';
|
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = 3;
|
RestartSec = 3;
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,11 +44,9 @@
|
||||||
inputs.disko.nixosModules.disko
|
inputs.disko.nixosModules.disko
|
||||||
inputs.nixosHardware.nixosModules.lenovo-thinkpad-x1-7th-gen
|
inputs.nixosHardware.nixosModules.lenovo-thinkpad-x1-7th-gen
|
||||||
inputs.lix-module.nixosModules.default
|
inputs.lix-module.nixosModules.default
|
||||||
inputs.catppuccin.nixosModules.catppuccin
|
|
||||||
];
|
];
|
||||||
extraHmModules = [
|
extraHmModules = [
|
||||||
"${inputs.homeManagerGitWorkspace}/modules/services/git-workspace.nix"
|
"${inputs.homeManagerGitWorkspace}/modules/services/git-workspace.nix"
|
||||||
inputs.catppuccin.homeManagerModules.catppuccin
|
|
||||||
];
|
];
|
||||||
secrets = {
|
secrets = {
|
||||||
"kirk-wireguard-private-key" = { };
|
"kirk-wireguard-private-key" = { };
|
||||||
|
@ -92,7 +90,6 @@
|
||||||
|
|
||||||
sisko = {
|
sisko = {
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
enableHomeManager = false;
|
|
||||||
vpn = {
|
vpn = {
|
||||||
ip = "10.100.0.1";
|
ip = "10.100.0.1";
|
||||||
publicKey = "bc5giljukT1+ChbbyTLdOfejfR3c8RZ4XoXmQM54nTY=";
|
publicKey = "bc5giljukT1+ChbbyTLdOfejfR3c8RZ4XoXmQM54nTY=";
|
||||||
|
@ -104,6 +101,7 @@
|
||||||
];
|
];
|
||||||
secrets = {
|
secrets = {
|
||||||
"sisko-wireguard-private-key" = { };
|
"sisko-wireguard-private-key" = { };
|
||||||
|
"cachix-personal-token".owner = "ccr";
|
||||||
"home-planimetry".owner = "hass";
|
"home-planimetry".owner = "hass";
|
||||||
"home-assistant-token".owner = "prometheus";
|
"home-assistant-token".owner = "prometheus";
|
||||||
"grafana-password".owner = "grafana";
|
"grafana-password".owner = "grafana";
|
||||||
|
@ -125,10 +123,6 @@
|
||||||
ip = "10.100.0.4";
|
ip = "10.100.0.4";
|
||||||
publicKey = "9ccx4C4xvPC6lPgTZAHDSfK4FS2BP2i4D57u9IZjw18=";
|
publicKey = "9ccx4C4xvPC6lPgTZAHDSfK4FS2BP2i4D57u9IZjw18=";
|
||||||
};
|
};
|
||||||
macos-ventura = {
|
|
||||||
ip = "10.100.0.6";
|
|
||||||
publicKey = "/Eee1V0PsjZSzj7un1NxHKtFR+TpUIgJ7VAdIAzmvzQ=";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
fleetModules,
|
fleetModules,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
config,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
@ -8,6 +9,7 @@
|
||||||
fleetModules [
|
fleetModules [
|
||||||
"common"
|
"common"
|
||||||
"ssh"
|
"ssh"
|
||||||
|
"ccr"
|
||||||
"wireguard-server"
|
"wireguard-server"
|
||||||
"mediatomb"
|
"mediatomb"
|
||||||
"transmission"
|
"transmission"
|
||||||
|
@ -33,12 +35,32 @@
|
||||||
./disko.nix
|
./disko.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_8;
|
||||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_10;
|
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_10;
|
||||||
|
# boot.kernelPackages = let
|
||||||
|
# pkgs = fleetFlake.inputs.nixpkgsForSisko.legacyPackages.aarch64-linux;
|
||||||
|
# in
|
||||||
|
# pkgs.linuxPackagesFor pkgs.linux_testing;
|
||||||
|
# boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.linux_6_9.override {
|
||||||
|
# argsOverride = {
|
||||||
|
# src = pkgs.fetchFromGitLab {
|
||||||
|
# domain = "gitlab.collabora.com";
|
||||||
|
# owner = "hardware-enablement/rockchip-3588";
|
||||||
|
# repo = "linux";
|
||||||
|
# rev = "23bb9c65a88c114bbe945b7ef5366bb02d3d9b80";
|
||||||
|
# sha256 = "sha256-6TygOl5r7/N2jlcPznWlvJfVVeXKSR8yMoGuTDbIdTA=";
|
||||||
|
# };
|
||||||
|
# version = "6.9";
|
||||||
|
# modDirVersion = "6.9.0";
|
||||||
|
# };
|
||||||
|
# });
|
||||||
|
|
||||||
system.stateVersion = "24.05";
|
system.stateVersion = "24.05";
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = "schedutil";
|
powerManagement.cpuFreqGovernor = "schedutil";
|
||||||
|
|
||||||
|
ccr.enable = true;
|
||||||
|
|
||||||
nixpkgs.hostPlatform = "aarch64-linux";
|
nixpkgs.hostPlatform = "aarch64-linux";
|
||||||
|
|
||||||
swapDevices = [ ];
|
swapDevices = [ ];
|
||||||
|
@ -76,6 +98,7 @@
|
||||||
"/var/log"
|
"/var/log"
|
||||||
"/var/lib/containers"
|
"/var/lib/containers"
|
||||||
"/var/lib/postgresql"
|
"/var/lib/postgresql"
|
||||||
|
"/home/${config.ccr.username}/.ssh"
|
||||||
];
|
];
|
||||||
files = [
|
files = [
|
||||||
"/etc/machine-id"
|
"/etc/machine-id"
|
||||||
|
|
|
@ -1,24 +1,15 @@
|
||||||
{ lib, ... }:
|
{ fleetFlake, ... }:
|
||||||
{
|
{
|
||||||
services.macos-ventura = {
|
services.macos-ventura = {
|
||||||
enable = true;
|
enable = true;
|
||||||
cores = 8;
|
cores = 8;
|
||||||
threads = 8;
|
threads = 8;
|
||||||
mem = "16G";
|
mem = "8G";
|
||||||
vncListenAddr = "0.0.0.0";
|
vncListenAddr = "0.0.0.0";
|
||||||
sshListenAddr = "127.0.0.1";
|
|
||||||
extraQemuFlags = [ "-nographic" ];
|
extraQemuFlags = [ "-nographic" ];
|
||||||
sshPort = 2022;
|
sshPort = 2021;
|
||||||
vncDisplayNumber = 1; # means port 59001
|
installNix = true;
|
||||||
stateless = false;
|
stateless = true;
|
||||||
openFirewall = true;
|
darwinConfig = fleetFlake.darwinConfigurations.archer;
|
||||||
autoStart = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.ssh.extraConfig = lib.mkAfter ''
|
|
||||||
Host macos-ventura
|
|
||||||
Hostname localhost
|
|
||||||
Port 2022
|
|
||||||
Compression yes
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,9 @@
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
HostKey /ssh_initrd_host_ed25519_key
|
HostKey /ssh_initrd_host_ed25519_key
|
||||||
'';
|
'';
|
||||||
authorizedKeys = with (import ../../lib).keys; [
|
authorizedKeys = with (import ../../lib).keys.users; [
|
||||||
users.ccr-gpg
|
ccr-gpg
|
||||||
users.ccr-ssh
|
ccr-ssh
|
||||||
hosts.sisko
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,6 +45,8 @@
|
||||||
"d /mnt/hd/torrent/.incomplete 770 transmission transmission"
|
"d /mnt/hd/torrent/.incomplete 770 transmission transmission"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
ccr.extraGroups = [ "transmission" ];
|
||||||
|
|
||||||
environment.persistence."/persist".directories = [
|
environment.persistence."/persist".directories = [
|
||||||
config.services.transmission.home
|
config.services.transmission.home
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
{
|
|
||||||
writers,
|
|
||||||
python3Packages,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
writers.writePython3Bin "emails-watcher" {
|
|
||||||
libraries = with python3Packages; [
|
|
||||||
watchdog
|
|
||||||
desktop-notifier
|
|
||||||
];
|
|
||||||
flakeIgnore = [ ];
|
|
||||||
} (builtins.readFile ./emails-watcher.py)
|
|
|
@ -1,43 +0,0 @@
|
||||||
import os
|
|
||||||
from watchdog.observers import Observer
|
|
||||||
from watchdog.events import FileSystemEventHandler
|
|
||||||
from email import message_from_file
|
|
||||||
from desktop_notifier import DesktopNotifierSync, DEFAULT_SOUND, Icon
|
|
||||||
|
|
||||||
|
|
||||||
class MaildirHandler(FileSystemEventHandler):
|
|
||||||
def __init__(self, notifier):
|
|
||||||
super().__init__()
|
|
||||||
self.notifier = notifier
|
|
||||||
|
|
||||||
def on_created(self, event):
|
|
||||||
if not event.is_directory:
|
|
||||||
print(f"New email found: {event.src_path}")
|
|
||||||
with open(event.src_path, 'r') as email_file:
|
|
||||||
msg = message_from_file(email_file)
|
|
||||||
print(f'{msg["From"]}: {msg["Subject"]}')
|
|
||||||
self.notifier.send(
|
|
||||||
title=msg["From"],
|
|
||||||
message=msg["Subject"],
|
|
||||||
sound=DEFAULT_SOUND,
|
|
||||||
icon=Icon(name="mail-message-new"),
|
|
||||||
timeout=20
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
maildir_new = os.path.expanduser(os.environ.get("INBOX_NEW"))
|
|
||||||
notifier = DesktopNotifierSync(
|
|
||||||
app_name="Mails",
|
|
||||||
notification_limit=10
|
|
||||||
)
|
|
||||||
|
|
||||||
event_handler = MaildirHandler(notifier)
|
|
||||||
observer = Observer()
|
|
||||||
|
|
||||||
observer.schedule(event_handler, maildir_new, recursive=False)
|
|
||||||
|
|
||||||
print(f"Monitoring {maildir_new} for new emails...")
|
|
||||||
|
|
||||||
observer.start()
|
|
||||||
observer.join()
|
|
Loading…
Add table
Reference in a new issue