diff --git a/flake.lock b/flake.lock index 50c6096..1168cce 100644 --- a/flake.lock +++ b/flake.lock @@ -675,15 +675,16 @@ "osx-kvm": "osx-kvm" }, "locked": { - "lastModified": 1727105240, - "narHash": "sha256-FEuqbcZ4TDUMwCpTA/E3J5L7pLD4U+zXPnZbmXSmaJo=", - "owner": "MatthewCroughan", + "lastModified": 1708168451, + "narHash": "sha256-loWlwexnfQGFsEHeJbXpWbnmeDFkBwZB38+4BkUcGhM=", + "owner": "aciceri", "repo": "NixThePlanet", - "rev": "2f622af217807da78e44a5a15f620743dac57f46", + "rev": "e8c91035d01f5082ccf30e351dcd993a5b480a72", "type": "github" }, "original": { - "owner": "MatthewCroughan", + "owner": "aciceri", + "ref": "nix-in-darwin", "repo": "NixThePlanet", "type": "github" } diff --git a/flake.nix b/flake.nix index 28b3f03..001eca4 100644 --- a/flake.nix +++ b/flake.nix @@ -30,7 +30,7 @@ }; dream2nix.url = "github:nix-community/dream2nix"; nixThePlanet = { - url = "github:MatthewCroughan/NixThePlanet/"; + url = "github:aciceri/NixThePlanet/nix-in-darwin"; inputs.nixpkgs.follows = "nixpkgs"; }; nixDarwin = { diff --git a/hmModules/catppuccin/default.nix b/hmModules/catppuccin/default.nix index 4d485ac..7b00ca9 100644 --- a/hmModules/catppuccin/default.nix +++ b/hmModules/catppuccin/default.nix @@ -10,4 +10,30 @@ platformTheme.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; + }; + }; + }; } diff --git a/hmModules/email/default.nix b/hmModules/email/default.nix index 829f6c7..648bbc8 100644 --- a/hmModules/email/default.nix +++ b/hmModules/email/default.nix @@ -1,8 +1,6 @@ { pkgs, secrets, - fleetFlake, - lib, ... }: { @@ -177,6 +175,9 @@ compose = { no-attachment-warning = "^[^>]*attach(ed|ment)"; }; + triggers = { + email-received = ''exec notify-send "New email from %n" "%s"''; + }; filters = { "text/plain" = "colorize"; "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.autistici = { aerc.enable = true; diff --git a/hmModules/zmkbatx/default.nix b/hmModules/zmkbatx/default.nix index ff8c992..0070092 100644 --- a/hmModules/zmkbatx/default.nix +++ b/hmModules/zmkbatx/default.nix @@ -16,9 +16,7 @@ }; Service = { - ExecStart = '' - ${pkgs.runtimeShell} -l -c "${lib.getExe' pkgs.busybox "sleep"} 5 && ${lib.getExe pkgs.zmkBATx}" - ''; + ExecStart = "sleep 5 && ${lib.getExe pkgs.zmkBATx}"; Restart = "on-failure"; RestartSec = 3; }; diff --git a/hosts/default.nix b/hosts/default.nix index 0498e19..480c37d 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -44,11 +44,9 @@ inputs.disko.nixosModules.disko inputs.nixosHardware.nixosModules.lenovo-thinkpad-x1-7th-gen inputs.lix-module.nixosModules.default - inputs.catppuccin.nixosModules.catppuccin ]; extraHmModules = [ "${inputs.homeManagerGitWorkspace}/modules/services/git-workspace.nix" - inputs.catppuccin.homeManagerModules.catppuccin ]; secrets = { "kirk-wireguard-private-key" = { }; @@ -92,7 +90,6 @@ sisko = { system = "aarch64-linux"; - enableHomeManager = false; vpn = { ip = "10.100.0.1"; publicKey = "bc5giljukT1+ChbbyTLdOfejfR3c8RZ4XoXmQM54nTY="; @@ -104,6 +101,7 @@ ]; secrets = { "sisko-wireguard-private-key" = { }; + "cachix-personal-token".owner = "ccr"; "home-planimetry".owner = "hass"; "home-assistant-token".owner = "prometheus"; "grafana-password".owner = "grafana"; @@ -125,10 +123,6 @@ ip = "10.100.0.4"; publicKey = "9ccx4C4xvPC6lPgTZAHDSfK4FS2BP2i4D57u9IZjw18="; }; - macos-ventura = { - ip = "10.100.0.6"; - publicKey = "/Eee1V0PsjZSzj7un1NxHKtFR+TpUIgJ7VAdIAzmvzQ="; - }; }; }; } diff --git a/hosts/sisko/default.nix b/hosts/sisko/default.nix index 44277c3..8341327 100644 --- a/hosts/sisko/default.nix +++ b/hosts/sisko/default.nix @@ -1,6 +1,7 @@ { fleetModules, pkgs, + config, ... }: { @@ -8,6 +9,7 @@ fleetModules [ "common" "ssh" + "ccr" "wireguard-server" "mediatomb" "transmission" @@ -33,12 +35,32 @@ ./disko.nix ]; + # boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_8; 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"; powerManagement.cpuFreqGovernor = "schedutil"; + ccr.enable = true; + nixpkgs.hostPlatform = "aarch64-linux"; swapDevices = [ ]; @@ -76,6 +98,7 @@ "/var/log" "/var/lib/containers" "/var/lib/postgresql" + "/home/${config.ccr.username}/.ssh" ]; files = [ "/etc/machine-id" diff --git a/modules/macos-ventura/default.nix b/modules/macos-ventura/default.nix index b3824a5..919e4c8 100644 --- a/modules/macos-ventura/default.nix +++ b/modules/macos-ventura/default.nix @@ -1,24 +1,15 @@ -{ lib, ... }: +{ fleetFlake, ... }: { services.macos-ventura = { enable = true; cores = 8; threads = 8; - mem = "16G"; + mem = "8G"; vncListenAddr = "0.0.0.0"; - sshListenAddr = "127.0.0.1"; extraQemuFlags = [ "-nographic" ]; - sshPort = 2022; - vncDisplayNumber = 1; # means port 59001 - stateless = false; - openFirewall = true; - autoStart = false; + sshPort = 2021; + installNix = true; + stateless = true; + darwinConfig = fleetFlake.darwinConfigurations.archer; }; - - programs.ssh.extraConfig = lib.mkAfter '' - Host macos-ventura - Hostname localhost - Port 2022 - Compression yes - ''; } diff --git a/modules/ssh-initrd/default.nix b/modules/ssh-initrd/default.nix index a67e1f3..79a936d 100644 --- a/modules/ssh-initrd/default.nix +++ b/modules/ssh-initrd/default.nix @@ -14,10 +14,9 @@ extraConfig = '' HostKey /ssh_initrd_host_ed25519_key ''; - authorizedKeys = with (import ../../lib).keys; [ - users.ccr-gpg - users.ccr-ssh - hosts.sisko + authorizedKeys = with (import ../../lib).keys.users; [ + ccr-gpg + ccr-ssh ]; }; }; diff --git a/modules/transmission/default.nix b/modules/transmission/default.nix index 2052b37..2a1f3cb 100644 --- a/modules/transmission/default.nix +++ b/modules/transmission/default.nix @@ -45,6 +45,8 @@ "d /mnt/hd/torrent/.incomplete 770 transmission transmission" ]; + ccr.extraGroups = [ "transmission" ]; + environment.persistence."/persist".directories = [ config.services.transmission.home ]; diff --git a/packages/emails-watcher/default.nix b/packages/emails-watcher/default.nix deleted file mode 100644 index 965086f..0000000 --- a/packages/emails-watcher/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - writers, - python3Packages, - ... -}: -writers.writePython3Bin "emails-watcher" { - libraries = with python3Packages; [ - watchdog - desktop-notifier - ]; - flakeIgnore = [ ]; -} (builtins.readFile ./emails-watcher.py) diff --git a/packages/emails-watcher/emails-watcher.py b/packages/emails-watcher/emails-watcher.py deleted file mode 100644 index b9716da..0000000 --- a/packages/emails-watcher/emails-watcher.py +++ /dev/null @@ -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()