@@ -7,9 +7,13 @@ in {
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.dms-shell = {
|
||||
programs.dank-material-shell = {
|
||||
enable = true;
|
||||
enableDynamicTheming = false;
|
||||
systemd = {
|
||||
enable = true;
|
||||
restartIfChanged = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Start after xwayland-satellite, if possible. So DMS can start
|
||||
@@ -19,10 +23,35 @@ in {
|
||||
after = ["xwayland-satellite.service"];
|
||||
};
|
||||
|
||||
# services.greetd.settings.default_session.command = "";
|
||||
|
||||
services.displayManager.dms-greeter = {
|
||||
enable = true;
|
||||
compositor.name = assert config.sydnix.niri.enable; "niri";
|
||||
compositor = {
|
||||
name = assert config.sydnix.niri.enable; "niri";
|
||||
# see: https://github.com/AvengeMedia/DankMaterialShell/commit/5ceb908b8b69c253e259b5437020192dcad4bfde
|
||||
customConfig = ''
|
||||
hotkey-overlay {
|
||||
skip-at-startup
|
||||
}
|
||||
environment {
|
||||
DMS_RUN_GREETER "1"
|
||||
}
|
||||
gestures {
|
||||
hot-corners {
|
||||
off
|
||||
}
|
||||
}
|
||||
layout {
|
||||
background-color "#000000"
|
||||
}
|
||||
'';
|
||||
};
|
||||
configHome = "/home/msyds"; # Really stupid.
|
||||
logs = {
|
||||
save = true;
|
||||
path = "/var/lib/dms-greeter/log";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -14,10 +14,12 @@ in {
|
||||
ROCKET_PORT = 8222;
|
||||
DOMAIN = "https://vault.deertopia.net";
|
||||
};
|
||||
backupDir = "/var/backup/vaultwarden";
|
||||
};
|
||||
|
||||
sydnix.impermanence.directories = [
|
||||
"/var/backup/vaultwarden"
|
||||
config.services.vaultwarden.backupDir
|
||||
"/var/lib/bitwarden_rs"
|
||||
];
|
||||
|
||||
services.nginx.upstreams.vaultwarden.servers =
|
||||
|
||||
@@ -24,36 +24,75 @@ in {
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot.initrd.postDeviceCommands = ''
|
||||
# Mount the btrfs filesystem.
|
||||
mkdir -p /btrfs-tmp
|
||||
mount -t btrfs "${cfg.device}" /btrfs-tmp
|
||||
boot.initrd.systemd = {
|
||||
services.impermance-btrfs-rolling-root = {
|
||||
description = "Archiving existing BTRFS root subvolume and creating a fresh one";
|
||||
unitConfig.DefaultDependencies = false;
|
||||
serviceConfig = {
|
||||
# The script needs to run to completion before this service
|
||||
# is done
|
||||
Type = "oneshot";
|
||||
# NOTE: to be able to see errors in your script do this
|
||||
StandardOutput = "journal+console";
|
||||
StandardError = "journal+console";
|
||||
};
|
||||
# This service is required for boot to succeed
|
||||
requiredBy = ["initrd.target"];
|
||||
# Should complete before any file systems are mounted
|
||||
before = ["sysroot.mount"];
|
||||
|
||||
# If the moribund subvolume exists, send it do 'death row' (old-roots),
|
||||
# where live for about three days before its eventual deletion.
|
||||
if [[ -e "/btrfs-tmp/${cfg.subvolume}" ]]; then
|
||||
mkdir -p /btrfs-tmp/old-roots
|
||||
timestamp=$(date --date="@$(stat -c %Y "/btrfs-tmp/${cfg.subvolume}")" "+%Y-%m-%-d_%H:%M:%S")
|
||||
mv "/btrfs-tmp/${cfg.subvolume}" "/btrfs-tmp/old-roots/$timestamp"
|
||||
fi
|
||||
# Wait until the root device is available
|
||||
# If you're altering a different device, specify its device unit explicitly.
|
||||
# see: systemd-escape(1)
|
||||
requires = ["initrd-root-device.target"];
|
||||
after = [
|
||||
"initrd-root-device.target"
|
||||
# Allow hibernation to resume before trying to alter any data
|
||||
"local-fs-pre.target"
|
||||
];
|
||||
|
||||
delete_subvolume_recursively() {
|
||||
IFS=$'\n'
|
||||
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
|
||||
delete_subvolume_recursively "/btrfs-tmp/$i"
|
||||
done
|
||||
btrfs subvolume delete "$1"
|
||||
}
|
||||
script = ''
|
||||
# Mount the btrfs filesystem.
|
||||
mkdir -p /btrfs-tmp
|
||||
mount -t btrfs "${cfg.device}" /btrfs-tmp
|
||||
|
||||
# Delete previous roots older than three days.
|
||||
# TODO: I would prefer archiving the last N previous roots, rather than
|
||||
# time.
|
||||
for i in $(find /btrfs-tmp/old-roots/ -maxdepth 1 -mtime +3); do
|
||||
delete_subvolume_recursively "$i"
|
||||
done
|
||||
# If the moribund subvolume exists, send it do 'death row' (old-roots),
|
||||
# where live for about three days before its eventual deletion.
|
||||
if [[ -e "/btrfs-tmp/${cfg.subvolume}" ]]; then
|
||||
mkdir -p /btrfs-tmp/old-roots
|
||||
timestamp=$(date --date="@$(stat -c %Y "/btrfs-tmp/${cfg.subvolume}")" "+%Y-%m-%-d_%H:%M:%S")
|
||||
mv "/btrfs-tmp/${cfg.subvolume}" "/btrfs-tmp/old-roots/$timestamp"
|
||||
fi
|
||||
|
||||
btrfs subvolume create "/btrfs-tmp/${cfg.subvolume}"
|
||||
umount /btrfs-tmp
|
||||
'';
|
||||
delete_subvolume_recursively() {
|
||||
IFS=$'\n'
|
||||
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
|
||||
delete_subvolume_recursively "/btrfs-tmp/$i"
|
||||
done
|
||||
btrfs subvolume delete "$1"
|
||||
}
|
||||
|
||||
# Delete previous roots older than three days.
|
||||
# TODO: I would prefer archiving the last N previous roots, rather than
|
||||
# time.
|
||||
for i in $(find /btrfs-tmp/old-roots/ -maxdepth 1 -mtime +3); do
|
||||
delete_subvolume_recursively "$i"
|
||||
done
|
||||
|
||||
btrfs subvolume create "/btrfs-tmp/${cfg.subvolume}"
|
||||
umount /btrfs-tmp
|
||||
'';
|
||||
};
|
||||
# NOTE: path = [...]; doesnt work for initrd, use full paths in
|
||||
# your script or extraBin
|
||||
extraBin = {
|
||||
"mkdir" = "${pkgs.coreutils}/bin/mkdir";
|
||||
"date" = "${pkgs.coreutils}/bin/date";
|
||||
"stat" = "${pkgs.coreutils}/bin/stat";
|
||||
"mv" = "${pkgs.coreutils}/bin/mv";
|
||||
"find" = "${pkgs.findutils}/bin/find";
|
||||
"btrfs" = "${pkgs.btrfs-progs}/bin/btrfs";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ in {
|
||||
package = pkgs.niri-unstable;
|
||||
};
|
||||
|
||||
security.pam.services.swaylock = {};
|
||||
# security.pam.services.swaylock = {};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user