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 strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Data::Dumper;
|
use MIME::Base64;
|
||||||
|
|
||||||
use lib "${perlPackages.JSON}/${perl.libPrefix}/${perl.version}/";
|
use lib "${perlPackages.JSON}/${perl.libPrefix}/${perl.version}/";
|
||||||
use JSON qw{ decode_json encode_json };
|
use JSON qw{ decode_json encode_json };
|
||||||
|
|
||||||
my $info = decode_json(`nixos-version --json`);
|
my $info = decode_json(`nixos-version --json`);
|
||||||
$info->{needs_restart} = system('check-restart >/dev/null') == 0 ? JSON::false : JSON::true;
|
$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;
|
print encode_json $info;
|
||||||
''
|
''
|
||||||
|
6
flake.lock
generated
6
flake.lock
generated
@ -495,11 +495,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1686054616,
|
"lastModified": 1687918035,
|
||||||
"narHash": "sha256-nBvQL3pSFZTBM0kM+/HVNFNbsa/It+OzQSlgKdIkgAY=",
|
"narHash": "sha256-bSvfoTFaKHJvY0rILLSEdp6qh1A6873HttfEXWhg9DU=",
|
||||||
"owner": "qbit",
|
"owner": "qbit",
|
||||||
"repo": "xintray",
|
"repo": "xintray",
|
||||||
"rev": "04dfd6b23e165c2e5495eeaf2b5ba2818a683bb2",
|
"rev": "249015115c30115f028e856e983a7838dfba2d7e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
Loading…
Reference in New Issue
Block a user