nix-config/nixos/common/users/sajenim/default.nix
jasmine b0bfb37d3c
refactor(viridian): migrate service data to dedicated BTRFS subvolumes
Migrate from path-based persistence (/persist/var/lib/*) to dedicated
BTRFS subvolumes for better data isolation and snapshot capabilities.

- Move valuable user-facing services to /srv/* with srv-* subvolumes:
  - forgejo: git repositories and database
  - opengist: paste data
  - minecraft: game world data
  - lighttpd: static web content
  - containers: OCI container volumes

- Update home directory to use hm-sajenim subvolume on viridian disk
- Remove jupyterhub service (no longer in use)
- Update borgbackup paths to match new service locations
- Follow upstream service defaults where possible for maintainability

Services kept on /persist (disposable state):
- traefik, crowdsec, murmur
2025-10-06 13:07:46 +08:00

38 lines
960 B
Nix

{
inputs,
outputs,
pkgs,
config,
...
}: let
hostname = config.networking.hostName;
in {
imports = [
inputs.home-manager.nixosModules.home-manager
];
users.users.sajenim = {
isNormalUser = true;
extraGroups = ["audio" "docker" "networkmanager" "wheel" "adbusers" "scanner" "lp"];
shell = pkgs.zsh;
openssh.authorizedKeys.keyFiles = [
"${inputs.self}/home-manager/sajenim/sajenim_sk.pub"
];
hashedPassword = "$y$j9T$qIhW5qL9J9w.w6JWa.bGo/$oddG3HJyOZ1mwHzYnYPJ/MzN38oHEBEvPDc0sB3rAf9";
};
users.mutableUsers = false;
home-manager = {
extraSpecialArgs = {inherit inputs outputs;};
users = {
sajenim = import "${inputs.self}/home-manager/sajenim/${config.networking.hostName}.nix";
};
backupFileExtension = "bak";
};
fileSystems."/home/sajenim" = {
device = "/dev/disk/by-label/${hostname}";
fsType = "btrfs";
options = ["subvol=hm-sajenim" "compress=zstd"];
};
}