YLW6ZFTIGIC2V6ZUA3I2T7MMPW5BZCOORLB2WSJYNUB3AGWLSEKQC 5JJDQRHNZKDO3WPFQ6K755UIWMOPE5SKWFRHZ3RA2RICI4B7QK5AC DEDLAAWWX2GNYW5AG53E4HYVIZ7VY47UQJDI632A77T3B4WTL4QQC 74LUVAFMW7DBBMCXTOGAPE3W7GJYVBDVANLMOPXIJ6XU7HN2O6TQC OPVLEXF5H3CHSU43PIQ4M75UAE3UIKQ5WTVYUOD4M7MPUHLP26LQC SZWLTDX3SVMOR7TLYLTRPNZUQLG2YS2I46A3YHE32PTPP75NKASAC QGBCI5OMIHDEXEJIO2BFCRRAQP4445DO2ZVWDU3FMEFUD6WWBKSQC SJBGJVNSXEMBKQUEH7HTQ6JVP7CKCEH2L4GD5JS7TOWPOFLTIQZQC ZTNTE7FP3ORFWLNTJ7GJ6DVR6BMUXAHWAYVFOOQMQ5PMBCKWYTLQC V2RX2Y7VB7Y3BHX3ALK4GTCMFJATMLCKIAT4U3XCYZZZIUBIIZ5QC NL74BK76PCP3DH26NB756WU22JMZOT43CEDXPU4ERAMAFVXNB4TAC MQT74AV47PUYNCX27OMFK6BFN7PP4DX46JAACN2EPRYXUXV7EL3AC T2G6MVXVU46MCUW4KMFDBHDEJIZCZEFO3FUSC2WUSZDJBS25CFKAC IIKX3VEETOC4EMIS77YTJTEV24CXCQ434HGESITLOACHUC7QGDUQC F62TRVFONDJZFEA3NIKOQUNIPZWHHDEESV263HE3XRTCTPOGXOWAC VLQ45OFB6Q2PBFEV2LCV2UINWGUL5YFD4MJ3PWP464VZWLD75HAQC JU3FNMQQ2AZ4NITYUGSBZPJO645Y5TVL5TEQPNKVW2QXQQDIL6JQC DAUFNLZJ77JZBNQ7DSFFEDN2D33CN6TH3KAA3L3N7AGNFXYTROLQC 6KKLYLEP3IUF3NWXB6OO5C2X75S4U5OK7E2L7HIWWC3P7FG62EZAC config.flake.modules.hjem.wsl-backup = {files."wsl-backup.nu" = {executable = true;text = /* nu */ ''#!/usr/bin/env nudef log [msg: string, level: string = "INFO"] {let timestamp = (date now | format date '%Y-%m-%d %H:%M:%S')print $"[($timestamp)] ($level): ($msg)"}
config.flake.modules.hjem.wsl-backup ={ lib, isWsl, ... }:letinherit (lib.modules) mkIf;inmkIf isWsl {files."wsl-backup.nu" = {executable = true;text = /* nu */ ''#!/usr/bin/env nudef log [msg: string, level: string = "INFO"] {let timestamp = (date now | format date '%Y-%m-%d %H:%M:%S')print $"[($timestamp)] ($level): ($msg)"}
let nixos_host = "pear"let github_repo = "plumj-am/nixos"let windows_drive = "c"let windows_user = "james"let windows_base = $"/mnt/($windows_drive)/Users/($windows_user)"let backup_path = $"($windows_base)/nixos-wsl-backup"let backup_file = $"($backup_path)/nixos.wsl"
let nixos_host = "pear"let github_repo = "plumj-am/nixos"let windows_drive = "c"let windows_user = "james"let windows_base = $"/mnt/($windows_drive)/Users/($windows_user)"let backup_path = $"($windows_base)/nixos-wsl-backup"let backup_file = $"($backup_path)/nixos.wsl"log "Checking prerequisites..."
log "Cloning repository..."cd $temp_dirtry {^git clone https://github.com/($github_repo).git repocd repo} catch { |e|log $"Git clone failed: ($e.msg)" "ERROR"^rm -rf $temp_direxit 1}
log "Building system tarball..."try {^sudo nix run .#nixosConfigurations.($nixos_host).config.system.build.tarballBuilder --accept-flake-config} catch { |e|log $"Tarball build failed: ($e.msg)" "ERROR"^rm -rf $temp_direxit 1}
log "Building system tarball..."try {^sudo nix run .#nixosConfigurations.($nixos_host).config.system.build.tarballBuilder --accept-flake-config} catch { |e|log $"Tarball build failed: ($e.msg)" "ERROR"^rm -rf $temp_direxit 1}
let tarball_path = "nixos.wsl"if not ($tarball_path | path exists) {log $"Could not find generated tarball at ($tarball_path)" "ERROR"^rm -rf $temp_direxit 1}log $"Found tarball: ($tarball_path)"
let tarball_path = "nixos.wsl"if not ($tarball_path | path exists) {log $"Could not find generated tarball at ($tarball_path)" "ERROR"^rm -rf $temp_direxit 1}log $"Found tarball: ($tarball_path)"
log "Copying to backup location..."try {^cp $tarball_path $backup_filelog "Backup completed successfully!" "SUCCESS"log $"Backup located at: ($backup_file)"} catch { |e|log $"Copy failed: ($e.msg)" "ERROR"log $"Tarball available at: ($temp_dir)/repo/($tarball_path)" "WARN"^rm -rf $temp_direxit 1}
log "Copying to backup location..."try {^cp $tarball_path $backup_filelog "Backup completed successfully!" "SUCCESS"log $"Backup located at: ($backup_file)"} catch { |e|log $"Copy failed: ($e.msg)" "ERROR"log $"Tarball available at: ($temp_dir)/repo/($tarball_path)" "WARN"
letcommonSpecialArgs = config: inputs: {inherit inputs;inherit (config.age) secrets;inherit (config.network) hostName;isDesktop = config.isDesktop or false;isServer = config.isServer or false;isWsl = config.isWsl or false;isLinux = config.isLinux or false;isDarwin = config.isDarwin or false;};in
hjem.specialArgs = {inherit inputs theme;inherit (config.age) secrets;inherit (config.network) hostName;isDesktop = config.isDesktop or false;isServer = config.isServer or false;isLinux = config.isLinux or false;isDarwin = config.isDarwin or false;
hjem.specialArgs = commonSpecialArgs config inputs // {inherit theme;
settings.general = {location-provider = "geoclue2";temp-day = 4500;temp-night = 3500;
}:letinherit (lib.modules) mkIf;inmkIf isDesktop {rum.programs.gammastep = {enable = true;settings.general = {location-provider = "geoclue2";temp-day = 4500;temp-night = 3500;};