Migrate to Snowfall (#1)

Reviewed-on: #1
Co-authored-by: Evan Reichard <evan@reichard.io>
Co-committed-by: Evan Reichard <evan@reichard.io>
This commit was merged in pull request #1.
This commit is contained in:
2025-04-21 00:56:53 +00:00
committed by evan
parent 72ba8ddf59
commit cf0fa75058
118 changed files with 3590 additions and 1571 deletions

View File

@@ -0,0 +1,35 @@
{ config, pkgs, lib, namespace, ... }:
let
cfg = config.${namespace}.services.fusuma;
in
{
options.${namespace}.services.fusuma = {
enable = lib.mkEnableOption "Fusuma";
};
config = lib.mkIf cfg.enable {
services.fusuma = {
enable = true;
extraPackages = with pkgs; [ ydotool deterministic-uname uutils-coreutils-noprefix ];
settings = {
swipe = {
"3" = {
begin = {
command = "ydotool click 40";
interval = 0.00;
};
update = {
command = "ydotool mousemove -- $move_x, $move_y";
interval = 0.01;
accel = 1.00;
# accel = 1.70;
};
end = {
command = "ydotool click 80";
};
};
};
};
};
};
}

View File

@@ -0,0 +1,41 @@
{ config, lib, namespace, pkgs, ... }:
let
inherit (lib) mkIf types;
inherit (lib.${namespace}) mkOpt;
cfg = config.${namespace}.services.sops;
in
{
options.${namespace}.services.sops = with types; {
enable = lib.mkEnableOption "sops";
defaultSopsFile = mkOpt path null "Default sops file.";
sshKeyPaths = mkOpt (listOf path) [ ] "SSH Key paths to use.";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
age
sops
ssh-to-age
];
sops = {
inherit (cfg) defaultSopsFile;
defaultSopsFormat = "yaml";
age = {
generateKey = true;
keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ] ++ cfg.sshKeyPaths;
};
# TODO
# secrets = {
# nix = {
# sopsFile = lib.snowfall.fs.get-file "secrets/default.yaml";
# path = "${config.home.homeDirectory}/.config/nix/nix.conf";
# };
# };
};
};
}

View File

@@ -0,0 +1,15 @@
{ config, lib, namespace, ... }:
let
cfg = config.${namespace}.services.ssh-agent;
in
{
options.${namespace}.services.ssh-agent = {
enable = lib.mkEnableOption "ssh-agent service";
};
config = lib.mkIf cfg.enable {
services.ssh-agent = {
enable = true;
};
};
}

View File

@@ -0,0 +1,73 @@
{ config, lib, pkgs, namespace, ... }:
let
cfg = config.${namespace}.services.swww;
in
{
options.${namespace}.services.swww = {
enable = lib.mkEnableOption "swww wallpaper service";
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
swww
];
systemd.user = {
services = {
swww-daemon = {
Unit = {
Description = "SWWW Wallpaper Daemon";
After = [ "graphical-session.target" ];
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.swww}/bin/swww-daemon";
Restart = "on-failure";
RestartSec = 5;
};
};
change-wallpaper = {
Unit = {
Description = "SWWW Wallpaper Changer";
After = [ "swww-daemon.service" ];
Requires = [ "swww-daemon.service" ];
};
Install = {
WantedBy = [ "swww-daemon.service" ];
};
Service = {
Type = "oneshot";
ExecStart = "${pkgs.writeShellScript "change-wallpaper-script" ''
WALLPAPER=$(${pkgs.findutils}/bin/find $HOME/Wallpapers -type f | ${pkgs.coreutils}/bin/shuf -n 1)
${pkgs.swww}/bin/swww img "$WALLPAPER" --transition-type random
''}";
};
};
};
timers.swww-schedule = {
Unit = {
Description = "SWWW Wallpaper Schedule";
};
Install = {
WantedBy = [ "timers.target" ];
};
Timer = {
OnBootSec = "1min";
OnUnitActiveSec = "1h";
Unit = "change-wallpaper.service";
};
};
};
};
}