xin-status: update to show system diff when reboot is needed
This commit is contained in:
parent
1651d36746
commit
dfddcb42b6
@ -5,12 +5,17 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Data::Dumper;
|
||||
use MIME::Base64;
|
||||
|
||||
use lib "${perlPackages.JSON}/${perl.libPrefix}/${perl.version}/";
|
||||
use JSON qw{ decode_json encode_json };
|
||||
|
||||
my $info = decode_json(`nixos-version --json`);
|
||||
$info->{needs_restart} = system('check-restart >/dev/null') == 0 ? JSON::false : JSON::true;
|
||||
my $sys_diff = `nix store diff-closures /run/booted-system /run/current-system`;
|
||||
$sys_diff =~ s/\e\[[0-9;]*m(?:\e\[K)?//g;
|
||||
|
||||
$info->{system_diff} = encode_base64($sys_diff);
|
||||
|
||||
print encode_json $info;
|
||||
''
|
||||
|
6
flake.lock
generated
6
flake.lock
generated
@ -495,11 +495,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1686054616,
|
||||
"narHash": "sha256-nBvQL3pSFZTBM0kM+/HVNFNbsa/It+OzQSlgKdIkgAY=",
|
||||
"lastModified": 1687918035,
|
||||
"narHash": "sha256-bSvfoTFaKHJvY0rILLSEdp6qh1A6873HttfEXWhg9DU=",
|
||||
"owner": "qbit",
|
||||
"repo": "xintray",
|
||||
"rev": "04dfd6b23e165c2e5495eeaf2b5ba2818a683bb2",
|
||||
"rev": "249015115c30115f028e856e983a7838dfba2d7e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
Loading…
Reference in New Issue
Block a user